summaryrefslogtreecommitdiffstats
path: root/libass/ass_parse.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2010-08-12 22:15:10 +0200
committerGrigori Goronzy <greg@blackbox>2010-08-12 22:23:01 +0200
commit4d64333a58be5e57834fad576de23f95612a2604 (patch)
tree7464739ec393bcd09cbac23f8bbedd888934502a /libass/ass_parse.c
parenta3d0b507bd1bb18067de7b948f5371197dc142b9 (diff)
downloadlibass-4d64333a58be5e57834fad576de23f95612a2604.tar.bz2
libass-4d64333a58be5e57834fad576de23f95612a2604.tar.xz
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.
Diffstat (limited to 'libass/ass_parse.c')
-rw-r--r--libass/ass_parse.c16
1 files changed, 16 insertions, 0 deletions
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))