summaryrefslogtreecommitdiffstats
path: root/ass_mp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ass_mp.c')
-rw-r--r--ass_mp.c34
1 files changed, 16 insertions, 18 deletions
diff --git a/ass_mp.c b/ass_mp.c
index 37e688d7f1..98602ace03 100644
--- a/ass_mp.c
+++ b/ass_mp.c
@@ -70,8 +70,6 @@ extern char *sub_cp;
static char *sub_cp = 0;
#endif
-void process_force_style(ASS_Track *track);
-
ASS_Track *mp_ass_default_track(ASS_Library *library)
{
ASS_Track *track = ass_new_track(library);
@@ -85,13 +83,9 @@ ASS_Track *mp_ass_default_track(ASS_Library *library)
ass_read_styles(track, ass_styles_file, sub_cp);
if (track->n_styles == 0) {
- ASS_Style *style;
- int sid;
- double fs;
- uint32_t c1, c2;
-
- sid = ass_alloc_style(track);
- style = track->styles + sid;
+ track->Kerning = true;
+ int sid = ass_alloc_style(track);
+ ASS_Style *style = track->styles + sid;
style->Name = strdup("Default");
style->FontName = (font_fontconfig >= 0
&& sub_font_name) ? strdup(sub_font_name)
@@ -99,30 +93,34 @@ ASS_Track *mp_ass_default_track(ASS_Library *library)
&& font_name) ? strdup(font_name) : strdup("Sans");
style->treat_fontname_as_pattern = 1;
- fs = track->PlayResY * text_font_scale_factor / 100.;
- // approximate autoscale coefficients
+ double fs = track->PlayResY * text_font_scale_factor / 100.;
+ /* The font size is always proportional to video height only;
+ * real -subfont-autoscale behavior is not implemented.
+ * Apply a correction that corresponds to about 4:3 aspect ratio
+ * video to get a size somewhat closer to what non-libass rendering
+ * would produce with the same text_font_scale_factor
+ * and subtitle_autoscale.
+ */
if (subtitle_autoscale == 2)
fs *= 1.3;
else if (subtitle_autoscale == 3)
- fs *= 1.4;
- style->FontSize = fs;
+ fs *= 1.7;
+ uint32_t c1 = 0xFFFFFF00;
+ uint32_t c2 = 0x00000000;
if (ass_color)
c1 = strtoll(ass_color, NULL, 16);
- else
- c1 = 0xFFFF0000;
if (ass_border_color)
c2 = strtoll(ass_border_color, NULL, 16);
- else
- c2 = 0x00000000;
+ style->FontSize = fs;
style->PrimaryColour = c1;
style->SecondaryColour = c1;
style->OutlineColour = c2;
style->BackColour = 0x00000000;
style->BorderStyle = 1;
style->Alignment = 2;
- style->Outline = 2;
+ style->Outline = fs / 16;
style->MarginL = 10;
style->MarginR = 10;
style->MarginV = 5;