Prefer _hb_glyph_info_is_unicode_mark where possible.

This commit is contained in:
Evgeniy Reizner 2019-12-13 07:25:34 +02:00 committed by Ebrahim Byagowi
parent 3e1a2632dc
commit 34ed8e7218
2 changed files with 6 additions and 6 deletions

View File

@ -422,12 +422,12 @@ position_cluster (const hb_ot_shape_plan_t *plan,
/* Find the base glyph */
hb_glyph_info_t *info = buffer->info;
for (unsigned int i = start; i < end; i++)
if (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i])))
if (!_hb_glyph_info_is_unicode_mark (&info[i]))
{
/* Find mark glyphs */
unsigned int j;
for (j = i + 1; j < end; j++)
if (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[j])))
if (!_hb_glyph_info_is_unicode_mark (&info[j]))
break;
position_around_base (plan, font, buffer, i, j, adjust_offsets_when_zeroing);
@ -452,7 +452,7 @@ _hb_ot_shape_fallback_mark_position (const hb_ot_shape_plan_t *plan,
unsigned int count = buffer->len;
hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 1; i < count; i++)
if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i])))) {
if (likely (!_hb_glyph_info_is_unicode_mark (&info[i]))) {
position_cluster (plan, font, buffer, start, i, adjust_offsets_when_zeroing);
start = i;
}

View File

@ -334,7 +334,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
{
unsigned int end;
for (end = buffer->idx + 1; end < count; end++)
if (unlikely (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[end]))))
if (unlikely (_hb_glyph_info_is_unicode_mark (&buffer->info[end])))
break;
if (end < count)
@ -360,7 +360,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
/* Find all the marks now. */
for (end = buffer->idx + 1; end < count; end++)
if (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[end])))
if (!_hb_glyph_info_is_unicode_mark(&buffer->info[end]))
break;
/* idx to end is one non-simple cluster. */
@ -435,7 +435,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
* This is both an optimization to avoid trying to compose every two neighboring
* glyphs in most scripts AND a desired feature for Hangul. Apparently Hangul
* fonts are not designed to mix-and-match pre-composed syllables and Jamo. */
HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->cur())))
_hb_glyph_info_is_unicode_mark(&buffer->cur()))
{
if (/* If there's anything between the starter and this char, they should have CCC
* smaller than this character's. */