| 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 | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights |
| 6 * reserved. | 6 * reserved. |
| 7 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 7 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 221 } |
| 222 bool isVerticalBaseline() const { | 222 bool isVerticalBaseline() const { |
| 223 return blink::isVerticalBaseline(orientation()); | 223 return blink::isVerticalBaseline(orientation()); |
| 224 } | 224 } |
| 225 FontWidthVariant widthVariant() const { | 225 FontWidthVariant widthVariant() const { |
| 226 return static_cast<FontWidthVariant>(m_fields.m_widthVariant); | 226 return static_cast<FontWidthVariant>(m_fields.m_widthVariant); |
| 227 } | 227 } |
| 228 FontFeatureSettings* featureSettings() const { | 228 FontFeatureSettings* featureSettings() const { |
| 229 return m_featureSettings.get(); | 229 return m_featureSettings.get(); |
| 230 } | 230 } |
| 231 FontVariationSettings* variationSettings() const { |
| 232 return m_variationSettings.get(); |
| 233 } |
| 231 | 234 |
| 232 float effectiveFontSize() | 235 float effectiveFontSize() |
| 233 const; // Returns either the computedSize or the computedPixelSize | 236 const; // Returns either the computedSize or the computedPixelSize |
| 234 FontCacheKey cacheKey(const FontFaceCreationParams&, | 237 FontCacheKey cacheKey(const FontFaceCreationParams&, |
| 235 FontTraits desiredTraits = FontTraits(0)) const; | 238 FontTraits desiredTraits = FontTraits(0)) const; |
| 236 | 239 |
| 237 void setFamily(const FontFamily& family) { m_familyList = family; } | 240 void setFamily(const FontFamily& family) { m_familyList = family; } |
| 238 void setComputedSize(float s) { m_computedSize = clampTo<float>(s); } | 241 void setComputedSize(float s) { m_computedSize = clampTo<float>(s); } |
| 239 void setSpecifiedSize(float s) { m_specifiedSize = clampTo<float>(s); } | 242 void setSpecifiedSize(float s) { m_specifiedSize = clampTo<float>(s); } |
| 240 void setAdjustedSize(float s) { m_adjustedSize = clampTo<float>(s); } | 243 void setAdjustedSize(float s) { m_adjustedSize = clampTo<float>(s); } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 270 void setLocale(PassRefPtr<const LayoutLocale> locale) { m_locale = locale; } | 273 void setLocale(PassRefPtr<const LayoutLocale> locale) { m_locale = locale; } |
| 271 void setSyntheticBold(bool syntheticBold) { | 274 void setSyntheticBold(bool syntheticBold) { |
| 272 m_fields.m_syntheticBold = syntheticBold; | 275 m_fields.m_syntheticBold = syntheticBold; |
| 273 } | 276 } |
| 274 void setSyntheticItalic(bool syntheticItalic) { | 277 void setSyntheticItalic(bool syntheticItalic) { |
| 275 m_fields.m_syntheticItalic = syntheticItalic; | 278 m_fields.m_syntheticItalic = syntheticItalic; |
| 276 } | 279 } |
| 277 void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { | 280 void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { |
| 278 m_featureSettings = settings; | 281 m_featureSettings = settings; |
| 279 } | 282 } |
| 283 void setVariationSettings(PassRefPtr<FontVariationSettings> settings) { |
| 284 m_variationSettings = settings; |
| 285 } |
| 280 void setTraits(FontTraits); | 286 void setTraits(FontTraits); |
| 281 void setWordSpacing(float s) { m_wordSpacing = s; } | 287 void setWordSpacing(float s) { m_wordSpacing = s; } |
| 282 void setLetterSpacing(float s) { | 288 void setLetterSpacing(float s) { |
| 283 m_letterSpacing = s; | 289 m_letterSpacing = s; |
| 284 updateTypesettingFeatures(); | 290 updateTypesettingFeatures(); |
| 285 } | 291 } |
| 286 | 292 |
| 287 TypesettingFeatures getTypesettingFeatures() const { | 293 TypesettingFeatures getTypesettingFeatures() const { |
| 288 return static_cast<TypesettingFeatures>(m_fields.m_typesettingFeatures); | 294 return static_cast<TypesettingFeatures>(m_fields.m_typesettingFeatures); |
| 289 } | 295 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 308 // TODO(drott): We should not expose internal structure here, but rather | 314 // TODO(drott): We should not expose internal structure here, but rather |
| 309 // introduce a hash function here. | 315 // introduce a hash function here. |
| 310 unsigned bitmapFields() const { return m_fieldsAsUnsigned.parts[0]; } | 316 unsigned bitmapFields() const { return m_fieldsAsUnsigned.parts[0]; } |
| 311 unsigned auxiliaryBitmapFields() const { return m_fieldsAsUnsigned.parts[1]; } | 317 unsigned auxiliaryBitmapFields() const { return m_fieldsAsUnsigned.parts[1]; } |
| 312 | 318 |
| 313 SkFontStyle skiaFontStyle() const; | 319 SkFontStyle skiaFontStyle() const; |
| 314 | 320 |
| 315 private: | 321 private: |
| 316 FontFamily m_familyList; // The list of font families to be used. | 322 FontFamily m_familyList; // The list of font families to be used. |
| 317 RefPtr<FontFeatureSettings> m_featureSettings; | 323 RefPtr<FontFeatureSettings> m_featureSettings; |
| 324 RefPtr<FontVariationSettings> m_variationSettings; |
| 318 RefPtr<const LayoutLocale> m_locale; | 325 RefPtr<const LayoutLocale> m_locale; |
| 319 | 326 |
| 320 void updateTypesettingFeatures(); | 327 void updateTypesettingFeatures(); |
| 321 | 328 |
| 322 // Specified CSS value. Independent of rendering issues such as integer | 329 // Specified CSS value. Independent of rendering issues such as integer |
| 323 // rounding, minimum font sizes, and zooming. | 330 // rounding, minimum font sizes, and zooming. |
| 324 float m_specifiedSize; | 331 float m_specifiedSize; |
| 325 // Computed size adjusted for the minimum font size and the zoom factor. | 332 // Computed size adjusted for the minimum font size and the zoom factor. |
| 326 float m_computedSize; | 333 float m_computedSize; |
| 327 | 334 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 }; | 390 }; |
| 384 | 391 |
| 385 static TypesettingFeatures s_defaultTypesettingFeatures; | 392 static TypesettingFeatures s_defaultTypesettingFeatures; |
| 386 | 393 |
| 387 static bool s_useSubpixelTextPositioning; | 394 static bool s_useSubpixelTextPositioning; |
| 388 }; | 395 }; |
| 389 | 396 |
| 390 } // namespace blink | 397 } // namespace blink |
| 391 | 398 |
| 392 #endif | 399 #endif |
| OLD | NEW |