From 4805334bf91444ba7e818145944f8236a64b0563 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Sun, 10 Jul 2011 04:08:55 +0200 Subject: Separate glyph font face matching and glyph loading Split up ass_font_get_glyph into two functions: one function matches checks the fonts for support of the requested codepoint and returns a face_index and glyph_index to later load the glyph, with a second function. This approach is very useful for shaping, which needs to be done on runs with the same font face and font size and changes the glyph_index. --- libass/ass_render.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libass/ass_render.c') diff --git a/libass/ass_render.c b/libass/ass_render.c index b418bb1..3aaf943 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1106,13 +1106,17 @@ get_outline_glyph(ASS_Renderer *render_priv, GlyphInfo *info) } else { double size_scaled = ensure_font_size(render_priv, info->font_size * render_priv->font_scale); + int face_index = 0; + int index = 0; ass_font_set_size(info->font, size_scaled); ass_font_set_transform(info->font, info->scale_x, info->scale_y, NULL); + ass_font_get_index(render_priv->fontconfig_priv, info->font, + info->symbol, &face_index, &index); FT_Glyph glyph = ass_font_get_glyph(render_priv->fontconfig_priv, info->font, - info->symbol, render_priv->settings.hinting, - info->flags); + info->symbol, face_index, index, + render_priv->settings.hinting, info->flags); if (glyph != NULL) { outline_copy(render_priv->ftlibrary, &((FT_OutlineGlyph)glyph)->outline, &info->outline); -- cgit v1.2.3