summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc54
1 files changed, 11 insertions, 43 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc
index e77825b343f..1331704e9e9 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-uniscribe.cc
@@ -25,7 +25,6 @@
*/
#include "hb.hh"
-#define HB_SHAPER uniscribe
#include "hb-shaper-impl.hh"
#include <windows.h>
@@ -314,9 +313,6 @@ struct range_record_t {
unsigned int index_last; /* == end - 1 */
};
-HB_SHAPER_DATA_ENSURE_DEFINE(uniscribe, face)
-HB_SHAPER_DATA_ENSURE_DEFINE(uniscribe, font)
-
/*
* shaper face data
@@ -503,11 +499,12 @@ _hb_uniscribe_shaper_face_data_destroy (hb_uniscribe_face_data_t *data)
* shaper font data
*/
-struct hb_uniscribe_font_data_t {
+struct hb_uniscribe_font_data_t
+{
HDC hdc;
- LOGFONTW log_font;
+ mutable LOGFONTW log_font;
HFONT hfont;
- SCRIPT_CACHE script_cache;
+ mutable SCRIPT_CACHE script_cache;
double x_mult, y_mult; /* From LOGFONT space to HB space. */
};
@@ -520,10 +517,7 @@ populate_log_font (LOGFONTW *lf,
lf->lfHeight = - (int) font_size;
lf->lfCharSet = DEFAULT_CHARSET;
- hb_face_t *face = font->face;
- hb_uniscribe_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
-
- memcpy (lf->lfFaceName, face_data->face_name, sizeof (lf->lfFaceName));
+ memcpy (lf->lfFaceName, font->face->data.uniscribe->face_name, sizeof (lf->lfFaceName));
return true;
}
@@ -531,8 +525,6 @@ populate_log_font (LOGFONTW *lf,
hb_uniscribe_font_data_t *
_hb_uniscribe_shaper_font_data_create (hb_font_t *font)
{
- if (unlikely (!hb_uniscribe_shaper_face_data_ensure (font->face))) return nullptr;
-
hb_uniscribe_font_data_t *data = (hb_uniscribe_font_data_t *) calloc (1, sizeof (hb_uniscribe_font_data_t));
if (unlikely (!data))
return nullptr;
@@ -586,39 +578,15 @@ _hb_uniscribe_shaper_font_data_destroy (hb_uniscribe_font_data_t *data)
LOGFONTW *
hb_uniscribe_font_get_logfontw (hb_font_t *font)
{
- if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return nullptr;
- hb_uniscribe_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
- return &font_data->log_font;
+ const hb_uniscribe_font_data_t *data = font->data.uniscribe;
+ return data ? &data->log_font : nullptr;
}
HFONT
hb_uniscribe_font_get_hfont (hb_font_t *font)
{
- if (unlikely (!hb_uniscribe_shaper_font_data_ensure (font))) return nullptr;
- hb_uniscribe_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
- return font_data->hfont;
-}
-
-
-/*
- * shaper shape_plan data
- */
-
-struct hb_uniscribe_shape_plan_data_t {};
-
-hb_uniscribe_shape_plan_data_t *
-_hb_uniscribe_shaper_shape_plan_data_create (hb_shape_plan_t *shape_plan HB_UNUSED,
- const hb_feature_t *user_features HB_UNUSED,
- unsigned int num_user_features HB_UNUSED,
- const int *coords HB_UNUSED,
- unsigned int num_coords HB_UNUSED)
-{
- return (hb_uniscribe_shape_plan_data_t *) HB_SHAPER_DATA_SUCCEEDED;
-}
-
-void
-_hb_uniscribe_shaper_shape_plan_data_destroy (hb_uniscribe_shape_plan_data_t *data HB_UNUSED)
-{
+ const hb_uniscribe_font_data_t *data = font->data.uniscribe;
+ return data ? data->hfont : nullptr;
}
@@ -635,8 +603,8 @@ _hb_uniscribe_shape (hb_shape_plan_t *shape_plan,
unsigned int num_features)
{
hb_face_t *face = font->face;
- hb_uniscribe_face_data_t *face_data = HB_SHAPER_DATA_GET (face);
- hb_uniscribe_font_data_t *font_data = HB_SHAPER_DATA_GET (font);
+ const hb_uniscribe_face_data_t *face_data = face->data.uniscribe;
+ const hb_uniscribe_font_data_t *font_data = font->data.uniscribe;
hb_uniscribe_shaper_funcs_t *funcs = face_data->funcs;
/*