From: Grigori Goronzy Date: Thu, 12 Aug 2010 20:15:10 +0000 (+0200) Subject: Add support for \fs+ and \fs- syntax X-Git-Tag: 0.9.12~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d64333a58be5e57834fad576de23f95612a2604;p=libass 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. --- 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))