diff options
author | wm4 <wm4@nowhere> | 2013-09-25 21:42:29 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-09-25 21:42:29 +0200 |
commit | 72fbd846db3bf446b3fa00eba4f0197e6214f942 (patch) | |
tree | b0065df482034f37f82b16aa26409add5668f3a4 | |
parent | 1e4f08c50cc5e3abb61c95903a270c8e281d2e5b (diff) | |
download | mpv-72fbd846db3bf446b3fa00eba4f0197e6214f942.tar.bz2 mpv-72fbd846db3bf446b3fa00eba4f0197e6214f942.tar.xz |
options: allow selecting the libass shaper
I'm using the word "languages" instead of "scripts" in the manpage, but
I think that's easier to understand with a smaller amount of
descriptions.
-rw-r--r-- | DOCS/man/en/options.rst | 9 | ||||
-rw-r--r-- | mpvcore/options.c | 3 | ||||
-rw-r--r-- | mpvcore/options.h | 1 | ||||
-rw-r--r-- | sub/ass_mp.c | 3 |
4 files changed, 16 insertions, 0 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index d6282015fd..ca17c763c4 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -140,6 +140,15 @@ ``--ass-line-spacing=<value>`` Set line spacing value for SSA/ASS renderer. +``--ass-shaper=simple|complex`` + Set the text layout engine used by libass. + + :simple: uses Fribidi only, fast, doesn't render some languages correctly + :complex: uses HarfBuzz, slower, wider language support + + ``complex`` is the default. If libass hasn't been compiled against HarfBuzz, + libass silently reverts to ``simple``. + ``--ass-styles=<filename>`` Load all SSA/ASS styles found in the specified file and use them for rendering text subtitles. The syntax of the file is exactly like the ``[V4 diff --git a/mpvcore/options.c b/mpvcore/options.c index 521b30e7d4..9200c1dcf8 100644 --- a/mpvcore/options.c +++ b/mpvcore/options.c @@ -540,6 +540,8 @@ const m_option_t mp_opts[] = { OPT_STRING("ass-styles", ass_styles_file, 0), OPT_CHOICE("ass-hinting", ass_hinting, 0, ({"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})), + OPT_CHOICE("ass-shaper", ass_shaper, 0, + ({"simple", 0}, {"complex", 1})), OPT_CHOICE("ass-style-override", ass_style_override, 0, ({"no", 0}, {"yes", 1})), OPT_FLAG("osd-bar", osd_bar_visible, 0), @@ -829,6 +831,7 @@ const struct MPOpts mp_default_opts = { .ass_vsfilter_color_compat = 1, .ass_vsfilter_blur_compat = 1, .ass_style_override = 1, + .ass_shaper = 1, .use_embedded_fonts = 1, .suboverlap_enabled = 0, #ifdef CONFIG_ENCA diff --git a/mpvcore/options.h b/mpvcore/options.h index b1058fca37..7a30c24b34 100644 --- a/mpvcore/options.h +++ b/mpvcore/options.h @@ -202,6 +202,7 @@ typedef struct MPOpts { char *ass_styles_file; int ass_style_override; int ass_hinting; + int ass_shaper; int hwdec_api; char *hwdec_codecs; diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 7af3926058..c46daf415e 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -139,6 +139,9 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts, #if LIBASS_VERSION >= 0x01010000 ass_set_line_position(priv, set_sub_pos); #endif +#if LIBASS_VERSION >= 0x01000000 + ass_set_shaper(priv, opts->ass_shaper); +#endif ass_set_font_scale(priv, set_font_scale); ass_set_hinting(priv, set_hinting); ass_set_line_spacing(priv, set_line_spacing); |