Harfbuzz: get rid of Qt-specific patch in CoreText shaper code
this code isn't used as of 21c242f9fd
and thus we do not need to keep the patch around
Change-Id: Ic3b836c6a68f40b8e450542a39db968ef3b09101
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
bb10
parent
12d3d32f31
commit
1ab2e4baef
|
|
@ -1,76 +0,0 @@
|
|||
From 96b71dc7c8ab8aa020f47dc659b32c2002001015 Mon Sep 17 00:00:00 2001
|
||||
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
||||
Date: Thu, 28 Nov 2019 14:51:39 +0100
|
||||
Subject: [PATCH] Qt-specific workaround for AAT shaper
|
||||
|
||||
CoreText API doesn't give us a fontdata to reconstruct the original font,
|
||||
so we have to store the CTFont and CGFont of interest in context object
|
||||
passed to HB from native font engine.
|
||||
|
||||
Change-Id: I9a71ae71b7d22f32498a9dd386500fa867a5f6cd
|
||||
---
|
||||
src/3rdparty/harfbuzz-ng/src/hb-coretext.cc | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc b/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
|
||||
index 8885cfe..f4e3ef0 100644
|
||||
--- a/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
|
||||
+++ b/src/3rdparty/harfbuzz-ng/src/hb-coretext.cc
|
||||
@@ -36,6 +36,18 @@
|
||||
#include "hb-aat-layout.hh"
|
||||
#include <math.h>
|
||||
|
||||
+typedef bool (*qt_get_font_table_func_t) (void *user_data, unsigned int tag, unsigned char *buffer, unsigned int *length);
|
||||
+
|
||||
+struct FontEngineFaceData {
|
||||
+ void *user_data;
|
||||
+ qt_get_font_table_func_t get_font_table;
|
||||
+};
|
||||
+
|
||||
+struct CoreTextFontEngineData {
|
||||
+ CTFontRef ctFont;
|
||||
+ CGFontRef cgFont;
|
||||
+};
|
||||
+
|
||||
|
||||
/**
|
||||
* SECTION:hb-coretext
|
||||
@@ -107,6 +119,7 @@ get_last_resort_font_desc ()
|
||||
return font_desc;
|
||||
}
|
||||
|
||||
+#if 0
|
||||
static void
|
||||
release_data (void *info, const void *data, size_t size)
|
||||
{
|
||||
@@ -115,6 +128,7 @@ release_data (void *info, const void *data, size_t size)
|
||||
|
||||
hb_blob_destroy ((hb_blob_t *) info);
|
||||
}
|
||||
+#endif
|
||||
|
||||
static CGFontRef
|
||||
create_cg_font (hb_face_t *face)
|
||||
@@ -126,6 +140,7 @@ create_cg_font (hb_face_t *face)
|
||||
}
|
||||
else
|
||||
{
|
||||
+#if 0
|
||||
hb_blob_t *blob = hb_face_reference_blob (face);
|
||||
unsigned int blob_length;
|
||||
const char *blob_data = hb_blob_get_data (blob, &blob_length);
|
||||
@@ -140,6 +155,11 @@ create_cg_font (hb_face_t *face)
|
||||
DEBUG_MSG (CORETEXT, face, "Face CGFontCreateWithDataProvider() failed");
|
||||
CGDataProviderRelease (provider);
|
||||
}
|
||||
+#else
|
||||
+ FontEngineFaceData *fontEngineFaceData = (FontEngineFaceData *) face->user_data;
|
||||
+ CoreTextFontEngineData *coreTextFontEngineData = (CoreTextFontEngineData *) fontEngineFaceData->user_data;
|
||||
+ cg_font = CGFontRetain (coreTextFontEngineData->cgFont);
|
||||
+#endif
|
||||
}
|
||||
return cg_font;
|
||||
}
|
||||
--
|
||||
2.8.1
|
||||
|
||||
|
|
@ -36,18 +36,6 @@
|
|||
#include "hb-aat-layout.hh"
|
||||
#include <math.h>
|
||||
|
||||
typedef bool (*qt_get_font_table_func_t) (void *user_data, unsigned int tag, unsigned char *buffer, unsigned int *length);
|
||||
|
||||
struct FontEngineFaceData {
|
||||
void *user_data;
|
||||
qt_get_font_table_func_t get_font_table;
|
||||
};
|
||||
|
||||
struct CoreTextFontEngineData {
|
||||
CTFontRef ctFont;
|
||||
CGFontRef cgFont;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* SECTION:hb-coretext
|
||||
|
|
@ -119,7 +107,6 @@ get_last_resort_font_desc ()
|
|||
return font_desc;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
release_data (void *info, const void *data, size_t size)
|
||||
{
|
||||
|
|
@ -128,7 +115,6 @@ release_data (void *info, const void *data, size_t size)
|
|||
|
||||
hb_blob_destroy ((hb_blob_t *) info);
|
||||
}
|
||||
#endif
|
||||
|
||||
static CGFontRef
|
||||
create_cg_font (hb_face_t *face)
|
||||
|
|
@ -140,7 +126,6 @@ create_cg_font (hb_face_t *face)
|
|||
}
|
||||
else
|
||||
{
|
||||
#if 0
|
||||
hb_blob_t *blob = hb_face_reference_blob (face);
|
||||
unsigned int blob_length;
|
||||
const char *blob_data = hb_blob_get_data (blob, &blob_length);
|
||||
|
|
@ -155,11 +140,6 @@ create_cg_font (hb_face_t *face)
|
|||
DEBUG_MSG (CORETEXT, face, "Face CGFontCreateWithDataProvider() failed");
|
||||
CGDataProviderRelease (provider);
|
||||
}
|
||||
#else
|
||||
FontEngineFaceData *fontEngineFaceData = (FontEngineFaceData *) face->user_data;
|
||||
CoreTextFontEngineData *coreTextFontEngineData = (CoreTextFontEngineData *) fontEngineFaceData->user_data;
|
||||
cg_font = CGFontRetain (coreTextFontEngineData->cgFont);
|
||||
#endif
|
||||
}
|
||||
return cg_font;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue