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

Unified Diff: Source/platform/fonts/mac/SimpleFontDataMac.mm

Issue 275913005: Remove usePrinterFont() property of FontDescription (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebaselinining small caps cases, and subpixel virtual set Created 6 years, 7 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/mac/FontCacheMac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/mac/SimpleFontDataMac.mm
diff --git a/Source/platform/fonts/mac/SimpleFontDataMac.mm b/Source/platform/fonts/mac/SimpleFontDataMac.mm
index 4150244a74dfaf23d1f6facdf0205ee8165aa012..5586030251754e8d0c7decee790aa8ca5e11a5d7 100644
--- a/Source/platform/fonts/mac/SimpleFontDataMac.mm
+++ b/Source/platform/fonts/mac/SimpleFontDataMac.mm
@@ -119,14 +119,13 @@ const SimpleFontData* SimpleFontData::getCompositeFontReferenceFontData(NSFont *
return found;
}
if (CFMutableDictionaryRef dictionary = m_derivedFontData->compositeFontReferences.get()) {
- bool isUsingPrinterFont = platformData().isPrinterFont();
- NSFont *substituteFont = isUsingPrinterFont ? [key printerFont] : [key screenFont];
+ NSFont *substituteFont = [key printerFont];
CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(toCTFontRef(substituteFont));
bool syntheticBold = platformData().syntheticBold() && !(traits & kCTFontBoldTrait);
bool syntheticOblique = platformData().syntheticOblique() && !(traits & kCTFontItalicTrait);
- FontPlatformData substitutePlatform(substituteFont, platformData().size(), isUsingPrinterFont, syntheticBold, syntheticOblique, platformData().orientation(), platformData().widthVariant());
+ FontPlatformData substitutePlatform(substituteFont, platformData().size(), syntheticBold, syntheticOblique, platformData().orientation(), platformData().widthVariant());
SimpleFontData* value = new SimpleFontData(substitutePlatform, isCustomFont() ? CustomFontData::create() : nullptr);
if (value) {
CFDictionaryAddValue(dictionary, key, value);
@@ -314,11 +313,11 @@ PassRefPtr<SimpleFontData> SimpleFontData::platformCreateScaledFontData(const Fo
BEGIN_BLOCK_OBJC_EXCEPTIONS;
float size = m_platformData.size() * scaleFactor;
- FontPlatformData scaledFontData([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toSize:size], size, m_platformData.isPrinterFont(), false, false, m_platformData.orientation());
+ FontPlatformData scaledFontData([[NSFontManager sharedFontManager] convertFont:m_platformData.font() toSize:size], size, false, false, m_platformData.orientation());
- // AppKit resets the type information (screen/printer) when you convert a font to a different size.
- // We have to fix up the font that we're handed back.
- scaledFontData.setFont(fontDescription.usePrinterFont() ? [scaledFontData.font() printerFont] : [scaledFontData.font() screenFont]);
+ // Until we replace AppKit API (NSFontManager etc.), we always want to disable hinting,
+ // so we use the printerFont here.
+ scaledFontData.setFont([scaledFontData.font() printerFont]);
if (scaledFontData.font()) {
NSFontManager *fontManager = [NSFontManager sharedFontManager];
« no previous file with comments | « Source/platform/fonts/mac/FontCacheMac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698