Refactor common macro
This commit is contained in:
parent
07cfbe21b5
commit
028a1706f8
|
@ -349,10 +349,7 @@ position_cluster (const hb_ot_shape_plan_t *plan,
|
|||
/* Find the base glyph */
|
||||
for (unsigned int i = start; i < end; i++)
|
||||
if (is_a_ligature (buffer->info[i]) ||
|
||||
!(FLAG (_hb_glyph_info_get_general_category (&buffer->info[i])) &
|
||||
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) |
|
||||
FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
|
||||
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))))
|
||||
!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[i])))
|
||||
{
|
||||
position_around_base (plan, font, buffer, i, end);
|
||||
break;
|
||||
|
|
|
@ -130,10 +130,7 @@ compose_func (hb_unicode_funcs_t *unicode,
|
|||
hb_codepoint_t *ab)
|
||||
{
|
||||
/* XXX, this belongs to indic normalizer. */
|
||||
if ((FLAG (unicode->general_category (a)) &
|
||||
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) |
|
||||
FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
|
||||
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK))))
|
||||
if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (unicode->general_category (a)))
|
||||
return false;
|
||||
/* XXX, add composition-exclusion exceptions to Indic shaper. */
|
||||
if (a == 0x09AF && b == 0x09BC) { *ab = 0x09DF; return true; }
|
||||
|
|
|
@ -270,10 +270,7 @@ hb_form_clusters (hb_buffer_t *buffer)
|
|||
{
|
||||
unsigned int count = buffer->len;
|
||||
for (unsigned int i = 1; i < count; i++)
|
||||
if (FLAG (_hb_glyph_info_get_general_category (&buffer->info[i])) &
|
||||
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) |
|
||||
FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) |
|
||||
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
|
||||
if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&buffer->info[i])))
|
||||
buffer->merge_clusters (i - 1, i + 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -268,4 +268,13 @@ extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
|
|||
#define HB_MODIFIED_COMBINING_CLASS_CCC132 132 /* sign u */
|
||||
|
||||
|
||||
/* Misc */
|
||||
|
||||
#define HB_UNICODE_GENERAL_CATEGORY_IS_MARK(gen_cat) \
|
||||
(FLAG (gen_cat) & \
|
||||
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
|
||||
FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
|
||||
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
|
||||
|
||||
|
||||
#endif /* HB_UNICODE_PRIVATE_HH */
|
||||
|
|
Loading…
Reference in New Issue