summaryrefslogtreecommitdiffstats
path: root/sub/sd_ass.c
diff options
context:
space:
mode:
authorDan Oscarsson <DanOscarsson@users.noreply.github.com>2017-02-01 13:19:09 +0100
committerwm4 <wm4@nowhere>2017-02-01 16:42:58 +0100
commitf1c9032ddf5eba1241d9616656b4c36bc4043283 (patch)
tree6c7e84dbca6d3631ac4330ed32987eb609deab8c /sub/sd_ass.c
parentbbf01346ff684f0f6a8cc8489b00920956dc16eb (diff)
downloadmpv-f1c9032ddf5eba1241d9616656b4c36bc4043283.tar.bz2
mpv-f1c9032ddf5eba1241d9616656b4c36bc4043283.tar.xz
sub: add justify of subtitles
To make it easier for the eyes, multi line subtitles should be left justified (for most languages). This adds an option to define how subtitles are to be justified inpendently of how they are aligned. Also add option to enable --sub-justify to be applied on ASS subtitles.
Diffstat (limited to 'sub/sd_ass.c')
-rw-r--r--sub/sd_ass.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index 31c66a6087..9b4d3763c5 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -333,6 +333,10 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim,
if (converted)
set_force_flags |= ASS_OVERRIDE_BIT_ALIGNMENT;
#endif
+#ifdef ASS_JUSTIFY_AUTO
+ if ((converted || opts->ass_style_override) && opts->ass_justify)
+ set_force_flags |= ASS_OVERRIDE_BIT_JUSTIFY;
+#endif
ass_set_selective_style_override_enabled(priv, set_force_flags);
ASS_Style style = {0};
mp_ass_set_style(&style, 288, opts->sub_style);