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

Unified Diff: Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp

Issue 175253002: Switch to HarfBuzz on Mac and remove CoreText shaper (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: ChromiumAATTest font based test added, header inclusion order fixed Created 6 years, 9 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
Index: Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp
diff --git a/Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp b/Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp
index 96b0285d4ec5b3a3300e6775111f86fca32c30e5..84d32f79f67aa6bac06571e8a5ef67309f202029 100644
--- a/Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp
+++ b/Source/platform/fonts/harfbuzz/HarfBuzzFaceCoreText.cpp
@@ -31,12 +31,12 @@
#include "config.h"
#include "platform/fonts/harfbuzz/HarfBuzzFace.h"
+#include "hb-coretext.h"
+#include "hb.h"
#include "platform/fonts/FontPlatformData.h"
#include "platform/fonts/SimpleFontData.h"
#include "platform/fonts/harfbuzz/HarfBuzzShaper.h"
-
#include <ApplicationServices/ApplicationServices.h>
-#include "hb.h"
namespace WebCore {
@@ -100,31 +100,9 @@ static hb_font_funcs_t* harfBuzzCoreTextGetFontFuncs()
return harfBuzzCoreTextFontFuncs;
}
-static void releaseTableData(void* userData)
-{
- CFDataRef cfData = reinterpret_cast<CFDataRef>(userData);
- CFRelease(cfData);
-}
-
-static hb_blob_t* harfBuzzCoreTextGetTable(hb_face_t* face, hb_tag_t tag, void* userData)
-{
- CGFontRef cgFont = reinterpret_cast<CGFontRef>(userData);
- CFDataRef cfData = CGFontCopyTableForTag(cgFont, tag);
- if (!cfData)
- return 0;
-
- const char* data = reinterpret_cast<const char*>(CFDataGetBytePtr(cfData));
- const size_t length = CFDataGetLength(cfData);
- if (!data || !length)
- return 0;
- return hb_blob_create(data, length, HB_MEMORY_MODE_READONLY, reinterpret_cast<void*>(const_cast<__CFData*>(cfData)), releaseTableData);
-}
-
hb_face_t* HarfBuzzFace::createFace()
{
- // It seems that CTFontCopyTable of MacOSX10.5 sdk doesn't work for
- // OpenType layout tables(GDEF, GSUB, GPOS). Use CGFontCopyTableForTag instead.
- hb_face_t* face = hb_face_create_for_tables(harfBuzzCoreTextGetTable, m_platformData->cgFont(), 0);
+ hb_face_t* face = hb_coretext_face_create(m_platformData->cgFont());
ASSERT(face);
return face;
}

Powered by Google App Engine
This is Rietveld 408576698