Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: Source/platform/fonts/FontDescription.h

Issue 276573010: Adding Locale (language attribute) information to font and using the (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changing font name in test case as per comment in 267423005 code review Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/resolver/FontBuilder.cpp ('k') | Source/platform/fonts/FontDescription.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 , m_historicalLigaturesState(NormalLigaturesState) 74 , m_historicalLigaturesState(NormalLigaturesState)
75 , m_contextualLigaturesState(NormalLigaturesState) 75 , m_contextualLigaturesState(NormalLigaturesState)
76 , m_keywordSize(0) 76 , m_keywordSize(0)
77 , m_fontSmoothing(AutoSmoothing) 77 , m_fontSmoothing(AutoSmoothing)
78 , m_textRendering(AutoTextRendering) 78 , m_textRendering(AutoTextRendering)
79 , m_script(USCRIPT_COMMON) 79 , m_script(USCRIPT_COMMON)
80 , m_syntheticBold(false) 80 , m_syntheticBold(false)
81 , m_syntheticItalic(false) 81 , m_syntheticItalic(false)
82 , m_subpixelTextPosition(s_useSubpixelTextPositioning) 82 , m_subpixelTextPosition(s_useSubpixelTextPositioning)
83 , m_typesettingFeatures(s_defaultTypesettingFeatures) 83 , m_typesettingFeatures(s_defaultTypesettingFeatures)
84 , m_locale(String("en"))
eae 2014/05/19 18:56:13 How about storing the hb_language_t instead of the
h.joshi 2014/05/20 04:22:14 Okey, will start working on this suggestion and sh
84 { 85 {
85 } 86 }
86 87
87 bool operator==(const FontDescription&) const; 88 bool operator==(const FontDescription&) const;
88 bool operator!=(const FontDescription& other) const { return !(*this == othe r); } 89 bool operator!=(const FontDescription& other) const { return !(*this == othe r); }
89 90
90 const FontFamily& family() const { return m_familyList; } 91 const FontFamily& family() const { return m_familyList; }
91 FontFamily& firstFamily() { return m_familyList; } 92 FontFamily& firstFamily() { return m_familyList; }
92 float specifiedSize() const { return m_specifiedSize; } 93 float specifiedSize() const { return m_specifiedSize; }
93 float computedSize() const { return m_computedSize; } 94 float computedSize() const { return m_computedSize; }
(...skipping 15 matching lines...) Expand all
109 bool useFixedDefaultSize() const { return genericFamily() == MonospaceFamily && !family().next() && family().family() == FontFamilyNames::webkit_monospace; } 110 bool useFixedDefaultSize() const { return genericFamily() == MonospaceFamily && !family().next() && family().family() == FontFamilyNames::webkit_monospace; }
110 Kerning kerning() const { return static_cast<Kerning>(m_kerning); } 111 Kerning kerning() const { return static_cast<Kerning>(m_kerning); }
111 LigaturesState commonLigaturesState() const { return static_cast<LigaturesSt ate>(m_commonLigaturesState); } 112 LigaturesState commonLigaturesState() const { return static_cast<LigaturesSt ate>(m_commonLigaturesState); }
112 LigaturesState discretionaryLigaturesState() const { return static_cast<Liga turesState>(m_discretionaryLigaturesState); } 113 LigaturesState discretionaryLigaturesState() const { return static_cast<Liga turesState>(m_discretionaryLigaturesState); }
113 LigaturesState historicalLigaturesState() const { return static_cast<Ligatur esState>(m_historicalLigaturesState); } 114 LigaturesState historicalLigaturesState() const { return static_cast<Ligatur esState>(m_historicalLigaturesState); }
114 LigaturesState contextualLigaturesState() const { return static_cast<Ligatur esState>(m_contextualLigaturesState); } 115 LigaturesState contextualLigaturesState() const { return static_cast<Ligatur esState>(m_contextualLigaturesState); }
115 unsigned keywordSize() const { return m_keywordSize; } 116 unsigned keywordSize() const { return m_keywordSize; }
116 FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMo de>(m_fontSmoothing); } 117 FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMo de>(m_fontSmoothing); }
117 TextRenderingMode textRendering() const { return static_cast<TextRenderingMo de>(m_textRendering); } 118 TextRenderingMode textRendering() const { return static_cast<TextRenderingMo de>(m_textRendering); }
118 UScriptCode script() const { return static_cast<UScriptCode>(m_script); } 119 UScriptCode script() const { return static_cast<UScriptCode>(m_script); }
120 const String& locale() const { return m_locale; }
119 bool isSyntheticBold() const { return m_syntheticBold; } 121 bool isSyntheticBold() const { return m_syntheticBold; }
120 bool isSyntheticItalic() const { return m_syntheticItalic; } 122 bool isSyntheticItalic() const { return m_syntheticItalic; }
121 bool useSubpixelPositioning() const { return m_subpixelTextPosition; } 123 bool useSubpixelPositioning() const { return m_subpixelTextPosition; }
122 124
123 FontTraits traits() const; 125 FontTraits traits() const;
124 float wordSpacing() const { return m_wordSpacing; } 126 float wordSpacing() const { return m_wordSpacing; }
125 float letterSpacing() const { return m_letterSpacing; } 127 float letterSpacing() const { return m_letterSpacing; }
126 FontOrientation orientation() const { return static_cast<FontOrientation>(m_ orientation); } 128 FontOrientation orientation() const { return static_cast<FontOrientation>(m_ orientation); }
127 NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast<N onCJKGlyphOrientation>(m_nonCJKGlyphOrientation); } 129 NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast<N onCJKGlyphOrientation>(m_nonCJKGlyphOrientation); }
128 FontWidthVariant widthVariant() const { return static_cast<FontWidthVariant> (m_widthVariant); } 130 FontWidthVariant widthVariant() const { return static_cast<FontWidthVariant> (m_widthVariant); }
(...skipping 18 matching lines...) Expand all
147 void setDiscretionaryLigaturesState(LigaturesState discretionaryLigaturesSta te) { m_discretionaryLigaturesState = discretionaryLigaturesState; updateTypeset tingFeatures(); } 149 void setDiscretionaryLigaturesState(LigaturesState discretionaryLigaturesSta te) { m_discretionaryLigaturesState = discretionaryLigaturesState; updateTypeset tingFeatures(); }
148 void setHistoricalLigaturesState(LigaturesState historicalLigaturesState) { m_historicalLigaturesState = historicalLigaturesState; updateTypesettingFeatures (); } 150 void setHistoricalLigaturesState(LigaturesState historicalLigaturesState) { m_historicalLigaturesState = historicalLigaturesState; updateTypesettingFeatures (); }
149 void setContextualLigaturesState(LigaturesState contextualLigaturesState) { m_contextualLigaturesState = contextualLigaturesState; updateTypesettingFeatures (); } 151 void setContextualLigaturesState(LigaturesState contextualLigaturesState) { m_contextualLigaturesState = contextualLigaturesState; updateTypesettingFeatures (); }
150 void setKeywordSize(unsigned s) { m_keywordSize = s; } 152 void setKeywordSize(unsigned s) { m_keywordSize = s; }
151 void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoot hing; } 153 void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoot hing; }
152 void setTextRendering(TextRenderingMode rendering) { m_textRendering = rende ring; updateTypesettingFeatures(); } 154 void setTextRendering(TextRenderingMode rendering) { m_textRendering = rende ring; updateTypesettingFeatures(); }
153 void setOrientation(FontOrientation orientation) { m_orientation = orientati on; } 155 void setOrientation(FontOrientation orientation) { m_orientation = orientati on; }
154 void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJ KGlyphOrientation = orientation; } 156 void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJ KGlyphOrientation = orientation; }
155 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = width Variant; } 157 void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = width Variant; }
156 void setScript(UScriptCode s) { m_script = s; } 158 void setScript(UScriptCode s) { m_script = s; }
159 void setLocale(const String& localeStr) { m_locale = localeStr; }
157 void setSyntheticBold(bool syntheticBold) { m_syntheticBold = syntheticBold; } 160 void setSyntheticBold(bool syntheticBold) { m_syntheticBold = syntheticBold; }
158 void setSyntheticItalic(bool syntheticItalic) { m_syntheticItalic = syntheti cItalic; } 161 void setSyntheticItalic(bool syntheticItalic) { m_syntheticItalic = syntheti cItalic; }
159 void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { m_featur eSettings = settings; } 162 void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { m_featur eSettings = settings; }
160 void setTraits(FontTraits); 163 void setTraits(FontTraits);
161 void setWordSpacing(float s) { m_wordSpacing = s; } 164 void setWordSpacing(float s) { m_wordSpacing = s; }
162 void setLetterSpacing(float s) { m_letterSpacing = s; } 165 void setLetterSpacing(float s) { m_letterSpacing = s; }
163 166
164 TypesettingFeatures typesettingFeatures() const { return static_cast<Typeset tingFeatures>(m_typesettingFeatures); } 167 TypesettingFeatures typesettingFeatures() const { return static_cast<Typeset tingFeatures>(m_typesettingFeatures); }
165 168
166 static void setSubpixelPositioning(bool b) { s_useSubpixelTextPositioning = b; } 169 static void setSubpixelPositioning(bool b) { s_useSubpixelTextPositioning = b; }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 unsigned m_script : 7; // Used to help choose an appropriate font for generi c font families. 215 unsigned m_script : 7; // Used to help choose an appropriate font for generi c font families.
213 unsigned m_syntheticBold : 1; 216 unsigned m_syntheticBold : 1;
214 unsigned m_syntheticItalic : 1; 217 unsigned m_syntheticItalic : 1;
215 unsigned m_subpixelTextPosition : 1; 218 unsigned m_subpixelTextPosition : 1;
216 219
217 mutable unsigned m_typesettingFeatures : 2; // TypesettingFeatures 220 mutable unsigned m_typesettingFeatures : 2; // TypesettingFeatures
218 221
219 static TypesettingFeatures s_defaultTypesettingFeatures; 222 static TypesettingFeatures s_defaultTypesettingFeatures;
220 223
221 static bool s_useSubpixelTextPositioning; 224 static bool s_useSubpixelTextPositioning;
225 String m_locale;
222 }; 226 };
223 227
224 inline bool FontDescription::operator==(const FontDescription& other) const 228 inline bool FontDescription::operator==(const FontDescription& other) const
225 { 229 {
226 return m_familyList == other.m_familyList 230 return m_familyList == other.m_familyList
227 && m_specifiedSize == other.m_specifiedSize 231 && m_specifiedSize == other.m_specifiedSize
228 && m_computedSize == other.m_computedSize 232 && m_computedSize == other.m_computedSize
229 && m_letterSpacing == other.m_letterSpacing 233 && m_letterSpacing == other.m_letterSpacing
230 && m_wordSpacing == other.m_wordSpacing 234 && m_wordSpacing == other.m_wordSpacing
231 && m_style == other.m_style 235 && m_style == other.m_style
(...skipping 17 matching lines...) Expand all
249 && m_script == other.m_script 253 && m_script == other.m_script
250 && m_syntheticBold == other.m_syntheticBold 254 && m_syntheticBold == other.m_syntheticBold
251 && m_syntheticItalic == other.m_syntheticItalic 255 && m_syntheticItalic == other.m_syntheticItalic
252 && m_featureSettings == other.m_featureSettings 256 && m_featureSettings == other.m_featureSettings
253 && m_subpixelTextPosition == other.m_subpixelTextPosition; 257 && m_subpixelTextPosition == other.m_subpixelTextPosition;
254 } 258 }
255 259
256 } 260 }
257 261
258 #endif 262 #endif
OLDNEW
« no previous file with comments | « Source/core/css/resolver/FontBuilder.cpp ('k') | Source/platform/fonts/FontDescription.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698