| 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 * |
| 11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
| 17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
| 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
| 20 * | 20 * |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #ifndef FontBuilder_h | 23 #ifndef FontBuilder_h |
| 24 #define FontBuilder_h | 24 #define FontBuilder_h |
| 25 | 25 |
| 26 #include "core/CSSValueKeywords.h" | 26 #include "core/CSSValueKeywords.h" |
| 27 #include "core/CoreExport.h" | 27 #include "core/CoreExport.h" |
| 28 #include "core/css/FontSize.h" | 28 #include "core/css/FontSize.h" |
| 29 #include "platform/fonts/FontDescription.h" | 29 #include "platform/fonts/FontDescription.h" |
| 30 #include "platform/fonts/FontVariantNumeric.h" |
| 30 #include "platform/heap/Handle.h" | 31 #include "platform/heap/Handle.h" |
| 31 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
| 32 | 33 |
| 33 namespace blink { | 34 namespace blink { |
| 34 | 35 |
| 35 class CSSValue; | 36 class CSSValue; |
| 36 class FontSelector; | 37 class FontSelector; |
| 37 class ComputedStyle; | 38 class ComputedStyle; |
| 38 | 39 |
| 39 class CORE_EXPORT FontBuilder { | 40 class CORE_EXPORT FontBuilder { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 57 void setWeight(FontWeight); | 58 void setWeight(FontWeight); |
| 58 void setSize(const FontDescription::Size&); | 59 void setSize(const FontDescription::Size&); |
| 59 void setSizeAdjust(const float aspectValue); | 60 void setSizeAdjust(const float aspectValue); |
| 60 void setStretch(FontStretch); | 61 void setStretch(FontStretch); |
| 61 void setFamilyDescription(const FontDescription::FamilyDescription&); | 62 void setFamilyDescription(const FontDescription::FamilyDescription&); |
| 62 void setFeatureSettings(PassRefPtr<FontFeatureSettings>); | 63 void setFeatureSettings(PassRefPtr<FontFeatureSettings>); |
| 63 void setLocale(const AtomicString&); | 64 void setLocale(const AtomicString&); |
| 64 void setStyle(FontStyle); | 65 void setStyle(FontStyle); |
| 65 void setVariantCaps(FontDescription::FontVariantCaps); | 66 void setVariantCaps(FontDescription::FontVariantCaps); |
| 66 void setVariantLigatures(const FontDescription::VariantLigatures&); | 67 void setVariantLigatures(const FontDescription::VariantLigatures&); |
| 68 void setVariantNumeric(const FontVariantNumeric&); |
| 67 void setTextRendering(TextRenderingMode); | 69 void setTextRendering(TextRenderingMode); |
| 68 void setKerning(FontDescription::Kerning); | 70 void setKerning(FontDescription::Kerning); |
| 69 void setFontSmoothing(FontSmoothingMode); | 71 void setFontSmoothing(FontSmoothingMode); |
| 70 | 72 |
| 71 // FIXME: These need to just vend a Font object eventually. | 73 // FIXME: These need to just vend a Font object eventually. |
| 72 void createFont(FontSelector*, ComputedStyle&); | 74 void createFont(FontSelector*, ComputedStyle&); |
| 73 | 75 |
| 74 void createFontForDocument(FontSelector*, ComputedStyle&); | 76 void createFontForDocument(FontSelector*, ComputedStyle&); |
| 75 | 77 |
| 76 bool fontDirty() const { return m_flags; } | 78 bool fontDirty() const { return m_flags; } |
| 77 | 79 |
| 78 static FontDescription::FamilyDescription initialFamilyDescription() { retur
n FontDescription::FamilyDescription(initialGenericFamily()); } | 80 static FontDescription::FamilyDescription initialFamilyDescription() { retur
n FontDescription::FamilyDescription(initialGenericFamily()); } |
| 79 static FontFeatureSettings* initialFeatureSettings() { return nullptr; } | 81 static FontFeatureSettings* initialFeatureSettings() { return nullptr; } |
| 80 static FontDescription::GenericFamilyType initialGenericFamily() { return Fo
ntDescription::StandardFamily; } | 82 static FontDescription::GenericFamilyType initialGenericFamily() { return Fo
ntDescription::StandardFamily; } |
| 81 static FontDescription::Size initialSize() { return FontDescription::Size(Fo
ntSize::initialKeywordSize(), 0.0f, false); } | 83 static FontDescription::Size initialSize() { return FontDescription::Size(Fo
ntSize::initialKeywordSize(), 0.0f, false); } |
| 82 static float initialSizeAdjust() { return FontSizeAdjustNone; } | 84 static float initialSizeAdjust() { return FontSizeAdjustNone; } |
| 83 static TextRenderingMode initialTextRendering() { return AutoTextRendering;
} | 85 static TextRenderingMode initialTextRendering() { return AutoTextRendering;
} |
| 84 static FontDescription::FontVariantCaps initialVariantCaps() { return FontDe
scription::CapsNormal; } | 86 static FontDescription::FontVariantCaps initialVariantCaps() { return FontDe
scription::CapsNormal; } |
| 85 static FontDescription::VariantLigatures initialVariantLigatures() { return
FontDescription::VariantLigatures(); } | 87 static FontDescription::VariantLigatures initialVariantLigatures() { return
FontDescription::VariantLigatures(); } |
| 88 static FontVariantNumeric initialVariantNumeric() { return FontVariantNumeri
c(); }; |
| 86 static const AtomicString& initialLocale() { return nullAtom; } | 89 static const AtomicString& initialLocale() { return nullAtom; } |
| 87 static FontStyle initialStyle() { return FontStyleNormal; } | 90 static FontStyle initialStyle() { return FontStyleNormal; } |
| 88 static FontDescription::Kerning initialKerning() { return FontDescription::A
utoKerning; } | 91 static FontDescription::Kerning initialKerning() { return FontDescription::A
utoKerning; } |
| 89 static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; } | 92 static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; } |
| 90 static FontStretch initialStretch() { return FontStretchNormal; } | 93 static FontStretch initialStretch() { return FontStretchNormal; } |
| 91 static FontWeight initialWeight() { return FontWeightNormal; } | 94 static FontWeight initialWeight() { return FontWeightNormal; } |
| 92 | 95 |
| 93 private: | 96 private: |
| 94 | 97 |
| 95 void setFamilyDescription(FontDescription&, const FontDescription::FamilyDes
cription&); | 98 void setFamilyDescription(FontDescription&, const FontDescription::FamilyDes
cription&); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 110 Weight, | 113 Weight, |
| 111 Size, | 114 Size, |
| 112 Stretch, | 115 Stretch, |
| 113 Family, | 116 Family, |
| 114 FeatureSettings, | 117 FeatureSettings, |
| 115 Locale, | 118 Locale, |
| 116 Style, | 119 Style, |
| 117 SizeAdjust, | 120 SizeAdjust, |
| 118 VariantCaps, | 121 VariantCaps, |
| 119 VariantLigatures, | 122 VariantLigatures, |
| 123 VariantNumeric, |
| 120 TextRendering, | 124 TextRendering, |
| 121 Kerning, | 125 Kerning, |
| 122 FontSmoothing, | 126 FontSmoothing, |
| 123 | 127 |
| 124 EffectiveZoom, | 128 EffectiveZoom, |
| 125 TextOrientation, | 129 TextOrientation, |
| 126 WritingMode | 130 WritingMode |
| 127 }; | 131 }; |
| 128 | 132 |
| 129 void set(PropertySetFlag flag) { m_flags |= (1 << unsigned(flag)); } | 133 void set(PropertySetFlag flag) { m_flags |= (1 << unsigned(flag)); } |
| 130 bool isSet(PropertySetFlag flag) const { return m_flags & (1 << unsigned(fla
g)); } | 134 bool isSet(PropertySetFlag flag) const { return m_flags & (1 << unsigned(fla
g)); } |
| 131 | 135 |
| 132 unsigned m_flags; | 136 unsigned m_flags; |
| 133 }; | 137 }; |
| 134 | 138 |
| 135 } // namespace blink | 139 } // namespace blink |
| 136 | 140 |
| 137 #endif | 141 #endif |
| OLD | NEW |