From: Grigori Goronzy Date: Sun, 2 Oct 2011 22:41:53 +0000 (+0200) Subject: Letter spacing is a per-cluster property X-Git-Tag: 0.10.1~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94b4c0d87182cd0bc84cf49cb793a0ab184df502;p=libass Letter spacing is a per-cluster property Layout refactoring broke letter spacing and always used the last valid spacing specified for the whole line, which is of course wrong. Letter-spacing is an inline property and can be different for each glyph cluster. Add that property to GlyphInfo and use it to fix this regression. --- diff --git a/libass/ass_render.c b/libass/ass_render.c index b2bc194..599989b 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -1770,6 +1770,7 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, glyphs[text_info->length].scale_y = render_priv->state.scale_y; glyphs[text_info->length].border_x= render_priv->state.border_x; glyphs[text_info->length].border_y = render_priv->state.border_y; + glyphs[text_info->length].hspacing = render_priv->state.hspacing; glyphs[text_info->length].bold = render_priv->state.bold; glyphs[text_info->length].italic = render_priv->state.italic; glyphs[text_info->length].flags = render_priv->state.flags; @@ -1827,7 +1828,7 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, } // add horizontal letter spacing - info->cluster_advance.x += double_to_d6(render_priv->state.hspacing * + info->cluster_advance.x += double_to_d6(info->hspacing * render_priv->font_scale * info->scale_x); // add displacement for vertical shearing diff --git a/libass/ass_render.h b/libass/ass_render.h index d3c1bbb..c290c4d 100644 --- a/libass/ass_render.h +++ b/libass/ass_render.h @@ -134,6 +134,7 @@ typedef struct glyph_info { double fax, fay; // text shearing double scale_x, scale_y; double border_x, border_y; + double hspacing; unsigned italic; unsigned bold; int flags;