diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 8a0ed0ce9..70e0af04a 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -616,13 +616,18 @@ struct hb_apply_context_t } inline void _set_glyph_props (hb_codepoint_t glyph_index, - unsigned int class_guess = 0) const + unsigned int class_guess = 0, + bool ligature = false) const { - unsigned int add_in = HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED; + unsigned int add_in = _hb_glyph_info_get_glyph_props (&buffer->cur()) & + HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE; + add_in |= HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED; + if (ligature) + add_in |= HB_OT_LAYOUT_GLYPH_PROPS_LIGATED; if (likely (has_glyph_classes)) _hb_glyph_info_set_glyph_props (&buffer->cur(), add_in | gdef.get_glyph_props (glyph_index)); else if (class_guess) - _hb_glyph_info_set_glyph_props (&buffer->cur(), add_in| class_guess); + _hb_glyph_info_set_glyph_props (&buffer->cur(), add_in | class_guess); } inline void replace_glyph (hb_codepoint_t glyph_index) const @@ -638,7 +643,7 @@ struct hb_apply_context_t inline void replace_glyph_with_ligature (hb_codepoint_t glyph_index, unsigned int class_guess) const { - _set_glyph_props (glyph_index, class_guess); + _set_glyph_props (glyph_index, class_guess, true); buffer->replace_glyph (glyph_index); } inline void output_glyph (hb_codepoint_t glyph_index, diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index 1da4400ef..c37117b86 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -50,8 +50,11 @@ typedef enum HB_OT_LAYOUT_GLYPH_PROPS_MARK = 0x08u, /* The following are used internally; not derived from GDEF. */ - HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED = 0x10u + HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED = 0x10u, + HB_OT_LAYOUT_GLYPH_PROPS_LIGATED = 0x20u, + HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE = HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED | + HB_OT_LAYOUT_GLYPH_PROPS_LIGATED } hb_ot_layout_glyph_class_mask_t;