OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 , m_genericFamily(NoFamily) | 67 , m_genericFamily(NoFamily) |
68 , m_usePrinterFont(false) | 68 , m_usePrinterFont(false) |
69 , m_kerning(AutoKerning) | 69 , m_kerning(AutoKerning) |
70 , m_commonLigaturesState(NormalLigaturesState) | 70 , m_commonLigaturesState(NormalLigaturesState) |
71 , m_discretionaryLigaturesState(NormalLigaturesState) | 71 , m_discretionaryLigaturesState(NormalLigaturesState) |
72 , m_historicalLigaturesState(NormalLigaturesState) | 72 , m_historicalLigaturesState(NormalLigaturesState) |
73 , m_contextualLigaturesState(NormalLigaturesState) | 73 , m_contextualLigaturesState(NormalLigaturesState) |
74 , m_keywordSize(0) | 74 , m_keywordSize(0) |
75 , m_fontSmoothing(AutoSmoothing) | 75 , m_fontSmoothing(AutoSmoothing) |
76 , m_textRendering(AutoTextRendering) | 76 , m_textRendering(AutoTextRendering) |
77 , m_isSpecifiedFont(false) | |
78 , m_script(USCRIPT_COMMON) | 77 , m_script(USCRIPT_COMMON) |
79 , m_syntheticBold(false) | 78 , m_syntheticBold(false) |
80 , m_syntheticItalic(false) | 79 , m_syntheticItalic(false) |
81 , m_subpixelTextPosition(s_useSubpixelTextPositioning) | 80 , m_subpixelTextPosition(s_useSubpixelTextPositioning) |
82 , m_typesettingFeatures(s_defaultTypesettingFeatures) | 81 , m_typesettingFeatures(s_defaultTypesettingFeatures) |
83 { | 82 { |
84 } | 83 } |
85 | 84 |
86 bool operator==(const FontDescription&) const; | 85 bool operator==(const FontDescription&) const; |
87 bool operator!=(const FontDescription& other) const { return !(*this == othe
r); } | 86 bool operator!=(const FontDescription& other) const { return !(*this == othe
r); } |
(...skipping 27 matching lines...) Expand all Loading... |
115 FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMo
de>(m_fontSmoothing); } | 114 FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMo
de>(m_fontSmoothing); } |
116 TextRenderingMode textRendering() const { return static_cast<TextRenderingMo
de>(m_textRendering); } | 115 TextRenderingMode textRendering() const { return static_cast<TextRenderingMo
de>(m_textRendering); } |
117 UScriptCode script() const { return static_cast<UScriptCode>(m_script); } | 116 UScriptCode script() const { return static_cast<UScriptCode>(m_script); } |
118 bool isSyntheticBold() const { return m_syntheticBold; } | 117 bool isSyntheticBold() const { return m_syntheticBold; } |
119 bool isSyntheticItalic() const { return m_syntheticItalic; } | 118 bool isSyntheticItalic() const { return m_syntheticItalic; } |
120 bool useSubpixelPositioning() const { return m_subpixelTextPosition; } | 119 bool useSubpixelPositioning() const { return m_subpixelTextPosition; } |
121 | 120 |
122 FontTraits traits() const; | 121 FontTraits traits() const; |
123 float wordSpacing() const { return m_wordSpacing; } | 122 float wordSpacing() const { return m_wordSpacing; } |
124 float letterSpacing() const { return m_letterSpacing; } | 123 float letterSpacing() const { return m_letterSpacing; } |
125 bool isSpecifiedFont() const { return m_isSpecifiedFont; } | |
126 FontOrientation orientation() const { return static_cast<FontOrientation>(m_
orientation); } | 124 FontOrientation orientation() const { return static_cast<FontOrientation>(m_
orientation); } |
127 NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast<N
onCJKGlyphOrientation>(m_nonCJKGlyphOrientation); } | 125 NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast<N
onCJKGlyphOrientation>(m_nonCJKGlyphOrientation); } |
128 FontWidthVariant widthVariant() const { return static_cast<FontWidthVariant>
(m_widthVariant); } | 126 FontWidthVariant widthVariant() const { return static_cast<FontWidthVariant>
(m_widthVariant); } |
129 FontFeatureSettings* featureSettings() const { return m_featureSettings.get(
); } | 127 FontFeatureSettings* featureSettings() const { return m_featureSettings.get(
); } |
130 FontDescription makeNormalFeatureSettings() const; | 128 FontDescription makeNormalFeatureSettings() const; |
131 | 129 |
132 float effectiveFontSize() const; // Returns either the computedSize or the c
omputedPixelSize | 130 float effectiveFontSize() const; // Returns either the computedSize or the c
omputedPixelSize |
133 FontCacheKey cacheKey(const AtomicString& familyName, FontTraits desiredTrai
ts = FontTraits(0)) const; | 131 FontCacheKey cacheKey(const AtomicString& familyName, FontTraits desiredTrai
ts = FontTraits(0)) const; |
134 | 132 |
135 void setFamily(const FontFamily& family) { m_familyList = family; } | 133 void setFamily(const FontFamily& family) { m_familyList = family; } |
136 void setComputedSize(float s) { m_computedSize = clampToFloat(s); } | 134 void setComputedSize(float s) { m_computedSize = clampToFloat(s); } |
137 void setSpecifiedSize(float s) { m_specifiedSize = clampToFloat(s); } | 135 void setSpecifiedSize(float s) { m_specifiedSize = clampToFloat(s); } |
138 void setStyle(FontStyle i) { m_italic = i; } | 136 void setStyle(FontStyle i) { m_italic = i; } |
139 void setStyle(bool i) { setStyle(i ? FontStyleItalic : FontStyleNormal); } | 137 void setStyle(bool i) { setStyle(i ? FontStyleItalic : FontStyleNormal); } |
140 void setVariant(FontVariant c) { s_variant = c; } | 138 void setVariant(FontVariant c) { s_variant = c; } |
141 void setIsAbsoluteSize(bool s) { m_isAbsoluteSize = s; } | 139 void setIsAbsoluteSize(bool s) { m_isAbsoluteSize = s; } |
142 void setWeight(FontWeight w) { m_weight = w; } | 140 void setWeight(FontWeight w) { m_weight = w; } |
143 void setStretch(FontStretch s) { m_stretch = s; } | 141 void setStretch(FontStretch s) { m_stretch = s; } |
144 void setGenericFamily(GenericFamilyType genericFamily) { m_genericFamily = g
enericFamily; } | 142 void setGenericFamily(GenericFamilyType genericFamily) { m_genericFamily = g
enericFamily; } |
145 void setUsePrinterFont(bool p) { m_usePrinterFont = p; } | 143 void setUsePrinterFont(bool p) { m_usePrinterFont = p; } |
146 void setKerning(Kerning kerning) { m_kerning = kerning; updateTypesettingFea
tures(); } | 144 void setKerning(Kerning kerning) { m_kerning = kerning; updateTypesettingFea
tures(); } |
147 void setCommonLigaturesState(LigaturesState commonLigaturesState) { m_common
LigaturesState = commonLigaturesState; updateTypesettingFeatures(); } | 145 void setCommonLigaturesState(LigaturesState commonLigaturesState) { m_common
LigaturesState = commonLigaturesState; updateTypesettingFeatures(); } |
148 void setDiscretionaryLigaturesState(LigaturesState discretionaryLigaturesSta
te) { m_discretionaryLigaturesState = discretionaryLigaturesState; updateTypeset
tingFeatures(); } | 146 void setDiscretionaryLigaturesState(LigaturesState discretionaryLigaturesSta
te) { m_discretionaryLigaturesState = discretionaryLigaturesState; updateTypeset
tingFeatures(); } |
149 void setHistoricalLigaturesState(LigaturesState historicalLigaturesState) {
m_historicalLigaturesState = historicalLigaturesState; updateTypesettingFeatures
(); } | 147 void setHistoricalLigaturesState(LigaturesState historicalLigaturesState) {
m_historicalLigaturesState = historicalLigaturesState; updateTypesettingFeatures
(); } |
150 void setContextualLigaturesState(LigaturesState contextualLigaturesState) {
m_contextualLigaturesState = contextualLigaturesState; updateTypesettingFeatures
(); } | 148 void setContextualLigaturesState(LigaturesState contextualLigaturesState) {
m_contextualLigaturesState = contextualLigaturesState; updateTypesettingFeatures
(); } |
151 void setKeywordSize(unsigned s) { m_keywordSize = s; } | 149 void setKeywordSize(unsigned s) { m_keywordSize = s; } |
152 void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoot
hing; } | 150 void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoot
hing; } |
153 void setTextRendering(TextRenderingMode rendering) { m_textRendering = rende
ring; updateTypesettingFeatures(); } | 151 void setTextRendering(TextRenderingMode rendering) { m_textRendering = rende
ring; updateTypesettingFeatures(); } |
154 void setIsSpecifiedFont(bool isSpecifiedFont) { m_isSpecifiedFont = isSpecif
iedFont; } | |
155 void setOrientation(FontOrientation orientation) { m_orientation = orientati
on; } | 152 void setOrientation(FontOrientation orientation) { m_orientation = orientati
on; } |
156 void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJ
KGlyphOrientation = orientation; } | 153 void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJ
KGlyphOrientation = orientation; } |
157 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = width
Variant; } | 154 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = width
Variant; } |
158 void setScript(UScriptCode s) { m_script = s; } | 155 void setScript(UScriptCode s) { m_script = s; } |
159 void setSyntheticBold(bool syntheticBold) { m_syntheticBold = syntheticBold;
} | 156 void setSyntheticBold(bool syntheticBold) { m_syntheticBold = syntheticBold;
} |
160 void setSyntheticItalic(bool syntheticItalic) { m_syntheticItalic = syntheti
cItalic; } | 157 void setSyntheticItalic(bool syntheticItalic) { m_syntheticItalic = syntheti
cItalic; } |
161 void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { m_featur
eSettings = settings; } | 158 void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { m_featur
eSettings = settings; } |
162 void setTraits(FontTraits); | 159 void setTraits(FontTraits); |
163 void setWordSpacing(float s) { m_wordSpacing = s; } | 160 void setWordSpacing(float s) { m_wordSpacing = s; } |
164 void setLetterSpacing(float s) { m_letterSpacing = s; } | 161 void setLetterSpacing(float s) { m_letterSpacing = s; } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 unsigned m_discretionaryLigaturesState : 2; | 201 unsigned m_discretionaryLigaturesState : 2; |
205 unsigned m_historicalLigaturesState : 2; | 202 unsigned m_historicalLigaturesState : 2; |
206 unsigned m_contextualLigaturesState : 2; | 203 unsigned m_contextualLigaturesState : 2; |
207 | 204 |
208 unsigned m_keywordSize : 4; // We cache whether or not a font is currently r
epresented by a CSS keyword (e.g., medium). If so, | 205 unsigned m_keywordSize : 4; // We cache whether or not a font is currently r
epresented by a CSS keyword (e.g., medium). If so, |
209 // then we can accurately translate across different
generic families to adjust for different preference settings | 206 // then we can accurately translate across different
generic families to adjust for different preference settings |
210 // (e.g., 13px monospace vs. 16px everything else).
Sizes are 1-8 (like the HTML size values for <font>). | 207 // (e.g., 13px monospace vs. 16px everything else).
Sizes are 1-8 (like the HTML size values for <font>). |
211 | 208 |
212 unsigned m_fontSmoothing : 2; // FontSmoothingMode | 209 unsigned m_fontSmoothing : 2; // FontSmoothingMode |
213 unsigned m_textRendering : 2; // TextRenderingMode | 210 unsigned m_textRendering : 2; // TextRenderingMode |
214 unsigned m_isSpecifiedFont : 1; // True if a web page specifies a non-generi
c font family as the first font family. | |
215 unsigned m_script : 7; // Used to help choose an appropriate font for generi
c font families. | 211 unsigned m_script : 7; // Used to help choose an appropriate font for generi
c font families. |
216 unsigned m_syntheticBold : 1; | 212 unsigned m_syntheticBold : 1; |
217 unsigned m_syntheticItalic : 1; | 213 unsigned m_syntheticItalic : 1; |
218 unsigned m_subpixelTextPosition : 1; | 214 unsigned m_subpixelTextPosition : 1; |
219 | 215 |
220 mutable unsigned m_typesettingFeatures : 2; // TypesettingFeatures | 216 mutable unsigned m_typesettingFeatures : 2; // TypesettingFeatures |
221 | 217 |
222 static TypesettingFeatures s_defaultTypesettingFeatures; | 218 static TypesettingFeatures s_defaultTypesettingFeatures; |
223 | 219 |
224 static bool s_useSubpixelTextPositioning; | 220 static bool s_useSubpixelTextPositioning; |
(...skipping 14 matching lines...) Expand all Loading... |
239 && m_genericFamily == other.m_genericFamily | 235 && m_genericFamily == other.m_genericFamily |
240 && m_usePrinterFont == other.m_usePrinterFont | 236 && m_usePrinterFont == other.m_usePrinterFont |
241 && m_kerning == other.m_kerning | 237 && m_kerning == other.m_kerning |
242 && m_commonLigaturesState == other.m_commonLigaturesState | 238 && m_commonLigaturesState == other.m_commonLigaturesState |
243 && m_discretionaryLigaturesState == other.m_discretionaryLigaturesState | 239 && m_discretionaryLigaturesState == other.m_discretionaryLigaturesState |
244 && m_historicalLigaturesState == other.m_historicalLigaturesState | 240 && m_historicalLigaturesState == other.m_historicalLigaturesState |
245 && m_contextualLigaturesState == other.m_contextualLigaturesState | 241 && m_contextualLigaturesState == other.m_contextualLigaturesState |
246 && m_keywordSize == other.m_keywordSize | 242 && m_keywordSize == other.m_keywordSize |
247 && m_fontSmoothing == other.m_fontSmoothing | 243 && m_fontSmoothing == other.m_fontSmoothing |
248 && m_textRendering == other.m_textRendering | 244 && m_textRendering == other.m_textRendering |
249 && m_isSpecifiedFont == other.m_isSpecifiedFont | |
250 && m_orientation == other.m_orientation | 245 && m_orientation == other.m_orientation |
251 && m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation | 246 && m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation |
252 && m_widthVariant == other.m_widthVariant | 247 && m_widthVariant == other.m_widthVariant |
253 && m_script == other.m_script | 248 && m_script == other.m_script |
254 && m_syntheticBold == other.m_syntheticBold | 249 && m_syntheticBold == other.m_syntheticBold |
255 && m_syntheticItalic == other.m_syntheticItalic | 250 && m_syntheticItalic == other.m_syntheticItalic |
256 && m_featureSettings == other.m_featureSettings | 251 && m_featureSettings == other.m_featureSettings |
257 && m_subpixelTextPosition == other.m_subpixelTextPosition; | 252 && m_subpixelTextPosition == other.m_subpixelTextPosition; |
258 } | 253 } |
259 | 254 |
260 } | 255 } |
261 | 256 |
262 #endif | 257 #endif |
OLD | NEW |