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

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

Issue 476943003: Implement support for CSS font-stretch on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 | « LayoutTests/fast/text/font-stretch.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « LayoutTests/fast/text/font-stretch.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698