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

Unified Diff: Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm

Issue 618723003: Revert of Switch to HarfBuzz on Mac and remove CoreText shaper (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/FontPlatformData.cpp ('k') | Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
diff --git a/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm b/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
index 71200f3634833bd6093686985b793d02996e4750..b7b8f756fe30a5dd845d4418487cec8a7505a20e 100644
--- a/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
+++ b/Source/platform/fonts/cocoa/FontPlatformDataCocoa.mm
@@ -28,12 +28,8 @@
#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 {
@@ -42,29 +38,6 @@
ASSERT(m_font || !m_cgFont);
uintptr_t hashCodes[3] = { (uintptr_t)m_font, m_widthVariant, static_cast<uintptr_t>(m_isHashTableDeletedValue << 3 | m_orientation << 2 | m_syntheticBold << 1 | m_syntheticItalic) };
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.
@@ -291,4 +264,19 @@
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
« no previous file with comments | « Source/platform/fonts/FontPlatformData.cpp ('k') | Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698