summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2011-08-06 20:06:54 +0200
committerGrigori Goronzy <greg@blackbox>2011-08-06 20:23:39 +0200
commit37fe952c045963c8c86bc630b6a673df9d728dcc (patch)
tree3d3ae36234a3d1c58113dbe52f8cc71151131e2b
parente527cf4a95032b85f3753e9d2314ea0076866fd0 (diff)
downloadlibass-37fe952c045963c8c86bc630b6a673df9d728dcc.tar.bz2
libass-37fe952c045963c8c86bc630b6a673df9d728dcc.tar.xz
Adjust italic to non-italic style spacing
Previously, the space added was quite a lot, since it was calculated so that it would be enough to accommodate a heavily FreeType-slanted glyph in the worst case. In many cases this was too much spacing, especially if the italic font was only slightly angled. The new fix simply ensures that the glyph is inside the bounds of the advance.
-rw-r--r--libass/ass_render.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 8d55667..719b8bd 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1859,10 +1859,8 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event,
while (back && og->bbox.xMax - og->bbox.xMin == 0
&& og->italic)
og = &glyphs[--back];
- if (og->bbox.xMax > og->cluster_advance.x) {
- // The FreeType oblique slants by 6/16
- og->cluster_advance.x += og->bbox.yMax * 0.375;
- }
+ if (og->bbox.xMax > og->cluster_advance.x)
+ og->cluster_advance.x = og->bbox.xMax;
}
// add horizontal letter spacing