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

Unified Diff: Source/platform/fonts/skia/FontCacheSkia.cpp

Issue 235553003: Support sideloaded fonts for DirectWrite (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 8 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/skia/FontCacheSkia.cpp
diff --git a/Source/platform/fonts/skia/FontCacheSkia.cpp b/Source/platform/fonts/skia/FontCacheSkia.cpp
index 67d20f2a9b2404804879089bd91d7c28eb3a7903..67ba7e2548f8907ac318fdd8f83a895b6f29e6a0 100644
--- a/Source/platform/fonts/skia/FontCacheSkia.cpp
+++ b/Source/platform/fonts/skia/FontCacheSkia.cpp
@@ -124,8 +124,14 @@ PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDesc
if (fontDescription.style())
style |= SkTypeface::kItalic;
- // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypeface.
#if OS(WIN)
+ if (s_sideloadedFonts) {
+ HashMap<String, SkTypeface*>::iterator i = s_sideloadedFonts->find(name.data());
eae 2014/04/12 10:51:33 The blink convention is to only use the variable n
scottmg 2014/04/12 15:42:39 Done.
+ if (i != s_sideloadedFonts->end()) {
+ return adoptRef(i->value);
+ }
+ }
+ // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypeface.
if (m_fontManager)
return adoptRef(m_fontManager->legacyCreateTypeface(name.data(), style));
#endif

Powered by Google App Engine
This is Rietveld 408576698