1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-11 17:39:38 +00:00

Both (-1) and 1 mean bold font in SSA/ASS styles.

The same for italics and some other fields.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22281 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2007-02-19 20:10:55 +00:00
parent 11399e2ac8
commit 999e603eb7
2 changed files with 7 additions and 4 deletions

View File

@ -458,6 +458,9 @@ static int process_style(ass_track_t* track, char *str)
}
style->ScaleX /= 100.;
style->ScaleY /= 100.;
style->Bold = !!style->Bold;
style->Italic = !!style->Italic;
style->Underline = !!style->Underline;
if (!style->Name)
style->Name = strdup("Default");
if (!style->FontName)

View File

@ -983,14 +983,14 @@ static char* parse_tag(char* p, double pwr) {
if (pwr >= 1.)
render_context.bold = b;
} else
render_context.bold = - render_context.style->Bold;
render_context.bold = render_context.style->Bold;
update_font();
} else if (mystrcmp(&p, "i")) {
int i;
if (mystrtoi(&p, 10, &i))
render_context.italic = i;
else
render_context.italic = - render_context.style->Italic;
render_context.italic = render_context.style->Italic;
update_font();
} else if (mystrcmp(&p, "kf") || mystrcmp(&p, "K")) {
int val = strtol(p, &p, 10);
@ -1152,8 +1152,8 @@ static void reset_render_context(void)
if (render_context.family)
free(render_context.family);
render_context.family = strdup(render_context.style->FontName);
render_context.bold = - render_context.style->Bold;
render_context.italic = - render_context.style->Italic;
render_context.bold = render_context.style->Bold;
render_context.italic = render_context.style->Italic;
update_font();
change_border(-1.);