| Index: third_party/harfbuzz-ng/src/hb-tt-font.cc
|
| diff --git a/third_party/harfbuzz-ng/src/hb-tt-font.cc b/third_party/harfbuzz-ng/src/hb-tt-font.cc
|
| index 0055ae9cd53e2d9cbf2d1a0a6ce5af1921747ddd..b7198efdc9f88ccbb139215ee87ed7ebf0a299ce 100644
|
| --- a/third_party/harfbuzz-ng/src/hb-tt-font.cc
|
| +++ b/third_party/harfbuzz-ng/src/hb-tt-font.cc
|
| @@ -51,7 +51,7 @@ _hb_tt_font_create (hb_font_t *font)
|
| /* TODO Remove this object altogether */
|
| hb_tt_font_t *tt = (hb_tt_font_t *) calloc (1, sizeof (hb_tt_font_t));
|
|
|
| - tt->hhea_blob = Sanitizer<hhea>::sanitize (hb_face_reference_table (font->face, HB_OT_TAG_hhea));
|
| + tt->hhea_blob = Sanitizer<hhea>::sanitize (font->face->reference_table (HB_OT_TAG_hhea));
|
| tt->hhea = Sanitizer<hhea>::lock_instance (tt->hhea_blob);
|
|
|
| return tt;
|
| @@ -76,168 +76,4 @@ _get_hhea (hb_face_t *face)
|
| * hb_tt_font_funcs_t
|
| */
|
|
|
| -static hb_bool_t
|
| -hb_font_get_glyph_nil (hb_font_t *font HB_UNUSED,
|
| - void *font_data HB_UNUSED,
|
| - hb_codepoint_t unicode,
|
| - hb_codepoint_t variation_selector,
|
| - hb_codepoint_t *glyph,
|
| - void *user_data HB_UNUSED)
|
| -{
|
| - if (font->parent)
|
| - return hb_font_get_glyph (font->parent, unicode, variation_selector, glyph);
|
| -
|
| - *glyph = 0;
|
| - return false;
|
| -}
|
| -
|
| -static hb_position_t
|
| -hb_font_get_glyph_h_advance_nil (hb_font_t *font HB_UNUSED,
|
| - void *font_data HB_UNUSED,
|
| - hb_codepoint_t glyph,
|
| - void *user_data HB_UNUSED)
|
| -{
|
| - if (font->parent)
|
| - return font->parent_scale_x_distance (hb_font_get_glyph_h_advance (font->parent, glyph));
|
| -
|
| - return font->x_scale;
|
| -}
|
| -
|
| -static hb_position_t
|
| -hb_font_get_glyph_v_advance_nil (hb_font_t *font HB_UNUSED,
|
| - void *font_data HB_UNUSED,
|
| - hb_codepoint_t glyph,
|
| - void *user_data HB_UNUSED)
|
| -{
|
| - if (font->parent)
|
| - return font->parent_scale_y_distance (hb_font_get_glyph_v_advance (font->parent, glyph));
|
| -
|
| - return font->y_scale;
|
| -}
|
| -
|
| -static hb_bool_t
|
| -hb_font_get_glyph_h_origin_nil (hb_font_t *font HB_UNUSED,
|
| - void *font_data HB_UNUSED,
|
| - hb_codepoint_t glyph,
|
| - hb_position_t *x,
|
| - hb_position_t *y,
|
| - void *user_data HB_UNUSED)
|
| -{
|
| - if (font->parent) {
|
| - hb_bool_t ret = hb_font_get_glyph_h_origin (font->parent,
|
| - glyph,
|
| - x, y);
|
| - if (ret)
|
| - font->parent_scale_position (x, y);
|
| - return ret;
|
| - }
|
| -
|
| - *x = *y = 0;
|
| - return false;
|
| -}
|
| -
|
| -static hb_bool_t
|
| -hb_font_get_glyph_v_origin_nil (hb_font_t *font HB_UNUSED,
|
| - void *font_data HB_UNUSED,
|
| - hb_codepoint_t glyph,
|
| - hb_position_t *x,
|
| - hb_position_t *y,
|
| - void *user_data HB_UNUSED)
|
| -{
|
| - if (font->parent) {
|
| - hb_bool_t ret = hb_font_get_glyph_v_origin (font->parent,
|
| - glyph,
|
| - x, y);
|
| - if (ret)
|
| - font->parent_scale_position (x, y);
|
| - return ret;
|
| - }
|
| -
|
| - *x = *y = 0;
|
| - return false;
|
| -}
|
| -
|
| -static hb_position_t
|
| -hb_font_get_glyph_h_kerning_nil (hb_font_t *font HB_UNUSED,
|
| - void *font_data HB_UNUSED,
|
| - hb_codepoint_t left_glyph,
|
| - hb_codepoint_t right_glyph,
|
| - void *user_data HB_UNUSED)
|
| -{
|
| - if (font->parent)
|
| - return font->parent_scale_x_distance (hb_font_get_glyph_h_kerning (font->parent, left_glyph, right_glyph));
|
| -
|
| - return 0;
|
| -}
|
| -
|
| -static hb_position_t
|
| -hb_font_get_glyph_v_kerning_nil (hb_font_t *font HB_UNUSED,
|
| - void *font_data HB_UNUSED,
|
| - hb_codepoint_t top_glyph,
|
| - hb_codepoint_t bottom_glyph,
|
| - void *user_data HB_UNUSED)
|
| -{
|
| - if (font->parent)
|
| - return font->parent_scale_y_distance (hb_font_get_glyph_v_kerning (font->parent, top_glyph, bottom_glyph));
|
| -
|
| - return 0;
|
| -}
|
| -
|
| -static hb_bool_t
|
| -hb_font_get_glyph_extents_nil (hb_font_t *font HB_UNUSED,
|
| - void *font_data HB_UNUSED,
|
| - hb_codepoint_t glyph,
|
| - hb_glyph_extents_t *extents,
|
| - void *user_data HB_UNUSED)
|
| -{
|
| - if (font->parent) {
|
| - hb_bool_t ret = hb_font_get_glyph_extents (font->parent,
|
| - glyph,
|
| - extents);
|
| - if (ret) {
|
| - font->parent_scale_position (&extents->x_bearing, &extents->y_bearing);
|
| - font->parent_scale_distance (&extents->width, &extents->height);
|
| - }
|
| - return ret;
|
| - }
|
| -
|
| - memset (extents, 0, sizeof (*extents));
|
| - return false;
|
| -}
|
| -
|
| -static hb_bool_t
|
| -hb_font_get_glyph_contour_point_nil (hb_font_t *font HB_UNUSED,
|
| - void *font_data HB_UNUSED,
|
| - hb_codepoint_t glyph,
|
| - unsigned int point_index,
|
| - hb_position_t *x,
|
| - hb_position_t *y,
|
| - void *user_data HB_UNUSED)
|
| -{
|
| - if (font->parent) {
|
| - hb_bool_t ret = hb_font_get_glyph_contour_point (font->parent,
|
| - glyph, point_index,
|
| - x, y);
|
| - if (ret)
|
| - font->parent_scale_position (x, y);
|
| - return ret;
|
| - }
|
| -
|
| - *x = *y = 0;
|
| - return false;
|
| -}
|
| -
|
| -
|
| -static hb_font_funcs_t _hb_font_funcs_nil = {
|
| - HB_OBJECT_HEADER_STATIC,
|
| -
|
| - true, /* immutable */
|
| -
|
| - {
|
| -#define HB_FONT_FUNC_IMPLEMENT(name) hb_font_get_##name##_nil,
|
| - HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
|
| -#undef HB_FONT_FUNC_IMPLEMENT
|
| - }
|
| -};
|
| #endif
|
| -
|
|
|