Add default positioning to hb-shape
This commit is contained in:
parent
c3f9f7e59d
commit
2027f74b28
|
@ -38,7 +38,7 @@ is_variation_selector (hb_codepoint_t unicode)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
map_glyphs (hb_font_t *font,
|
hb_map_glyphs (hb_font_t *font,
|
||||||
hb_face_t *face,
|
hb_face_t *face,
|
||||||
hb_buffer_t *buffer)
|
hb_buffer_t *buffer)
|
||||||
{
|
{
|
||||||
|
@ -57,6 +57,25 @@ map_glyphs (hb_font_t *font,
|
||||||
IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), 0);
|
IN_CURGLYPH() = hb_font_get_glyph (font, face, IN_CURGLYPH(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
hb_position_default (hb_font_t *font,
|
||||||
|
hb_face_t *face,
|
||||||
|
hb_buffer_t *buffer)
|
||||||
|
{
|
||||||
|
unsigned int count;
|
||||||
|
|
||||||
|
hb_buffer_clear_positions (buffer);
|
||||||
|
|
||||||
|
count = buffer->in_length;
|
||||||
|
|
||||||
|
for (buffer->in_pos = 0; buffer->in_pos < count; buffer->in_pos++) {
|
||||||
|
hb_glyph_metrics_t metrics;
|
||||||
|
hb_font_get_glyph_metrics (font, face, IN_CURGLYPH(), &metrics);
|
||||||
|
CURPOSITION()->x_advance = metrics.x_advance;
|
||||||
|
CURPOSITION()->y_advance = metrics.y_advance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
hb_shape (hb_font_t *font,
|
hb_shape (hb_font_t *font,
|
||||||
|
@ -70,9 +89,10 @@ hb_shape (hb_font_t *font,
|
||||||
/* natural direction analysis */
|
/* natural direction analysis */
|
||||||
/* OT preprocess */
|
/* OT preprocess */
|
||||||
|
|
||||||
map_glyphs (font, face, buffer);
|
hb_map_glyphs (font, face, buffer);
|
||||||
|
|
||||||
/* GSUB */
|
/* GSUB */
|
||||||
|
hb_position_default (font, face, buffer);
|
||||||
/* Default positioning */
|
/* Default positioning */
|
||||||
/* GPOS / kern */
|
/* GPOS / kern */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue