提交 84742315 编写于 作者: B Behdad Esfahbod

[ot] Minor shuffling code around

上级 b0b11614
...@@ -1601,8 +1601,6 @@ fix_mark_attachment (hb_glyph_position_t *pos, unsigned int i, hb_direction_t di ...@@ -1601,8 +1601,6 @@ fix_mark_attachment (hb_glyph_position_t *pos, unsigned int i, hb_direction_t di
void void
GPOS::position_start (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) GPOS::position_start (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer)
{ {
buffer->clear_positions ();
unsigned int count = buffer->len; unsigned int count = buffer->len;
for (unsigned int i = 0; i < count; i++) for (unsigned int i = 0; i < count; i++)
buffer->pos[i].attach_chain() = buffer->pos[i].attach_type() = 0; buffer->pos[i].attach_chain() = buffer->pos[i].attach_type() = 0;
......
...@@ -665,9 +665,12 @@ hb_ot_position_default (hb_ot_shape_context_t *c) ...@@ -665,9 +665,12 @@ hb_ot_position_default (hb_ot_shape_context_t *c)
static inline bool static inline bool
hb_ot_position_complex (hb_ot_shape_context_t *c) hb_ot_position_complex (hb_ot_shape_context_t *c)
{ {
hb_ot_layout_position_start (c->font, c->buffer);
bool ret = false; bool ret = false;
unsigned int count = c->buffer->len; unsigned int count = c->buffer->len;
bool has_positioning = (bool) hb_ot_layout_has_positioning (c->face); bool has_positioning = (bool) hb_ot_layout_has_positioning (c->face);
/* If the font has no GPOS, AND, no fallback positioning will /* If the font has no GPOS, AND, no fallback positioning will
* happen, AND, direction is forward, then when zeroing mark * happen, AND, direction is forward, then when zeroing mark
* widths, we shift the mark with it, such that the mark * widths, we shift the mark with it, such that the mark
...@@ -730,22 +733,22 @@ hb_ot_position_complex (hb_ot_shape_context_t *c) ...@@ -730,22 +733,22 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
break; break;
} }
hb_ot_zero_width_default_ignorables (c);
hb_ot_layout_position_finish (c->font, c->buffer);
return ret; return ret;
} }
static inline void static inline void
hb_ot_position (hb_ot_shape_context_t *c) hb_ot_position (hb_ot_shape_context_t *c)
{ {
hb_ot_layout_position_start (c->font, c->buffer); c->buffer->clear_positions ();
hb_ot_position_default (c); hb_ot_position_default (c);
hb_bool_t fallback = !hb_ot_position_complex (c); hb_bool_t fallback = !hb_ot_position_complex (c);
hb_ot_zero_width_default_ignorables (c);
hb_ot_layout_position_finish (c->font, c->buffer);
if (fallback && c->plan->shaper->fallback_position) if (fallback && c->plan->shaper->fallback_position)
_hb_ot_shape_fallback_position (c->plan, c->font, c->buffer); _hb_ot_shape_fallback_position (c->plan, c->font, c->buffer);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册