| Index: Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
|
| diff --git a/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm b/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
|
| index b7b8f756fe30a5dd845d4418487cec8a7505a20e..71200f3634833bd6093686985b793d02996e4750 100644
|
| --- a/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
|
| +++ b/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
|
| @@ -28,9 +28,13 @@
|
| #import <AvailabilityMacros.h>
|
| #import <wtf/text/WTFString.h>
|
|
|
| +#include "platform/LayoutTestSupport.h"
|
| +#include "platform/RuntimeEnabledFeatures.h"
|
| #import "platform/fonts/harfbuzz/HarfBuzzFace.h"
|
| #include "third_party/skia/include/ports/SkTypeface_mac.h"
|
|
|
| +
|
| +
|
| namespace blink {
|
|
|
| unsigned FontPlatformData::hash() const
|
| @@ -40,6 +44,29 @@ unsigned FontPlatformData::hash() const
|
| return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
|
| }
|
|
|
| +void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext*) const
|
| +{
|
| + bool shouldSmoothFonts = true;
|
| + bool shouldAntialias = true;
|
| +
|
| + shouldAntialias = shouldAntialias && (!LayoutTestSupport::isRunningLayoutTest()
|
| + || LayoutTestSupport::isFontAntialiasingEnabledForTest());
|
| + bool useSubpixelText = RuntimeEnabledFeatures::subpixelFontScalingEnabled();
|
| + shouldSmoothFonts = shouldSmoothFonts && !LayoutTestSupport::isRunningLayoutTest();
|
| +
|
| + paint->setAntiAlias(shouldAntialias);
|
| + paint->setEmbeddedBitmapText(false);
|
| + const float ts = m_textSize >= 0 ? m_textSize : 12;
|
| + paint->setTextSize(SkFloatToScalar(ts));
|
| + paint->setTypeface(typeface());
|
| + paint->setFakeBoldText(m_syntheticBold);
|
| + paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0);
|
| + paint->setAutohinted(false); // freetype specific
|
| + paint->setLCDRenderText(shouldSmoothFonts);
|
| + paint->setSubpixelText(useSubpixelText);
|
| + paint->setHinting(SkPaint::kNo_Hinting);
|
| +}
|
| +
|
| // These CoreText Text Spacing feature selectors are not defined in CoreText.
|
| enum TextSpacingCTFeatureSelector { TextSpacingProportional, TextSpacingFullWidth, TextSpacingHalfWidth, TextSpacingThirdWidth, TextSpacingQuarterWidth };
|
|
|
| @@ -264,19 +291,4 @@ CTFontRef FontPlatformData::ctFont() const
|
| return m_CTFont.get();
|
| }
|
|
|
| -bool FontPlatformData::isAATFont(CTFontRef ctFont) const
|
| -{
|
| - CFDataRef table = CTFontCopyTable(ctFont, kCTFontTableMort, 0);
|
| - if (table) {
|
| - CFRelease(table);
|
| - return true;
|
| - }
|
| - table = CTFontCopyTable(ctFont, kCTFontTableMorx, 0);
|
| - if (table) {
|
| - CFRelease(table);
|
| - return true;
|
| - }
|
| - return false;
|
| -}
|
| -
|
| } // namespace blink
|
|
|