mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 08:42:59 +00:00
[aat] Towards removing special deleting of 0xFFFF
See https://github.com/harfbuzz/harfbuzz/discussions/5118 Remove the removal. Depend on the default_ignorable flag to hide them later. Test output adjusted.
This commit is contained in:
parent
ec4d4b01e8
commit
c6972ac6dd
4 changed files with 2 additions and 38 deletions
|
@ -589,6 +589,7 @@ struct LigatureSubtable
|
|||
{
|
||||
DEBUG_MSG (APPLY, nullptr, "Skipping ligature component");
|
||||
if (unlikely (!buffer->move_to (match_positions[--match_length % ARRAY_LENGTH (match_positions)]))) return;
|
||||
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES;
|
||||
_hb_glyph_info_set_default_ignorable (&buffer->cur());
|
||||
if (unlikely (!buffer->replace_glyph (DELETED_GLYPH))) return;
|
||||
}
|
||||
|
|
|
@ -320,29 +320,6 @@ hb_aat_layout_substitute (const hb_ot_shape_plan_t *plan,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
hb_aat_layout_zero_width_deleted_glyphs (hb_buffer_t *buffer)
|
||||
{
|
||||
unsigned int count = buffer->len;
|
||||
hb_glyph_info_t *info = buffer->info;
|
||||
hb_glyph_position_t *pos = buffer->pos;
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
if (unlikely (info[i].codepoint == AAT::DELETED_GLYPH))
|
||||
pos[i].x_advance = pos[i].y_advance = pos[i].x_offset = pos[i].y_offset = 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
is_deleted_glyph (const hb_glyph_info_t *info)
|
||||
{
|
||||
return info->codepoint == AAT::DELETED_GLYPH;
|
||||
}
|
||||
|
||||
void
|
||||
hb_aat_layout_remove_deleted_glyphs (hb_buffer_t *buffer)
|
||||
{
|
||||
buffer->delete_glyphs_inplace (is_deleted_glyph);
|
||||
}
|
||||
|
||||
/**
|
||||
* hb_aat_layout_has_positioning:
|
||||
* @face: #hb_face_t to work upon
|
||||
|
|
|
@ -956,21 +956,11 @@ hb_ot_substitute_pre (const hb_ot_shape_context_t *c)
|
|||
_hb_buffer_allocate_gsubgpos_vars (c->buffer);
|
||||
|
||||
hb_ot_substitute_plan (c);
|
||||
|
||||
#ifndef HB_NO_AAT_SHAPE
|
||||
if (c->plan->apply_morx && c->plan->apply_gpos)
|
||||
hb_aat_layout_remove_deleted_glyphs (c->buffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
hb_ot_substitute_post (const hb_ot_shape_context_t *c)
|
||||
{
|
||||
#ifndef HB_NO_AAT_SHAPE
|
||||
if (c->plan->apply_morx && !c->plan->apply_gpos)
|
||||
hb_aat_layout_remove_deleted_glyphs (c->buffer);
|
||||
#endif
|
||||
|
||||
hb_ot_deal_with_variation_selectors (c->buffer);
|
||||
hb_ot_hide_default_ignorables (c->buffer, c->font);
|
||||
|
||||
|
@ -1109,10 +1099,6 @@ hb_ot_position_plan (const hb_ot_shape_context_t *c)
|
|||
/* Finish off. Has to follow a certain order. */
|
||||
hb_ot_layout_position_finish_advances (c->font, c->buffer);
|
||||
hb_ot_zero_width_default_ignorables (c->buffer);
|
||||
#ifndef HB_NO_AAT_SHAPE
|
||||
if (c->plan->apply_morx)
|
||||
hb_aat_layout_zero_width_deleted_glyphs (c->buffer);
|
||||
#endif
|
||||
hb_ot_layout_position_finish_offsets (c->font, c->buffer);
|
||||
|
||||
/* The nil glyph_h_origin() func returns 0, so no need to apply it. */
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
../fonts/MORXTwentyeight.ttf;;U+0041,U+0078,U+0045,U+0079,U+0044,U+0079,U+0079;[A_E_D=0+1394|x=0+529|y=0+510|y=5+510|y=6+510]
|
||||
../fonts/MORXTwentyeight.ttf;;U+0041,U+0078,U+0045,U+0079,U+0044,U+0079,U+0079;[A_E_D=0+1394|x=0+529|space=0+0|y=0+510|space=0+0|y=5+510|y=6+510]
|
||||
../fonts/e6185e88b04432fbf373594d5971686bb7dd698d.ttf;;U+0B95,U+0BCD,U+0020,U+0B9A,U+0BCD;[ka-tamil=0+825|pulli-tamil=0@-392,0+0|space=2+260|ca-tamil=3+723|pulli-tamil=3@-320,0+0]
|
||||
|
|
Loading…
Add table
Reference in a new issue