Switch Pango to new, defunt, GPOS

This commit is contained in:
Behdad Esfahbod 2009-05-18 17:43:49 -04:00
parent 5e5eb0573f
commit 9c42f05a5c
3 changed files with 32 additions and 6 deletions

View File

@ -843,16 +843,24 @@ struct PosLookup : Lookup {
if (HB_UNLIKELY (!buffer->in_length))
return false;
_hb_buffer_clear_positions (buffer);
layout->gpos_info.last = 0xFFFF; /* no last valid glyph for cursive pos. */
buffer->in_pos = 0;
while (buffer->in_pos < buffer->in_length) {
if ((~IN_PROPERTIES (buffer->in_pos) & mask) &&
position_once (layout, buffer))
ret = true;
else
_hb_buffer_next_glyph (buffer);
bool done;
if (~IN_PROPERTIES (buffer->in_pos) & mask) {
done = position_once (layout, buffer);
ret |= done;
} else {
done = false;
/* Contrary to properties defined in GDEF, user-defined properties
will always stop a possible cursive positioning. */
layout->gpos_info.last = 0xFFFF;
}
if (!done)
buffer->in_pos++;
}
return ret;

View File

@ -531,6 +531,19 @@ hb_ot_layout_substitute_lookup (hb_ot_layout_t *layout,
return layout->gsub->substitute_lookup (layout, buffer, lookup_index, mask);
}
/*
* GPOS
*/
hb_bool_t
hb_ot_layout_position_lookup (hb_ot_layout_t *layout,
hb_buffer_t *buffer,
unsigned int lookup_index,
hb_ot_layout_feature_mask_t mask)
{
return layout->gpos->position_lookup (layout, buffer, lookup_index, mask);
}
/* TODO dupped, until he old code can be removed */

View File

@ -207,6 +207,11 @@ hb_ot_layout_substitute_lookup (hb_ot_layout_t *layout,
unsigned int lookup_index,
hb_ot_layout_feature_mask_t mask);
hb_bool_t
hb_ot_layout_position_lookup (hb_ot_layout_t *layout,
hb_buffer_t *buffer,
unsigned int lookup_index,
hb_ot_layout_feature_mask_t mask);