Chromium Code Reviews| Index: webkit/glue/webpreferences.cc |
| diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc |
| index 42eb5133443f4a98c752ffbd477549ffc7512d59..54ca6abd35434668155f84f64d26d75d0677f196 100644 |
| --- a/webkit/glue/webpreferences.cc |
| +++ b/webkit/glue/webpreferences.cc |
| @@ -25,14 +25,12 @@ using WebKit::WebString; |
| using WebKit::WebURL; |
| using WebKit::WebView; |
| +namespace { |
| +const char kWebKitCommonScript[] = "Zyyy"; |
|
darin (slow to review)
2012/04/23 17:00:35
How was this string literal chosen? What is the s
falken
2012/04/24 01:27:10
The font maps are from ISO 15924 script code to fo
|
| +} |
| + |
| WebPreferences::WebPreferences() |
| - : standard_font_family(ASCIIToUTF16("Times New Roman")), |
| - fixed_font_family(ASCIIToUTF16("Courier New")), |
| - serif_font_family(ASCIIToUTF16("Times New Roman")), |
| - sans_serif_font_family(ASCIIToUTF16("Arial")), |
| - cursive_font_family(ASCIIToUTF16("Script")), |
| - fantasy_font_family(), // Not sure what to use on Windows. |
| - default_font_size(16), |
| + : default_font_size(16), |
| default_fixed_font_size(13), |
| minimum_font_size(0), |
| minimum_logical_font_size(6), |
| @@ -105,6 +103,18 @@ WebPreferences::WebPreferences() |
| per_tile_painting_enabled(false), |
| css_regions_enabled(false), |
| css_shaders_enabled(false) { |
| + standard_font_family_map[kWebKitCommonScript] = |
| + ASCIIToUTF16("Times New Roman"); |
| + fixed_font_family_map[kWebKitCommonScript] = |
| + ASCIIToUTF16("Courier New"); |
| + serif_font_family_map[kWebKitCommonScript] = |
| + ASCIIToUTF16("Times New Roman"); |
| + sans_serif_font_family_map[kWebKitCommonScript] = |
| + ASCIIToUTF16("Arial"); |
| + cursive_font_family_map[kWebKitCommonScript] = |
| + ASCIIToUTF16("Script"); |
| + fantasy_font_family_map[kWebKitCommonScript] = |
| + ASCIIToUTF16(""); // Not sure what to use on Windows |
|
tony
2012/04/27 17:22:18
Impact is the default on Windows.
falken
2012/05/09 06:48:08
Done.
|
| } |
| WebPreferences::~WebPreferences() { |
| @@ -166,12 +176,6 @@ void ApplyFontsFromMap(const WebPreferences::ScriptFontFamilyMap& map, |
| void WebPreferences::Apply(WebView* web_view) const { |
| WebSettings* settings = web_view->settings(); |
| - settings->setStandardFontFamily(standard_font_family); |
| - settings->setFixedFontFamily(fixed_font_family); |
| - settings->setSerifFontFamily(serif_font_family); |
| - settings->setSansSerifFontFamily(sans_serif_font_family); |
| - settings->setCursiveFontFamily(cursive_font_family); |
| - settings->setFantasyFontFamily(fantasy_font_family); |
| ApplyFontsFromMap(standard_font_family_map, setStandardFontFamilyWrapper, |
| settings); |
| ApplyFontsFromMap(fixed_font_family_map, setFixedFontFamilyWrapper, settings); |