From a1f7b2856184959e965c9c2b80363f9f46d486a7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 18 Oct 2013 01:09:08 +0200 Subject: [PATCH] [otlayout] Switch over from old is_a_ligature() to IS_LIGATED Impact should be minimal and positive. --- src/hb-ot-layout-gsubgpos-private.hh | 2 +- src/hb-ot-layout-private.hh | 12 +++++++++--- src/hb-ot-shape-complex-indic.cc | 4 ++-- src/hb-ot-shape-complex-myanmar.cc | 2 +- src/hb-ot-shape.cc | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 70e0af04a..16c96fafb 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -409,7 +409,7 @@ struct hb_apply_context_t if (unlikely (_hb_glyph_info_is_default_ignorable (&info) && (ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) && (ignore_zwj || !_hb_glyph_info_is_zwj (&info)) && - !_hb_glyph_info_is_ligated (&info))) + !_hb_glyph_info_ligated (&info))) return SKIP_MAYBE; return SKIP_NO; diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index c37117b86..27648c909 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -306,7 +306,7 @@ _hb_glyph_info_get_lig_id (const hb_glyph_info_t *info) } static inline bool -_hb_glyph_info_is_ligated (const hb_glyph_info_t *info) +_hb_glyph_info_ligated_internal (const hb_glyph_info_t *info) { return !!(info->lig_props() & IS_LIG_BASE); } @@ -314,7 +314,7 @@ _hb_glyph_info_is_ligated (const hb_glyph_info_t *info) static inline unsigned int _hb_glyph_info_get_lig_comp (const hb_glyph_info_t *info) { - if (_hb_glyph_info_is_ligated (info)) + if (_hb_glyph_info_ligated_internal (info)) return 0; else return info->lig_props() & 0x0F; @@ -324,7 +324,7 @@ static inline unsigned int _hb_glyph_info_get_lig_num_comps (const hb_glyph_info_t *info) { if ((info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE) && - _hb_glyph_info_is_ligated (info)) + _hb_glyph_info_ligated_internal (info)) return info->lig_props() & 0x0F; else return 1; @@ -370,6 +370,12 @@ _hb_glyph_info_is_mark (const hb_glyph_info_t *info) return !!(info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_MARK); } +static inline bool +_hb_glyph_info_ligated (const hb_glyph_info_t *info) +{ + return !!(info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_LIGATED); +} + /* Allocation / deallocation. */ inline void diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 0835f7dbe..1407adae5 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -141,7 +141,7 @@ static inline bool is_one_of (const hb_glyph_info_t &info, unsigned int flags) { /* If it ligated, all bets are off. */ - if (_hb_glyph_info_is_ligated (&info)) return false; + if (_hb_glyph_info_ligated (&info)) return false; return !!(FLAG (info.indic_category()) & flags); } @@ -1406,7 +1406,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan, if (start + 1 < end && info[start].indic_position() == POS_RA_TO_BECOME_REPH && ((info[start].indic_category() == OT_Repha) ^ - _hb_glyph_info_is_ligated (&info[start]))) + _hb_glyph_info_ligated (&info[start]))) { unsigned int new_reph_pos; reph_position_t reph_pos = indic_plan->config->reph_pos; diff --git a/src/hb-ot-shape-complex-myanmar.cc b/src/hb-ot-shape-complex-myanmar.cc index b5ac10746..a32405a82 100644 --- a/src/hb-ot-shape-complex-myanmar.cc +++ b/src/hb-ot-shape-complex-myanmar.cc @@ -151,7 +151,7 @@ static inline bool is_one_of (const hb_glyph_info_t &info, unsigned int flags) { /* If it ligated, all bets are off. */ - if (_hb_glyph_info_is_ligated (&info)) return false; + if (_hb_glyph_info_ligated (&info)) return false; return !!(FLAG (info.myanmar_category()) & flags); } diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 16e6081d7..02966438b 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -548,7 +548,7 @@ hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c) unsigned int j = 0; for (unsigned int i = 0; i < count; i++) { - if (unlikely (!_hb_glyph_info_is_ligated (&info[i]) && + if (unlikely (!_hb_glyph_info_ligated (&info[i]) && _hb_glyph_info_is_default_ignorable (&info[i]))) { if (space_status == SPACE_DONT_KNOW)