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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // FIXME: The name is probably wrong, but matches StyleResolverState callsit
e for consistency. | 46 // FIXME: The name is probably wrong, but matches StyleResolverState callsit
e for consistency. |
47 void initForStyleResolve(const Document&, RenderStyle*); | 47 void initForStyleResolve(const Document&, RenderStyle*); |
48 | 48 |
49 void setInitial(float effectiveZoom); | 49 void setInitial(float effectiveZoom); |
50 | 50 |
51 void didChangeFontParameters(bool); | 51 void didChangeFontParameters(bool); |
52 | 52 |
53 void inheritFrom(const FontDescription&); | 53 void inheritFrom(const FontDescription&); |
54 void fromSystemFont(CSSValueID, float effectiveZoom); | 54 void fromSystemFont(CSSValueID, float effectiveZoom); |
55 | 55 |
56 void setFontFamilyInitial(); | 56 FontFamily standardFontFamily() const; |
57 void setFontFamilyInherit(const FontDescription&); | 57 AtomicString standardFontFamilyName() const; |
58 void setFontFamilyValue(CSSValue*); | 58 AtomicString genericFontFamilyName(FontDescription::GenericFamilyType) const
; |
59 | 59 |
60 void setWeight(FontWeight); | 60 void setWeight(FontWeight); |
61 void setSize(const FontDescription::Size&); | 61 void setSize(const FontDescription::Size&); |
62 void setStretch(FontStretch); | 62 void setStretch(FontStretch); |
| 63 void setFamilyDescription(const FontDescription::FamilyDescription&); |
63 void setFeatureSettings(PassRefPtr<FontFeatureSettings>); | 64 void setFeatureSettings(PassRefPtr<FontFeatureSettings>); |
64 void setScript(const String& locale); | 65 void setScript(const String& locale); |
65 void setStyle(FontStyle); | 66 void setStyle(FontStyle); |
66 void setVariant(FontVariant); | 67 void setVariant(FontVariant); |
67 void setVariantLigatures(const FontDescription::VariantLigatures&); | 68 void setVariantLigatures(const FontDescription::VariantLigatures&); |
68 void setTextRendering(TextRenderingMode); | 69 void setTextRendering(TextRenderingMode); |
69 void setKerning(FontDescription::Kerning); | 70 void setKerning(FontDescription::Kerning); |
70 void setFontSmoothing(FontSmoothingMode); | 71 void setFontSmoothing(FontSmoothingMode); |
71 | 72 |
72 // FIXME: These need to just vend a Font object eventually. | 73 // FIXME: These need to just vend a Font object eventually. |
73 void createFont(PassRefPtrWillBeRawPtr<FontSelector>, const RenderStyle* par
entStyle, RenderStyle*); | 74 void createFont(PassRefPtrWillBeRawPtr<FontSelector>, const RenderStyle* par
entStyle, RenderStyle*); |
74 | 75 |
75 void createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector>, RenderStyle
*); | 76 void createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector>, RenderStyle
*); |
76 | 77 |
77 // FIXME: These should not be necessary eventually. | 78 // FIXME: These should not be necessary eventually. |
78 void setFontDirty(bool fontDirty) { m_fontDirty = fontDirty; } | 79 void setFontDirty(bool fontDirty) { m_fontDirty = fontDirty; } |
79 // FIXME: This is only used by an ASSERT in StyleResolver. Remove? | 80 // FIXME: This is only used by an ASSERT in StyleResolver. Remove? |
80 bool fontDirty() const { return m_fontDirty; } | 81 bool fontDirty() const { return m_fontDirty; } |
81 | 82 |
| 83 static FontDescription::FamilyDescription initialFamilyDescription() { retur
n FontDescription::FamilyDescription(initialGenericFamily()); } |
82 static FontFeatureSettings* initialFeatureSettings() { return nullptr; } | 84 static FontFeatureSettings* initialFeatureSettings() { return nullptr; } |
83 static FontDescription::GenericFamilyType initialGenericFamily() { return Fo
ntDescription::NoFamily; } | 85 static FontDescription::GenericFamilyType initialGenericFamily() { return Fo
ntDescription::StandardFamily; } |
84 static FontDescription::Size initialSize() { return FontDescription::Size(Fo
ntSize::initialKeywordSize(), 0.0f, false); } | 86 static FontDescription::Size initialSize() { return FontDescription::Size(Fo
ntSize::initialKeywordSize(), 0.0f, false); } |
85 static TextRenderingMode initialTextRendering() { return AutoTextRendering;
} | 87 static TextRenderingMode initialTextRendering() { return AutoTextRendering;
} |
86 static FontVariant initialVariant() { return FontVariantNormal; } | 88 static FontVariant initialVariant() { return FontVariantNormal; } |
87 static FontDescription::VariantLigatures initialVariantLigatures() { return
FontDescription::VariantLigatures(); } | 89 static FontDescription::VariantLigatures initialVariantLigatures() { return
FontDescription::VariantLigatures(); } |
88 static FontStyle initialStyle() { return FontStyleNormal; } | 90 static FontStyle initialStyle() { return FontStyleNormal; } |
89 static FontDescription::Kerning initialKerning() { return FontDescription::A
utoKerning; } | 91 static FontDescription::Kerning initialKerning() { return FontDescription::A
utoKerning; } |
90 static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; } | 92 static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; } |
91 static FontStretch initialStretch() { return FontStretchNormal; } | 93 static FontStretch initialStretch() { return FontStretchNormal; } |
92 static FontWeight initialWeight() { return FontWeightNormal; } | 94 static FontWeight initialWeight() { return FontWeightNormal; } |
93 | 95 |
94 friend class FontDescriptionChangeScope; | 96 friend class FontDescriptionChangeScope; |
95 | 97 |
96 private: | 98 private: |
97 | 99 |
98 // FIXME: "size" arg should be first for consistency with other similar func
tions. | 100 void setFamilyDescription(FontDescription&, const FontDescription::FamilyDes
cription&); |
99 void setSize(FontDescription&, const FontDescription::Size&); | 101 void setSize(FontDescription&, const FontDescription::Size&); |
100 void checkForOrientationChange(RenderStyle*); | 102 void checkForOrientationChange(RenderStyle*); |
101 // This function fixes up the default font size if it detects that the curre
nt generic font family has changed. -dwh | 103 // This function fixes up the default font size if it detects that the curre
nt generic font family has changed. -dwh |
102 void checkForGenericFamilyChange(RenderStyle*, const RenderStyle* parentStyl
e); | 104 void checkForGenericFamilyChange(RenderStyle*, const RenderStyle* parentStyl
e); |
103 void updateComputedSize(RenderStyle*, const RenderStyle* parentStyle); | 105 void updateComputedSize(RenderStyle*, const RenderStyle* parentStyle); |
104 void updateComputedSize(FontDescription&, RenderStyle*); | 106 void updateComputedSize(FontDescription&, RenderStyle*); |
105 | 107 |
106 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom
, float specifiedSize); | 108 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom
, float specifiedSize); |
107 | 109 |
108 RawPtrWillBeMember<const Document> m_document; | 110 RawPtrWillBeMember<const Document> m_document; |
(...skipping 10 matching lines...) Expand all Loading... |
119 // is changed, FontBuilder tracks the need to update | 121 // is changed, FontBuilder tracks the need to update |
120 // style->font() with this bool. | 122 // style->font() with this bool. |
121 bool m_fontDirty; | 123 bool m_fontDirty; |
122 | 124 |
123 friend class FontBuilderTest; | 125 friend class FontBuilderTest; |
124 }; | 126 }; |
125 | 127 |
126 } | 128 } |
127 | 129 |
128 #endif | 130 #endif |
OLD | NEW |