From b6fe0ab636ffac0a246e160b3508cc4841cb1823 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 4 Oct 2017 13:37:08 +0200 Subject: [PATCH] Add info_cc() convenience macro --- src/hb-ot-layout-private.hh | 2 ++ src/hb-ot-shape-normalize.cc | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index d4ac60b06..6717adeb9 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -347,6 +347,8 @@ _hb_glyph_info_get_modified_combining_class (const hb_glyph_info_t *info) return _hb_glyph_info_is_unicode_mark (info) ? info->unicode_props()>>8 : 0; } +#define info_cc(info) (_hb_glyph_info_get_modified_combining_class (&(info))) + static inline bool _hb_glyph_info_is_unicode_space (const hb_glyph_info_t *info) { diff --git a/src/hb-ot-shape-normalize.cc b/src/hb-ot-shape-normalize.cc index 63f1d2d33..a5144888a 100644 --- a/src/hb-ot-shape-normalize.cc +++ b/src/hb-ot-shape-normalize.cc @@ -384,7 +384,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan, if (/* If there's anything between the starter and this char, they should have CCC * smaller than this character's. */ (starter == buffer->out_len - 1 || - _hb_glyph_info_get_modified_combining_class (&buffer->prev()) < _hb_glyph_info_get_modified_combining_class (&buffer->cur())) && + info_cc (buffer->prev()) < info_cc (buffer->cur())) && /* And compose. */ c.compose (&c, buffer->out_info[starter].codepoint, @@ -409,14 +409,14 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan, else if (/* We sometimes custom-tailor the sorted order of marks. In that case, stop * trying to combine as soon as combining-class drops. */ starter < buffer->out_len - 1 && - _hb_glyph_info_get_modified_combining_class (&buffer->prev()) > _hb_glyph_info_get_modified_combining_class (&buffer->cur())) + info_cc (buffer->prev()) > info_cc (buffer->cur())) combine = false; } /* Blocked, or doesn't compose. */ buffer->next_glyph (); - if (_hb_glyph_info_get_modified_combining_class (&buffer->prev()) == 0) + if (info_cc (buffer->prev()) == 0) { starter = buffer->out_len - 1; combine = true;