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

Unified Diff: content/common/dwrite_font_platform_win.cc

Issue 1034813003: DirectWrite doesn't support Bitmap/Vector fonts and Adobe Type 1 fonts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 aa9d98fb058ebb8b3dedd57e33ece6a802dfa99f..648bc5e5facb9ca608e9c811fdbd39c4a1db995e 100644
--- a/content/common/dwrite_font_platform_win.cc
+++ b/content/common/dwrite_font_platform_win.cc
@@ -746,6 +746,12 @@ base::string16 FontCollectionLoader::GetFontNameFromKey(UINT32 idx) {
return reg_fonts_[idx];
}
+const base::FilePath::CharType* kFontExtensionsToIgnore[] {
+ FILE_PATH_LITERAL(".FON"), // Bitmap or vector
scottmg 2015/03/26 01:26:54 huh! I didn't know .fon had a vector format too.
+ FILE_PATH_LITERAL(".PFM"), // Adobe Type 1
+ FILE_PATH_LITERAL(".PFB"), // Adobe Type 1
+};
+
const wchar_t* kFontsToIgnore[] = {
// "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
@@ -798,6 +804,18 @@ bool FontCollectionLoader::LoadFontListFromRegistry() {
break;
}
}
+ // DirectWrite doesn't support bitmap/vector fonts and Adobe type 1
+ // fonts, we will ignore those font extensions.
+ // MSDN article: http://goo.gl/TfCOA
+ if (!should_ignore) {
+ for (const auto& ignore : kFontExtensionsToIgnore) {
+ if (path.MatchesExtension(ignore)) {
+ should_ignore = true;
+ break;
+ }
+ }
+ }
+
if (!should_ignore)
reg_fonts_.push_back(value.c_str());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698