diff options
author | Grigori Goronzy <greg@blackbox> | 2011-07-10 04:08:55 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2011-07-11 13:05:02 +0200 |
commit | 4805334bf91444ba7e818145944f8236a64b0563 (patch) | |
tree | c20374d43fc1e3e5e238dd2952ed2307f4a0c881 /libass/ass_render.c | |
parent | e1b63bc3abfac4d1e994cbe46a4d3f820062b880 (diff) | |
download | libass-4805334bf91444ba7e818145944f8236a64b0563.tar.bz2 libass-4805334bf91444ba7e818145944f8236a64b0563.tar.xz |
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.
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r-- | libass/ass_render.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); |