Index: content/common/dwrite_font_platform_win.cc |
diff --git a/content/common/dwrite_font_platform_win.cc b/content/common/dwrite_font_platform_win.cc |
index c2547b5ea323842894728211f92e750a84788c13..b53c754e68f4d1e8413addc8b6dbfce3797ec8c7 100644 |
--- a/content/common/dwrite_font_platform_win.cc |
+++ b/content/common/dwrite_font_platform_win.cc |
@@ -84,7 +84,7 @@ const double kArbitraryCacheFileSizeLimit = (30 * 1024 * 1024); |
// that file directly from system fonts folder. |
const unsigned int kMaxFontFileNameLength = 34; |
-const DWORD kCacheFileVersion = 103; |
+const DWORD kCacheFileVersion = 104; |
scottmg
2015/02/06 19:27:33
shrikant: Is this necessary?
Shrikant Kelkar
2015/02/06 20:56:22
Not necessary in this case.. Registry fonts will b
scottmg
2015/02/06 21:39:33
OK, undid this change.
|
const DWORD kFileSignature = 0x4D4F5243; // CROM |
const DWORD kMagicCompletionSignature = 0x454E4F44; // DONE |
@@ -773,7 +773,25 @@ bool FontCollectionLoader::LoadFontListFromRegistry() { |
value.size() < kMaxFontFileNameLength - 1) || |
base::FilePath::CompareEqualIgnoreCase(system_font_path.value(), |
path.DirName().value())) { |
- reg_fonts_.push_back(value.c_str()); |
+ // "Gill Sans Ultra Bold" turns into an Ultra Bold weight "Gill Sans" |
+ // in DirectWrite, but most users don't have any other weights. The |
+ // regular weight font is named "Gill Sans MT", but that ends up in a |
+ // different family with that name. On Mac, there's a "Gill Sans" with |
+ // various weights, so CSS authors use { 'font-family': 'Gill Sans', |
+ // 'Gill Sans MT', ... } and because of the DirectWrite family futzing, |
+ // they end up with an Ultra Bold font, when they just wanted "Gill |
+ // Sans". Mozilla implemented a more complicated hack where they |
+ // effectively rename the Ultra Bold font to "Gill Sans MT Ultra Bold", |
+ // but because the Ultra Bold font is so ugly anyway, we simply ignore |
+ // it. See http://www.microsoft.com/typography/fonts/font.aspx?FMID=978 |
+ // for a picture of the font, and the file name. We also ignore "Gill |
+ // Sans Ultra Bold Condensed". |
+ if (!base::FilePath::CompareEqualIgnoreCase( |
+ path.value(), FILE_PATH_LITERAL("gilsanub.ttf")) && |
+ !base::FilePath::CompareEqualIgnoreCase( |
+ path.value(), FILE_PATH_LITERAL("gillubcd.ttf"))) { |
Shrikant Kelkar
2015/02/06 20:56:22
Since more than one, please consider using fonts_t
scottmg
2015/02/06 21:39:33
Done.
|
+ reg_fonts_.push_back(value.c_str()); |
+ } |
} |
} |
} |