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 void didChangeEffectiveZoom(); | 46 void didChangeEffectiveZoom(); |
47 void didChangeTextOrientation(); | 47 void didChangeTextOrientation(); |
48 void didChangeWritingMode(); | 48 void didChangeWritingMode(); |
49 | 49 |
50 FontFamily standardFontFamily() const; | 50 FontFamily standardFontFamily() const; |
51 AtomicString standardFontFamilyName() const; | 51 AtomicString standardFontFamilyName() const; |
52 AtomicString genericFontFamilyName(FontDescription::GenericFamilyType) const
; | 52 AtomicString genericFontFamilyName(FontDescription::GenericFamilyType) const
; |
53 | 53 |
54 void setWeight(FontWeight); | 54 void setWeight(FontWeight); |
55 void setSize(const FontDescription::Size&); | 55 void setSize(const FontDescription::Size&); |
| 56 void setSizeAdjust(const float aspectValue); |
56 void setStretch(FontStretch); | 57 void setStretch(FontStretch); |
57 void setFamilyDescription(const FontDescription::FamilyDescription&); | 58 void setFamilyDescription(const FontDescription::FamilyDescription&); |
58 void setFeatureSettings(PassRefPtr<FontFeatureSettings>); | 59 void setFeatureSettings(PassRefPtr<FontFeatureSettings>); |
59 void setScript(const AtomicString& locale); | 60 void setScript(const AtomicString& locale); |
60 void setStyle(FontStyle); | 61 void setStyle(FontStyle); |
61 void setVariant(FontVariant); | 62 void setVariant(FontVariant); |
62 void setVariantLigatures(const FontDescription::VariantLigatures&); | 63 void setVariantLigatures(const FontDescription::VariantLigatures&); |
63 void setTextRendering(TextRenderingMode); | 64 void setTextRendering(TextRenderingMode); |
64 void setKerning(FontDescription::Kerning); | 65 void setKerning(FontDescription::Kerning); |
65 void setFontSmoothing(FontSmoothingMode); | 66 void setFontSmoothing(FontSmoothingMode); |
66 | 67 |
67 // FIXME: These need to just vend a Font object eventually. | 68 // FIXME: These need to just vend a Font object eventually. |
68 void createFont(PassRefPtrWillBeRawPtr<FontSelector>, LayoutStyle&); | 69 void createFont(PassRefPtrWillBeRawPtr<FontSelector>, LayoutStyle&); |
69 | 70 |
70 void createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector>, LayoutStyle
&); | 71 void createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector>, LayoutStyle
&); |
71 | 72 |
72 bool fontDirty() const { return m_flags; } | 73 bool fontDirty() const { return m_flags; } |
73 | 74 |
74 static FontDescription::FamilyDescription initialFamilyDescription() { retur
n FontDescription::FamilyDescription(initialGenericFamily()); } | 75 static FontDescription::FamilyDescription initialFamilyDescription() { retur
n FontDescription::FamilyDescription(initialGenericFamily()); } |
75 static FontFeatureSettings* initialFeatureSettings() { return nullptr; } | 76 static FontFeatureSettings* initialFeatureSettings() { return nullptr; } |
76 static FontDescription::GenericFamilyType initialGenericFamily() { return Fo
ntDescription::StandardFamily; } | 77 static FontDescription::GenericFamilyType initialGenericFamily() { return Fo
ntDescription::StandardFamily; } |
77 static FontDescription::Size initialSize() { return FontDescription::Size(Fo
ntSize::initialKeywordSize(), 0.0f, false); } | 78 static FontDescription::Size initialSize() { return FontDescription::Size(Fo
ntSize::initialKeywordSize(), 0.0f, false); } |
| 79 static float initialSizeAdjust() { return 0; } |
78 static TextRenderingMode initialTextRendering() { return AutoTextRendering;
} | 80 static TextRenderingMode initialTextRendering() { return AutoTextRendering;
} |
79 static FontVariant initialVariant() { return FontVariantNormal; } | 81 static FontVariant initialVariant() { return FontVariantNormal; } |
80 static FontDescription::VariantLigatures initialVariantLigatures() { return
FontDescription::VariantLigatures(); } | 82 static FontDescription::VariantLigatures initialVariantLigatures() { return
FontDescription::VariantLigatures(); } |
81 static FontStyle initialStyle() { return FontStyleNormal; } | 83 static FontStyle initialStyle() { return FontStyleNormal; } |
82 static FontDescription::Kerning initialKerning() { return FontDescription::A
utoKerning; } | 84 static FontDescription::Kerning initialKerning() { return FontDescription::A
utoKerning; } |
83 static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; } | 85 static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; } |
84 static FontStretch initialStretch() { return FontStretchNormal; } | 86 static FontStretch initialStretch() { return FontStretchNormal; } |
85 static FontWeight initialWeight() { return FontWeightNormal; } | 87 static FontWeight initialWeight() { return FontWeightNormal; } |
86 | 88 |
87 private: | 89 private: |
88 | 90 |
89 void setFamilyDescription(FontDescription&, const FontDescription::FamilyDes
cription&); | 91 void setFamilyDescription(FontDescription&, const FontDescription::FamilyDes
cription&); |
90 void setSize(FontDescription&, const FontDescription::Size&); | 92 void setSize(FontDescription&, const FontDescription::Size&); |
91 void updateOrientation(FontDescription&, const LayoutStyle&); | 93 void updateOrientation(FontDescription&, const LayoutStyle&); |
92 // This function fixes up the default font size if it detects that the curre
nt generic font family has changed. -dwh | 94 // This function fixes up the default font size if it detects that the curre
nt generic font family has changed. -dwh |
93 void checkForGenericFamilyChange(const FontDescription&, FontDescription&); | 95 void checkForGenericFamilyChange(const FontDescription&, FontDescription&); |
94 void updateSpecifiedSize(FontDescription&, const LayoutStyle&); | 96 void updateSpecifiedSize(FontDescription&, const LayoutStyle&); |
95 void updateComputedSize(FontDescription&, const LayoutStyle&); | 97 void updateComputedSize(FontDescription&, const LayoutStyle&); |
| 98 void updateAdjustedSize(FontDescription&, const LayoutStyle&, FontSelector*)
; |
96 | 99 |
97 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom
, float specifiedSize); | 100 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom
, float specifiedSize); |
98 | 101 |
99 const Document& m_document; | 102 const Document& m_document; |
100 FontDescription m_fontDescription; | 103 FontDescription m_fontDescription; |
101 | 104 |
102 enum class PropertySetFlag { | 105 enum class PropertySetFlag { |
103 Weight, | 106 Weight, |
104 Size, | 107 Size, |
105 Stretch, | 108 Stretch, |
106 Family, | 109 Family, |
107 FeatureSettings, | 110 FeatureSettings, |
108 Script, | 111 Script, |
109 Style, | 112 Style, |
| 113 SizeAdjust, |
110 Variant, | 114 Variant, |
111 VariantLigatures, | 115 VariantLigatures, |
112 TextRendering, | 116 TextRendering, |
113 Kerning, | 117 Kerning, |
114 FontSmoothing, | 118 FontSmoothing, |
115 | 119 |
116 EffectiveZoom, | 120 EffectiveZoom, |
117 TextOrientation, | 121 TextOrientation, |
118 WritingMode | 122 WritingMode |
119 }; | 123 }; |
120 | 124 |
121 void set(PropertySetFlag flag) { m_flags |= (1 << unsigned(flag)); } | 125 void set(PropertySetFlag flag) { m_flags |= (1 << unsigned(flag)); } |
122 bool isSet(PropertySetFlag flag) const { return m_flags & (1 << unsigned(fla
g)); } | 126 bool isSet(PropertySetFlag flag) const { return m_flags & (1 << unsigned(fla
g)); } |
123 | 127 |
124 unsigned m_flags; | 128 unsigned m_flags; |
125 }; | 129 }; |
126 | 130 |
127 } | 131 } |
128 | 132 |
129 #endif | 133 #endif |
OLD | NEW |