diff options
author | Grigori Goronzy <greg@blackbox> | 2011-07-13 22:03:57 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2011-07-13 22:03:57 +0200 |
commit | 37fe4177a7220f69883fd56bf78a10b5b2ff0f8a (patch) | |
tree | 45adc6a97dac41df8e1db62facbb09ef6280539d /libass/ass_render.c | |
parent | 867739ba1b40a035471d2c5e6208d96420cfed95 (diff) | |
download | libass-37fe4177a7220f69883fd56bf78a10b5b2ff0f8a.tar.bz2 libass-37fe4177a7220f69883fd56bf78a10b5b2ff0f8a.tar.xz |
Fix layout with fsp/fay features enabled
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r-- | libass/ass_render.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c index 3c8fcb6..81dadb9 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1849,13 +1849,12 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, } info = glyphs + i; - // add displacement for vertical shearing - info->cluster_advance.y += (info->fay * info->scale_y) * info->cluster_advance.x; - // add horizontal letter spacing info->cluster_advance.x += double_to_d6(render_priv->state.hspacing * render_priv->font_scale * info->scale_x); + // add displacement for vertical shearing + info->cluster_advance.y += (info->fay * info->scale_y) * info->cluster_advance.x; } // Preliminary layout (for line wrapping) @@ -1969,6 +1968,10 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, double width = 0; for (i = 0; i <= text_info->length; ++i) { // (text_info->length + 1) is the end of the last line if ((i == text_info->length) || glyphs[i].linebreak) { + // remove letter spacing (which is included in cluster_advance) + if (i > 0) + width -= render_priv->state.hspacing * render_priv->font_scale * + glyphs[i-1].scale_x; double shift = 0; if (halign == HALIGN_LEFT) { // left aligned, no action shift = 0; |