summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2011-10-03 00:41:53 +0200
committerGrigori Goronzy <greg@blackbox>2011-10-03 00:41:53 +0200
commit94b4c0d87182cd0bc84cf49cb793a0ab184df502 (patch)
tree6d4deee2b144397594b9c9188f7fc5c44bd7d086
parent8d7a663a81be35cb1eaf89264a24394786e0a264 (diff)
downloadlibass-94b4c0d87182cd0bc84cf49cb793a0ab184df502.tar.bz2
libass-94b4c0d87182cd0bc84cf49cb793a0ab184df502.tar.xz
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.
-rw-r--r--libass/ass_render.c3
-rw-r--r--libass/ass_render.h1
2 files changed, 3 insertions, 1 deletions
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;