From e7f7e99c184dcb7ee1b4e09b8e498af7223e82aa Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Wed, 22 Jul 2009 03:21:33 +0200 Subject: 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". --- libass/ass_render.c | 12 ++++++------ 1 file 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 = -- cgit v1.2.3