From: Grigori Goronzy Date: Wed, 22 Jul 2009 01:21:33 +0000 (+0200) Subject: Bold/italic: interpret -1 as "true" X-Git-Tag: 0.9.7~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7f7e99c184dcb7ee1b4e09b8e498af7223e82aa;p=libass 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". --- 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 =