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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 } | 635 } |
636 | 636 |
637 void FontBuilder::updateComputedSize(RenderStyle* style, const RenderStyle* pare
ntStyle) | 637 void FontBuilder::updateComputedSize(RenderStyle* style, const RenderStyle* pare
ntStyle) |
638 { | 638 { |
639 FontDescriptionChangeScope scope(this); | 639 FontDescriptionChangeScope scope(this); |
640 | 640 |
641 scope.fontDescription().setComputedSize(getComputedSizeFromSpecifiedSize(sco
pe.fontDescription(), style->effectiveZoom(), scope.fontDescription().specifiedS
ize())); | 641 scope.fontDescription().setComputedSize(getComputedSizeFromSpecifiedSize(sco
pe.fontDescription(), style->effectiveZoom(), scope.fontDescription().specifiedS
ize())); |
642 } | 642 } |
643 | 643 |
644 // FIXME: style param should come first | 644 // FIXME: style param should come first |
645 void FontBuilder::createFont(PassRefPtr<FontSelector> fontSelector, const Render
Style* parentStyle, RenderStyle* style) | 645 void FontBuilder::createFont(PassRefPtrWillBeRawPtr<FontSelector> fontSelector,
const RenderStyle* parentStyle, RenderStyle* style) |
646 { | 646 { |
647 if (!m_fontDirty) | 647 if (!m_fontDirty) |
648 return; | 648 return; |
649 | 649 |
650 updateComputedSize(style, parentStyle); | 650 updateComputedSize(style, parentStyle); |
651 checkForGenericFamilyChange(style, parentStyle); | 651 checkForGenericFamilyChange(style, parentStyle); |
652 checkForOrientationChange(style); | 652 checkForOrientationChange(style); |
653 style->font().update(fontSelector); | 653 style->font().update(fontSelector); |
654 m_fontDirty = false; | 654 m_fontDirty = false; |
655 } | 655 } |
656 | 656 |
657 void FontBuilder::createFontForDocument(PassRefPtr<FontSelector> fontSelector, R
enderStyle* documentStyle) | 657 void FontBuilder::createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector> fon
tSelector, RenderStyle* documentStyle) |
658 { | 658 { |
659 FontDescription fontDescription = FontDescription(); | 659 FontDescription fontDescription = FontDescription(); |
660 fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle->
locale())); | 660 fontDescription.setScript(localeToScriptCodeForFontSelection(documentStyle->
locale())); |
661 fontDescription.setUsePrinterFont(m_document->printing()); | 661 fontDescription.setUsePrinterFont(m_document->printing()); |
662 | 662 |
663 setFontFamilyToStandard(fontDescription, m_document); | 663 setFontFamilyToStandard(fontDescription, m_document); |
664 fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1); | 664 fontDescription.setKeywordSize(CSSValueMedium - CSSValueXxSmall + 1); |
665 int size = FontSize::fontSizeForKeyword(m_document, CSSValueMedium, false); | 665 int size = FontSize::fontSizeForKeyword(m_document, CSSValueMedium, false); |
666 fontDescription.setSpecifiedSize(size); | 666 fontDescription.setSpecifiedSize(size); |
667 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescrip
tion, documentStyle->effectiveZoom(), size)); | 667 fontDescription.setComputedSize(getComputedSizeFromSpecifiedSize(fontDescrip
tion, documentStyle->effectiveZoom(), size)); |
668 | 668 |
669 FontOrientation fontOrientation; | 669 FontOrientation fontOrientation; |
670 NonCJKGlyphOrientation glyphOrientation; | 670 NonCJKGlyphOrientation glyphOrientation; |
671 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; | 671 getFontAndGlyphOrientation(documentStyle, fontOrientation, glyphOrientation)
; |
672 fontDescription.setOrientation(fontOrientation); | 672 fontDescription.setOrientation(fontOrientation); |
673 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); | 673 fontDescription.setNonCJKGlyphOrientation(glyphOrientation); |
674 documentStyle->setFontDescription(fontDescription); | 674 documentStyle->setFontDescription(fontDescription); |
675 documentStyle->font().update(fontSelector); | 675 documentStyle->font().update(fontSelector); |
676 } | 676 } |
677 | 677 |
678 } | 678 } |
OLD | NEW |