]> granicus.if.org Git - libass/commitdiff
Adjust italic to non-italic style spacing
authorGrigori Goronzy <greg@blackbox>
Sat, 6 Aug 2011 18:06:54 +0000 (20:06 +0200)
committerGrigori Goronzy <greg@blackbox>
Sat, 6 Aug 2011 18:23:39 +0000 (20:23 +0200)
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.

libass/ass_render.c

index 8d55667018db8c6abc8293b75116e550d3de0246..719b8bdbdeca918d75abaf73d2939abb47da0dec 100644 (file)
@@ -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