Refactor _hb_glyph_info_is_default_ignorable()
This commit is contained in:
parent
f0010dfd01
commit
4ba796b26e
|
@ -328,8 +328,7 @@ struct hb_apply_context_t
|
||||||
|
|
||||||
if (unlikely (_hb_glyph_info_is_default_ignorable (&info) &&
|
if (unlikely (_hb_glyph_info_is_default_ignorable (&info) &&
|
||||||
(ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) &&
|
(ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) &&
|
||||||
(ignore_zwj || !_hb_glyph_info_is_zwj (&info)) &&
|
(ignore_zwj || !_hb_glyph_info_is_zwj (&info))))
|
||||||
!_hb_glyph_info_ligated (&info)))
|
|
||||||
return SKIP_MAYBE;
|
return SKIP_MAYBE;
|
||||||
|
|
||||||
return SKIP_NO;
|
return SKIP_NO;
|
||||||
|
|
|
@ -225,10 +225,12 @@ _hb_glyph_info_get_modified_combining_class (const hb_glyph_info_t *info)
|
||||||
return info->unicode_props1();
|
return info->unicode_props1();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool _hb_glyph_info_ligated (const hb_glyph_info_t *info);
|
||||||
|
|
||||||
static inline hb_bool_t
|
static inline hb_bool_t
|
||||||
_hb_glyph_info_is_default_ignorable (const hb_glyph_info_t *info)
|
_hb_glyph_info_is_default_ignorable (const hb_glyph_info_t *info)
|
||||||
{
|
{
|
||||||
return !!(info->unicode_props0() & MASK0_IGNORABLE);
|
return (info->unicode_props0() & MASK0_IGNORABLE) && !_hb_glyph_info_ligated (info);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline hb_bool_t
|
static inline hb_bool_t
|
||||||
|
|
|
@ -426,8 +426,7 @@ hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c)
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
if (unlikely (!_hb_glyph_info_ligated (&info[i]) &&
|
if (unlikely (_hb_glyph_info_is_default_ignorable (&info[i])))
|
||||||
_hb_glyph_info_is_default_ignorable (&info[i])))
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,8 +440,7 @@ hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c)
|
||||||
/* Replace default-ignorables with a zero-advance space glyph. */
|
/* Replace default-ignorables with a zero-advance space glyph. */
|
||||||
for (/*continue*/; i < count; i++)
|
for (/*continue*/; i < count; i++)
|
||||||
{
|
{
|
||||||
if (!_hb_glyph_info_ligated (&info[i]) &&
|
if (_hb_glyph_info_is_default_ignorable (&info[i]))
|
||||||
_hb_glyph_info_is_default_ignorable (&info[i]))
|
|
||||||
{
|
{
|
||||||
info[i].codepoint = space;
|
info[i].codepoint = space;
|
||||||
pos[i].x_advance = pos[i].y_advance = pos[i].x_offset = pos[i].y_offset = 0;
|
pos[i].x_advance = pos[i].y_advance = pos[i].x_offset = pos[i].y_offset = 0;
|
||||||
|
@ -457,8 +455,7 @@ hb_ot_hide_default_ignorables (hb_ot_shape_context_t *c)
|
||||||
buffer->next_glyphs (i);
|
buffer->next_glyphs (i);
|
||||||
while (buffer->idx < buffer->len)
|
while (buffer->idx < buffer->len)
|
||||||
{
|
{
|
||||||
if (!_hb_glyph_info_ligated (&info[buffer->idx]) &&
|
if (_hb_glyph_info_is_default_ignorable (&info[buffer->idx]))
|
||||||
_hb_glyph_info_is_default_ignorable (&info[buffer->idx]))
|
|
||||||
{
|
{
|
||||||
buffer->delete_glyph ();
|
buffer->delete_glyph ();
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue