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 15 matching lines...) Expand all Loading... |
26 #include "core/CSSValueKeywords.h" | 26 #include "core/CSSValueKeywords.h" |
27 #include "core/css/FontSize.h" | 27 #include "core/css/FontSize.h" |
28 #include "platform/fonts/FontDescription.h" | 28 #include "platform/fonts/FontDescription.h" |
29 #include "platform/heap/Handle.h" | 29 #include "platform/heap/Handle.h" |
30 #include "wtf/PassRefPtr.h" | 30 #include "wtf/PassRefPtr.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 class CSSValue; | 34 class CSSValue; |
35 class FontSelector; | 35 class FontSelector; |
36 class LayoutStyle; | 36 class ComputedStyle; |
37 | 37 |
38 class FontBuilder { | 38 class FontBuilder { |
39 STACK_ALLOCATED(); | 39 STACK_ALLOCATED(); |
40 WTF_MAKE_NONCOPYABLE(FontBuilder); | 40 WTF_MAKE_NONCOPYABLE(FontBuilder); |
41 public: | 41 public: |
42 FontBuilder(const Document&); | 42 FontBuilder(const Document&); |
43 | 43 |
44 void setInitial(float effectiveZoom); | 44 void setInitial(float effectiveZoom); |
45 | 45 |
46 void didChangeEffectiveZoom(); | 46 void didChangeEffectiveZoom(); |
(...skipping 12 matching lines...) Expand all Loading... |
59 void setFeatureSettings(PassRefPtr<FontFeatureSettings>); | 59 void setFeatureSettings(PassRefPtr<FontFeatureSettings>); |
60 void setScript(const AtomicString& locale); | 60 void setScript(const AtomicString& locale); |
61 void setStyle(FontStyle); | 61 void setStyle(FontStyle); |
62 void setVariant(FontVariant); | 62 void setVariant(FontVariant); |
63 void setVariantLigatures(const FontDescription::VariantLigatures&); | 63 void setVariantLigatures(const FontDescription::VariantLigatures&); |
64 void setTextRendering(TextRenderingMode); | 64 void setTextRendering(TextRenderingMode); |
65 void setKerning(FontDescription::Kerning); | 65 void setKerning(FontDescription::Kerning); |
66 void setFontSmoothing(FontSmoothingMode); | 66 void setFontSmoothing(FontSmoothingMode); |
67 | 67 |
68 // FIXME: These need to just vend a Font object eventually. | 68 // FIXME: These need to just vend a Font object eventually. |
69 void createFont(PassRefPtrWillBeRawPtr<FontSelector>, LayoutStyle&); | 69 void createFont(PassRefPtrWillBeRawPtr<FontSelector>, ComputedStyle&); |
70 | 70 |
71 void createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector>, LayoutStyle
&); | 71 void createFontForDocument(PassRefPtrWillBeRawPtr<FontSelector>, ComputedSty
le&); |
72 | 72 |
73 bool fontDirty() const { return m_flags; } | 73 bool fontDirty() const { return m_flags; } |
74 | 74 |
75 static FontDescription::FamilyDescription initialFamilyDescription() { retur
n FontDescription::FamilyDescription(initialGenericFamily()); } | 75 static FontDescription::FamilyDescription initialFamilyDescription() { retur
n FontDescription::FamilyDescription(initialGenericFamily()); } |
76 static FontFeatureSettings* initialFeatureSettings() { return nullptr; } | 76 static FontFeatureSettings* initialFeatureSettings() { return nullptr; } |
77 static FontDescription::GenericFamilyType initialGenericFamily() { return Fo
ntDescription::StandardFamily; } | 77 static FontDescription::GenericFamilyType initialGenericFamily() { return Fo
ntDescription::StandardFamily; } |
78 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 FontSizeAdjustNone; } | 79 static float initialSizeAdjust() { return FontSizeAdjustNone; } |
80 static TextRenderingMode initialTextRendering() { return AutoTextRendering;
} | 80 static TextRenderingMode initialTextRendering() { return AutoTextRendering;
} |
81 static FontVariant initialVariant() { return FontVariantNormal; } | 81 static FontVariant initialVariant() { return FontVariantNormal; } |
82 static FontDescription::VariantLigatures initialVariantLigatures() { return
FontDescription::VariantLigatures(); } | 82 static FontDescription::VariantLigatures initialVariantLigatures() { return
FontDescription::VariantLigatures(); } |
83 static FontStyle initialStyle() { return FontStyleNormal; } | 83 static FontStyle initialStyle() { return FontStyleNormal; } |
84 static FontDescription::Kerning initialKerning() { return FontDescription::A
utoKerning; } | 84 static FontDescription::Kerning initialKerning() { return FontDescription::A
utoKerning; } |
85 static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; } | 85 static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; } |
86 static FontStretch initialStretch() { return FontStretchNormal; } | 86 static FontStretch initialStretch() { return FontStretchNormal; } |
87 static FontWeight initialWeight() { return FontWeightNormal; } | 87 static FontWeight initialWeight() { return FontWeightNormal; } |
88 | 88 |
89 private: | 89 private: |
90 | 90 |
91 void setFamilyDescription(FontDescription&, const FontDescription::FamilyDes
cription&); | 91 void setFamilyDescription(FontDescription&, const FontDescription::FamilyDes
cription&); |
92 void setSize(FontDescription&, const FontDescription::Size&); | 92 void setSize(FontDescription&, const FontDescription::Size&); |
93 void updateOrientation(FontDescription&, const LayoutStyle&); | 93 void updateOrientation(FontDescription&, const ComputedStyle&); |
94 // 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 |
95 void checkForGenericFamilyChange(const FontDescription&, FontDescription&); | 95 void checkForGenericFamilyChange(const FontDescription&, FontDescription&); |
96 void updateSpecifiedSize(FontDescription&, const LayoutStyle&); | 96 void updateSpecifiedSize(FontDescription&, const ComputedStyle&); |
97 void updateComputedSize(FontDescription&, const LayoutStyle&); | 97 void updateComputedSize(FontDescription&, const ComputedStyle&); |
98 void updateAdjustedSize(FontDescription&, const LayoutStyle&, FontSelector*)
; | 98 void updateAdjustedSize(FontDescription&, const ComputedStyle&, FontSelector
*); |
99 | 99 |
100 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom
, float specifiedSize); | 100 float getComputedSizeFromSpecifiedSize(FontDescription&, float effectiveZoom
, float specifiedSize); |
101 | 101 |
102 const Document& m_document; | 102 const Document& m_document; |
103 FontDescription m_fontDescription; | 103 FontDescription m_fontDescription; |
104 | 104 |
105 enum class PropertySetFlag { | 105 enum class PropertySetFlag { |
106 Weight, | 106 Weight, |
107 Size, | 107 Size, |
108 Stretch, | 108 Stretch, |
(...skipping 15 matching lines...) Expand all Loading... |
124 | 124 |
125 void set(PropertySetFlag flag) { m_flags |= (1 << unsigned(flag)); } | 125 void set(PropertySetFlag flag) { m_flags |= (1 << unsigned(flag)); } |
126 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)); } |
127 | 127 |
128 unsigned m_flags; | 128 unsigned m_flags; |
129 }; | 129 }; |
130 | 130 |
131 } | 131 } |
132 | 132 |
133 #endif | 133 #endif |
OLD | NEW |