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

Unified Diff: Source/platform/fonts/win/FontCacheSkiaWin.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/win/FontCacheSkiaWin.cpp
diff --git a/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
index 8f1ae21f65091c601becef20ebf005374fe6b56b..be6d0629b603f10567bc4564e947958d2b4db8b7 100644
--- a/Source/platform/fonts/win/FontCacheSkiaWin.cpp
+++ b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -42,6 +42,18 @@
namespace WebCore {
+HashMap<String, SkTypeface*>* FontCache::s_sideloadedFonts = 0;
+
+// static
+void FontCache::addSideloadedFont(SkTypeface* typeface)
+{
+ if (!s_sideloadedFonts)
+ s_sideloadedFonts = new HashMap<String, SkTypeface*>;
+ SkString name;
+ typeface->getFamilyName(&name);
+ s_sideloadedFonts->set(name.c_str(), typeface);
+}
+
FontCache::FontCache()
: m_purgePreventCount(0)
{

Powered by Google App Engine
This is Rietveld 408576698