summaryrefslogtreecommitdiffstats
path: root/libass/ass_parse.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2011-07-04 15:19:40 +0200
committerGrigori Goronzy <greg@blackbox>2011-07-04 15:19:40 +0200
commitf905a38536ad32f7a68ab86db736495fc06810b2 (patch)
treec779db060f86e257040fba61f9abe33c82c00dcb /libass/ass_parse.c
parent910728cb031f59fc0c5972e3b5c7cf2615a1c319 (diff)
downloadlibass-f905a38536ad32f7a68ab86db736495fc06810b2.tar.bz2
libass-f905a38536ad32f7a68ab86db736495fc06810b2.tar.xz
Separate event parsing and layout
Split up the combined event parsing and layout loop into two passes. State information needed for layout are duplicated in GlyphInfo structures.
Diffstat (limited to 'libass/ass_parse.c')
-rw-r--r--libass/ass_parse.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c
index a0181bd..afa0019 100644
--- a/libass/ass_parse.c
+++ b/libass/ass_parse.c
@@ -47,17 +47,18 @@ static inline int mystrcmp(char **p, const char *sample)
return 0;
}
-static void change_font_size(ASS_Renderer *render_priv, double sz)
+double ensure_font_size(ASS_Renderer *priv, double size)
{
- double size = sz * render_priv->font_scale;
-
if (size < 1)
size = 1;
- else if (size > render_priv->height * 2)
- size = render_priv->height * 2;
+ else if (size > priv->height * 2)
+ size = priv->height * 2;
- ass_font_set_size(render_priv->state.font, size);
+ return size;
+}
+static void change_font_size(ASS_Renderer *render_priv, double sz)
+{
render_priv->state.font_size = sz;
}