Minor refactoring
This commit is contained in:
parent
127daf15e0
commit
d785fa0c45
|
@ -400,6 +400,30 @@ hb_ot_substitute (hb_ot_shape_context_t *c)
|
||||||
|
|
||||||
/* Position */
|
/* Position */
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
zero_mark_widths_by_unicode (hb_buffer_t *buffer)
|
||||||
|
{
|
||||||
|
unsigned int count = buffer->len;
|
||||||
|
for (unsigned int i = 0; i < count; i++)
|
||||||
|
if (_hb_glyph_info_get_general_category (&buffer->info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
|
||||||
|
{
|
||||||
|
buffer->pos[i].x_advance = 0;
|
||||||
|
buffer->pos[i].y_advance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
zero_mark_widths_by_gdef (hb_buffer_t *buffer)
|
||||||
|
{
|
||||||
|
unsigned int count = buffer->len;
|
||||||
|
for (unsigned int i = 0; i < count; i++)
|
||||||
|
if ((buffer->info[i].glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_MARK))
|
||||||
|
{
|
||||||
|
buffer->pos[i].x_advance = 0;
|
||||||
|
buffer->pos[i].y_advance = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
hb_ot_position_default (hb_ot_shape_context_t *c)
|
hb_ot_position_default (hb_ot_shape_context_t *c)
|
||||||
{
|
{
|
||||||
|
@ -421,25 +445,13 @@ hb_ot_position_default (hb_ot_shape_context_t *c)
|
||||||
|
|
||||||
switch (c->plan->shaper->zero_width_marks)
|
switch (c->plan->shaper->zero_width_marks)
|
||||||
{
|
{
|
||||||
/* Zero'ing mark widths by GDEF (as used in Myanmar spec) may happen
|
|
||||||
* *before* GPOS. */
|
|
||||||
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY:
|
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_EARLY:
|
||||||
for (unsigned int i = 0; i < count; i++)
|
zero_mark_widths_by_gdef (c->buffer);
|
||||||
if ((c->buffer->info[i].glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_MARK))
|
|
||||||
{
|
|
||||||
c->buffer->pos[i].x_advance = 0;
|
|
||||||
c->buffer->pos[i].y_advance = 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Not currently used for any shaper:
|
/* Not currently used for any shaper:
|
||||||
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_EARLY:
|
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_EARLY:
|
||||||
for (unsigned int i = 0; i < count; i++)
|
zero_mark_widths_by_unicode (c->buffer);
|
||||||
if (_hb_glyph_info_get_general_category (&c->buffer->info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
|
|
||||||
{
|
|
||||||
c->buffer->pos[i].x_advance = 0;
|
|
||||||
c->buffer->pos[i].y_advance = 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -483,21 +495,11 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
|
||||||
switch (c->plan->shaper->zero_width_marks)
|
switch (c->plan->shaper->zero_width_marks)
|
||||||
{
|
{
|
||||||
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_LATE:
|
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_UNICODE_LATE:
|
||||||
for (unsigned int i = 0; i < count; i++)
|
zero_mark_widths_by_unicode (c->buffer);
|
||||||
if (_hb_glyph_info_get_general_category (&c->buffer->info[i]) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)
|
|
||||||
{
|
|
||||||
c->buffer->pos[i].x_advance = 0;
|
|
||||||
c->buffer->pos[i].y_advance = 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE:
|
case HB_OT_SHAPE_ZERO_WIDTH_MARKS_BY_GDEF_LATE:
|
||||||
for (unsigned int i = 0; i < count; i++)
|
zero_mark_widths_by_gdef (c->buffer);
|
||||||
if ((c->buffer->info[i].glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_MARK))
|
|
||||||
{
|
|
||||||
c->buffer->pos[i].x_advance = 0;
|
|
||||||
c->buffer->pos[i].y_advance = 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue