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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: Source/platform/fonts/FontDescription.h
diff --git a/Source/platform/fonts/FontDescription.h b/Source/platform/fonts/FontDescription.h
index 4a12367cdb11457652c846caa5cf31bacd3dea73..7c3ca2b5932b23a7c8dc54d0e810f9aedf49f224 100644
--- a/Source/platform/fonts/FontDescription.h
+++ b/Source/platform/fonts/FontDescription.h
@@ -81,6 +81,7 @@ public:
, m_syntheticItalic(false)
, m_subpixelTextPosition(s_useSubpixelTextPositioning)
, m_typesettingFeatures(s_defaultTypesettingFeatures)
+ , m_locale(String("en"))
bashi 2014/05/14 10:00:01 Assuming lang=en is OK? Also, I'm not sure we can
h.joshi 2014/05/14 10:50:47 As commented by Behdad, once this patch is committ
bashi 2014/05/14 11:32:27 I'm still not convinced, but I don't have a strong
{
}
@@ -116,6 +117,7 @@ public:
FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMode>(m_fontSmoothing); }
TextRenderingMode textRendering() const { return static_cast<TextRenderingMode>(m_textRendering); }
UScriptCode script() const { return static_cast<UScriptCode>(m_script); }
+ String locale() const { return static_cast<String>(m_locale); }
bashi 2014/05/14 10:00:01 Why static_cast<>?
h.joshi 2014/05/14 10:50:47 This method is "const", so need to type cast. On 2
bashi 2014/05/14 11:32:27 Then, it should return const String&
bool isSyntheticBold() const { return m_syntheticBold; }
bool isSyntheticItalic() const { return m_syntheticItalic; }
bool useSubpixelPositioning() const { return m_subpixelTextPosition; }
@@ -154,6 +156,7 @@ public:
void setNonCJKGlyphOrientation(NonCJKGlyphOrientation orientation) { m_nonCJKGlyphOrientation = orientation; }
void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; }
void setScript(UScriptCode s) { m_script = s; }
+ void setLocale(const String& localeStr) { m_locale = localeStr; }
void setSyntheticBold(bool syntheticBold) { m_syntheticBold = syntheticBold; }
void setSyntheticItalic(bool syntheticItalic) { m_syntheticItalic = syntheticItalic; }
void setFeatureSettings(PassRefPtr<FontFeatureSettings> settings) { m_featureSettings = settings; }
@@ -219,6 +222,7 @@ private:
static TypesettingFeatures s_defaultTypesettingFeatures;
static bool s_useSubpixelTextPositioning;
+ String m_locale;
};
inline bool FontDescription::operator==(const FontDescription& other) const

Powered by Google App Engine
This is Rietveld 408576698