summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2009-07-22 03:21:33 +0200
committerGrigori Goronzy <greg@blackbox>2009-07-22 03:24:14 +0200
commite7f7e99c184dcb7ee1b4e09b8e498af7223e82aa (patch)
tree4005f45094cad4c39d1b185e8a9b2d90674f32f8
parentec5bbb431328d3e4d1129f1dd6fd1774907881a7 (diff)
downloadlibass-e7f7e99c184dcb7ee1b4e09b8e498af7223e82aa.tar.bz2
libass-e7f7e99c184dcb7ee1b4e09b8e498af7223e82aa.tar.xz
Bold/italic: interpret -1 as "true"
Interpret the value -1 as "true", as specified in the ASS specifications. Otherwise, clamp the value to 0 for other values < 0, so these are interpreted as "false".
-rw-r--r--libass/ass_render.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index ece333d..de7d262 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -1052,17 +1052,17 @@ static void update_font(ass_renderer_t *render_priv)
val = render_priv->state.bold;
// 0 = normal, 1 = bold, >1 = exact weight
- if (val == 0)
- val = 80; // normal
- else if (val == 1)
+ if (val == 1 || val == -1)
val = 200; // bold
+ else if (val <= 0)
+ val = 80; // normal
desc.bold = val;
val = render_priv->state.italic;
- if (val == 0)
+ if (val == 1 || val == -1)
+ val = 110; // italic
+ else if (val <= 0)
val = 0; // normal
- else if (val == 1)
- val = 110; //italic
desc.italic = val;
render_priv->state.font =