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

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

Issue 616703004: Merge 183104 "Force ComplexPath if any part of the node requires it" (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2171/
Patch Set: Created 6 years, 2 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
===================================================================
--- Source/platform/fonts/win/FontCacheSkiaWin.cpp (revision 183159)
+++ Source/platform/fonts/win/FontCacheSkiaWin.cpp (working copy)
@@ -76,7 +76,9 @@
// 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 @@
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