Index: Source/platform/fonts/skia/FontCacheSkia.cpp |
diff --git a/Source/platform/fonts/skia/FontCacheSkia.cpp b/Source/platform/fonts/skia/FontCacheSkia.cpp |
index dd6c630c000c3b14b86acc8c4a519164043bfafe..6fcbca2195a0ea43ca16c27c55ade2b183ab15e5 100644 |
--- a/Source/platform/fonts/skia/FontCacheSkia.cpp |
+++ b/Source/platform/fonts/skia/FontCacheSkia.cpp |
@@ -167,13 +167,20 @@ PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescri |
#if OS(WIN) |
static inline SkFontStyle fontStyle(const FontDescription& fontDescription) |
{ |
- int width = SkFontStyle::kNormal_Width; |
+ int width = static_cast<int>(fontDescription.stretch()); |
int weight = (fontDescription.weight() - FontWeight100 + 1) * 100; |
SkFontStyle::Slant slant = fontDescription.style() == FontStyleItalic |
? SkFontStyle::kItalic_Slant |
: SkFontStyle::kUpright_Slant; |
return SkFontStyle(weight, width, slant); |
} |
+ |
+COMPILE_ASSERT(FontStretchUltraCondensed == SkFontStyle::kUltraCondensed_Width, |
+ FontStretchUltraCondensedMapsTokUltraCondensed_Width); |
+COMPILE_ASSERT(FontStretchNormal == SkFontStyle::kNormal_Width, |
+ FontStretchNormalMapsTokNormal_Width); |
+COMPILE_ASSERT(FontStretchUltraExpanded == SkFontStyle::kUltaExpanded_Width, |
+ FontStretchUltraExpandedMapsTokUltaExpanded_Width); |
#endif |
PassRefPtr<SkTypeface> FontCache::createTypeface(const FontDescription& fontDescription, const FontFaceCreationParams& creationParams, CString& name) |