Add fallback shaper

This commit is contained in:
Behdad Esfahbod 2011-08-09 11:37:46 +02:00
parent 13a601fe99
commit 1b8196c986
1 changed files with 21 additions and 2 deletions

View File

@ -37,7 +37,26 @@ hb_fallback_shape (hb_font_t *font,
{
buffer->guess_properties ();
unsigned int count = buffer->len;
for (unsigned int i = 0; i < count; i++)
hb_font_get_glyph (font, buffer->info[i].codepoint, 0, &buffer->info[i].codepoint);
buffer->clear_positions ();
for (unsigned int i = 0; i < count; i++) {
hb_font_get_glyph_advance_for_direction (font, buffer->info[i].codepoint,
buffer->props.direction,
&buffer->pos[i].x_advance,
&buffer->pos[i].y_advance);
hb_font_subtract_glyph_origin_for_direction (font, buffer->info[i].codepoint,
buffer->props.direction,
&buffer->pos[i].x_offset,
&buffer->pos[i].y_offset);
}
if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction))
hb_buffer_reverse (buffer);
return TRUE;
}