OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 | 441 |
442 scope.fontDescription().setCommonLigaturesState(commonLigaturesState); | 442 scope.fontDescription().setCommonLigaturesState(commonLigaturesState); |
443 scope.fontDescription().setDiscretionaryLigaturesState(discretionaryLigature
sState); | 443 scope.fontDescription().setDiscretionaryLigaturesState(discretionaryLigature
sState); |
444 scope.fontDescription().setHistoricalLigaturesState(historicalLigaturesState
); | 444 scope.fontDescription().setHistoricalLigaturesState(historicalLigaturesState
); |
445 } | 445 } |
446 | 446 |
447 void FontBuilder::setScript(const String& locale) | 447 void FontBuilder::setScript(const String& locale) |
448 { | 448 { |
449 FontDescriptionChangeScope scope(this); | 449 FontDescriptionChangeScope scope(this); |
450 | 450 |
451 scope.fontDescription().setScript(localeToScriptCodeForFontSelection(locale)
); | 451 scope.fontDescription().setLocale(AtomicString(locale)); |
452 } | 452 } |
453 | 453 |
454 void FontBuilder::setItalic(FontItalic italic) | 454 void FontBuilder::setItalic(FontItalic italic) |
455 { | 455 { |
456 FontDescriptionChangeScope scope(this); | 456 FontDescriptionChangeScope scope(this); |
457 | 457 |
458 scope.fontDescription().setItalic(italic); | 458 scope.fontDescription().setItalic(italic); |
459 } | 459 } |
460 | 460 |
461 void FontBuilder::setSmallCaps(FontSmallCaps smallCaps) | 461 void FontBuilder::setSmallCaps(FontSmallCaps smallCaps) |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 checkForGenericFamilyChange(style, parentStyle); | 639 checkForGenericFamilyChange(style, parentStyle); |
640 checkForZoomChange(style, parentStyle); | 640 checkForZoomChange(style, parentStyle); |
641 checkForOrientationChange(style); | 641 checkForOrientationChange(style); |
642 style->font().update(fontSelector); | 642 style->font().update(fontSelector); |
643 m_fontDirty = false; | 643 m_fontDirty = false; |
644 } | 644 } |
645 | 645 |
646 void FontBuilder::createFontForDocument(PassRefPtr<FontSelector> fontSelector, R
enderStyle* documentStyle) | 646 void FontBuilder::createFontForDocument(PassRefPtr<FontSelector> fontSelector, R
enderStyle* documentStyle) |
647 { | 647 { |
648 FontDescription fontDescription = FontDescription(); | 648 FontDescription fontDescription = FontDescription(); |
649 fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle->
locale())); | 649 UScriptCode script = localeToScriptCodeForFontSelection(documentStyle->local
e()); |
| 650 fontDescription.setLocale(documentStyle->locale()); |
650 if (Settings* settings = m_document->settings()) { | 651 if (Settings* settings = m_document->settings()) { |
651 fontDescription.setUsePrinterFont(m_document->printing()); | 652 fontDescription.setUsePrinterFont(m_document->printing()); |
652 const AtomicString& standardFont = settings->standardFontFamily(fontDesc
ription.script()); | 653 const AtomicString& standardFont = settings->standardFontFamily(script); |
653 if (!standardFont.isEmpty()) { | 654 if (!standardFont.isEmpty()) { |
654 fontDescription.setGenericFamily(FontDescription::StandardFamily); | 655 fontDescription.setGenericFamily(FontDescription::StandardFamily); |
655 fontDescription.firstFamily().setFamily(standardFont); | 656 fontDescription.firstFamily().setFamily(standardFont); |
656 fontDescription.firstFamily().appendFamily(0); | 657 fontDescription.firstFamily().appendFamily(0); |
657 } | 658 } |
658 fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1); | 659 fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1); |
659 int size = FontSize::fontSizeForKeyword(m_document, CSSValueMedium, fals
e); | 660 int size = FontSize::fontSizeForKeyword(m_document, CSSValueMedium, fals
e); |
660 fontDescription.setSpecifiedSize(size); | 661 fontDescription.setSpecifiedSize(size); |
661 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDes
cription, documentStyle->effectiveZoom(), size)); | 662 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDes
cription, documentStyle->effectiveZoom(), size)); |
662 } else { | 663 } else { |
663 fontDescription.setUsePrinterFont(m_document->printing()); | 664 fontDescription.setUsePrinterFont(m_document->printing()); |
664 } | 665 } |
665 | 666 |
666 FontOrientation fontOrientation; | 667 FontOrientation fontOrientation; |
667 NonCJKGlyphOrientation glyphOrientation; | 668 NonCJKGlyphOrientation glyphOrientation; |
668 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; | 669 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; |
669 fontDescription.setOrientation(fontOrientation); | 670 fontDescription.setOrientation(fontOrientation); |
670 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); | 671 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); |
671 documentStyle->setFontDescription(fontDescription); | 672 documentStyle->setFontDescription(fontDescription); |
672 documentStyle->font().update(fontSelector); | 673 documentStyle->font().update(fontSelector); |
673 } | 674 } |
674 | 675 |
675 } | 676 } |
OLD | NEW |