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

Unified Diff: Source/platform/fonts/win/FontCacheSkiaWin.cpp

Issue 622653002: Force ComplexPath if any part of the node requires it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 3 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 | « Source/platform/fonts/Font.cpp ('k') | Source/platform/text/TextRun.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/win/FontCacheSkiaWin.cpp
diff --git a/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
index b6dde3176083df54eac3c9dcb5602c9c22fda770..a2c9a6aef009a7f7705c83979ae7e631e6266fcb 100644
--- a/Source/platform/fonts/win/FontCacheSkiaWin.cpp
+++ b/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -76,7 +76,9 @@ FontCache::FontCache()
// Given the desired base font, this will create a SimpleFontData for a specific
// font that can be used to render the given range of characters.
-PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescription& fontDescription, UChar32 character, const SimpleFontData*)
+PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(
+ const FontDescription& fontDescription, UChar32 character,
+ const SimpleFontData* originalFontData)
{
// First try the specified font with standard style & weight.
if (fontDescription.style() == FontStyleItalic
@@ -161,6 +163,15 @@ PassRefPtr<SimpleFontData> FontCache::fallbackFontForCharacter(const FontDescrip
data = getFontPlatformData(fontDescription, createByFamily);
}
+ // For font fallback we want to match the subpixel behavior of the original
+ // font. Mixing subpixel and non-subpixel in the same text run looks really
+ // odd and causes problems with preferred width calculations.
+ if (data && originalFontData) {
+ const FontPlatformData& platformData = originalFontData->platformData();
+ data->setMinSizeForAntiAlias(platformData.minSizeForAntiAlias());
+ data->setMinSizeForSubpixel(platformData.minSizeForSubpixel());
+ }
+
// When i-th font (0-base) in |panUniFonts| contains a character and
// we get out of the loop, |i| will be |i + 1|. That is, if only the
// last font in the array covers the character, |i| will be numFonts.
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | Source/platform/text/TextRun.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698