[otlayout] Switch over from old is_a_ligature() to IS_LIGATED

Impact should be minimal and positive.
This commit is contained in:
Behdad Esfahbod 2013-10-18 01:09:08 +02:00
parent 09675a8115
commit a1f7b28561
5 changed files with 14 additions and 8 deletions

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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);
}

View File

@ -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)