diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index 37ab53539..dada9c7a0 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -514,6 +514,7 @@ struct StateTableDriver }; +struct ankr; struct hb_aat_apply_context_t : hb_dispatch_context_t @@ -529,6 +530,7 @@ struct hb_aat_apply_context_t : hb_face_t *face; hb_buffer_t *buffer; hb_sanitize_context_t sanitizer; + const ankr &ankr_table; /* Unused. For debug tracing only. */ unsigned int lookup_index; @@ -537,9 +539,10 @@ struct hb_aat_apply_context_t : inline hb_aat_apply_context_t (hb_ot_shape_plan_t *plan_, hb_font_t *font_, hb_buffer_t *buffer_, - hb_blob_t *table) : + hb_blob_t *table, + const ankr &ankr_table_ = Null(ankr)) : plan (plan_), font (font_), face (font->face), buffer (buffer_), - sanitizer (), lookup_index (0), debug_depth (0) + sanitizer (), ankr_table (ankr_table_), lookup_index (0), debug_depth (0) { sanitizer.init (table); sanitizer.set_num_glyphs (face->get_num_glyphs ()); diff --git a/src/hb-aat-layout.cc b/src/hb-aat-layout.cc index 3fd4f9f89..47462ad7c 100644 --- a/src/hb-aat-layout.cc +++ b/src/hb-aat-layout.cc @@ -68,6 +68,12 @@ _get_kerx (hb_face_t *face, hb_blob_t **blob = nullptr) *blob = hb_ot_face_data (face)->kerx.get_blob (); return kerx; } +static inline const AAT::ankr& +_get_ankr (hb_face_t *face) +{ + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(AAT::ankr); + return *(hb_ot_face_data (face)->ankr.get ()); +} hb_bool_t @@ -103,6 +109,6 @@ hb_aat_layout_position (hb_ot_shape_plan_t *plan, hb_blob_t *blob; const AAT::kerx& kerx = _get_kerx (font->face, &blob); - AAT::hb_aat_apply_context_t c (plan, font, buffer, blob); + AAT::hb_aat_apply_context_t c (plan, font, buffer, blob, _get_ankr (font->face)); kerx.apply (&c); }