Use buffer scratch_flags to remember if we had any joiners
This commit is contained in:
parent
ba0f0f156f
commit
bd07d2878f
|
@ -68,7 +68,8 @@ enum hb_buffer_scratch_flags_t {
|
||||||
HB_BUFFER_SCRATCH_FLAG_HAS_SPACE_FALLBACK = 0x00000004u,
|
HB_BUFFER_SCRATCH_FLAG_HAS_SPACE_FALLBACK = 0x00000004u,
|
||||||
HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT = 0x00000008u,
|
HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT = 0x00000008u,
|
||||||
HB_BUFFER_SCRATCH_FLAG_HAS_UNSAFE_TO_BREAK = 0x00000010u,
|
HB_BUFFER_SCRATCH_FLAG_HAS_UNSAFE_TO_BREAK = 0x00000010u,
|
||||||
HB_BUFFER_SCRATCH_FLAG_HAS_CGJ = 0x00000020u,
|
HB_BUFFER_SCRATCH_FLAG_HAS_JOINERS = 0x00000020u,
|
||||||
|
HB_BUFFER_SCRATCH_FLAG_HAS_CGJ = 0x00000040u,
|
||||||
|
|
||||||
/* Reserved for complex shapers' internal use. */
|
/* Reserved for complex shapers' internal use. */
|
||||||
HB_BUFFER_SCRATCH_FLAG_COMPLEX0 = 0x01000000u,
|
HB_BUFFER_SCRATCH_FLAG_COMPLEX0 = 0x01000000u,
|
||||||
|
|
|
@ -224,8 +224,16 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
|
||||||
{
|
{
|
||||||
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES;
|
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES;
|
||||||
props |= UPROPS_MASK_IGNORABLE;
|
props |= UPROPS_MASK_IGNORABLE;
|
||||||
if (u == 0x200Cu) props |= UPROPS_MASK_Cf_ZWNJ;
|
if (u == 0x200Cu)
|
||||||
else if (u == 0x200Du) props |= UPROPS_MASK_Cf_ZWJ;
|
{
|
||||||
|
props |= UPROPS_MASK_Cf_ZWNJ;
|
||||||
|
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_JOINERS;
|
||||||
|
}
|
||||||
|
else if (u == 0x200Du)
|
||||||
|
{
|
||||||
|
props |= UPROPS_MASK_Cf_ZWJ;
|
||||||
|
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_JOINERS;
|
||||||
|
}
|
||||||
/* Mongolian Free Variation Selectors need to be remembered
|
/* Mongolian Free Variation Selectors need to be remembered
|
||||||
* because although we need to hide them like default-ignorables,
|
* because although we need to hide them like default-ignorables,
|
||||||
* they need to non-ignorable during shaping. This is similar to
|
* they need to non-ignorable during shaping. This is similar to
|
||||||
|
|
|
@ -399,6 +399,9 @@ flip_joiners (const hb_ot_shape_plan_t *plan HB_UNUSED,
|
||||||
hb_font_t *font HB_UNUSED,
|
hb_font_t *font HB_UNUSED,
|
||||||
hb_buffer_t *buffer)
|
hb_buffer_t *buffer)
|
||||||
{
|
{
|
||||||
|
if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_JOINERS))
|
||||||
|
return;
|
||||||
|
|
||||||
unsigned int count = buffer->len;
|
unsigned int count = buffer->len;
|
||||||
hb_glyph_info_t *info = buffer->info;
|
hb_glyph_info_t *info = buffer->info;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
|
|
Loading…
Reference in New Issue