Index: Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp |
diff --git a/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp b/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp |
index 0120b9ec0e8b4a687c3c74a7e1a91eb64607d8e0..3c882005775865ab6eb8cce92d0828741b363e8e 100644 |
--- a/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp |
+++ b/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp |
@@ -32,6 +32,8 @@ |
#include "config.h" |
#include "core/platform/graphics/FontCache.h" |
+#include "SkFontMgr.h" |
+#include "SkTypeface_win.h" |
#include "core/platform/NotImplemented.h" |
#include "core/platform/graphics/Font.h" |
#include "core/platform/graphics/SimpleFontData.h" |
@@ -40,6 +42,18 @@ |
namespace WebCore { |
+FontCache::FontCache() |
+ : m_purgePreventCount(0) |
+{ |
+ m_fontManager = SkFontMgr_New_GDI(); |
+} |
+ |
+FontCache::~FontCache() |
+{ |
+ m_fontManager->unref(); |
+} |
+ |
+ |
static bool fontContainsCharacter(const FontPlatformData* fontData, const wchar_t* family, UChar32 character) |
{ |
SkPaint paint; |
@@ -168,7 +182,16 @@ static bool typefacesMatchesFamily(const SkTypeface* tf, const AtomicString& fam |
FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family) |
{ |
CString name; |
- SkTypeface* tf = createTypeface(fontDescription, family, name); |
+ getFontNameIncludingFallback(fontDescription, family, name); |
+ |
+ // FIXME: Use SkFontStyle and matchFamilyStyle instead of legacyCreateTypeface. |
+ int style = SkTypeface::kNormal; |
+ if (fontDescription.weight() >= FontWeightBold) |
+ style |= SkTypeface::kBold; |
+ if (fontDescription.italic()) |
+ style |= SkTypeface::kItalic; |
+ |
+ SkTypeface* tf = m_fontManager->legacyCreateTypeface(name.data(), style); |
if (!tf) |
return 0; |