From 4d64333a58be5e57834fad576de23f95612a2604 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Thu, 12 Aug 2010 22:15:10 +0200 Subject: Add support for \fs+ and \fs- syntax These forms can be used to add or subtract a value from the current font size instead of setting a new font size. Animations are supported, but not recommended, as they won't be fluid due to grid-fitting/hinting. --- libass/ass_parse.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libass/ass_parse.c b/libass/ass_parse.c index 776416d..40aaf04 100644 --- a/libass/ass_parse.c +++ b/libass/ass_parse.c @@ -359,6 +359,22 @@ static char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr) render_priv->state.hspacing * (1 - pwr) + val * pwr; else render_priv->state.hspacing = render_priv->state.style->Spacing; + } else if (mystrcmp(&p, "fs+")) { + double val; + if (mystrtod(&p, &val)) { + val = render_priv->state.font_size + pwr * val; + } else + val = render_priv->state.style->FontSize; + if (render_priv->state.font) + change_font_size(render_priv, val); + } else if (mystrcmp(&p, "fs-")) { + double val; + if (mystrtod(&p, &val)) + val = render_priv->state.font_size - pwr * val; + else + val = render_priv->state.style->FontSize; + if (render_priv->state.font) + change_font_size(render_priv, val); } else if (mystrcmp(&p, "fs")) { double val; if (mystrtod(&p, &val)) -- cgit v1.2.3