summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-25 21:40:35 +0200
committerwm4 <wm4@nowhere>2013-09-25 21:40:35 +0200
commit1e4f08c50cc5e3abb61c95903a270c8e281d2e5b (patch)
treec2fec85d465af2eb4197c8e117708afe45304b60
parent4e6751609ee1798539c0338ac930bdb4b1e80242 (diff)
downloadmpv-1e4f08c50cc5e3abb61c95903a270c8e281d2e5b.tar.bz2
mpv-1e4f08c50cc5e3abb61c95903a270c8e281d2e5b.tar.xz
options: make --ass-hinting a choice, instead of using magic numbers
options.c still doesn't use the constants defined by the libass headers, but it's still better than exposing those to the user directly.
-rw-r--r--DOCS/man/en/options.rst17
-rw-r--r--mpvcore/options.c3
-rw-r--r--sub/ass_mp.c2
3 files changed, 14 insertions, 8 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst
index 8b26e7f448..d6282015fd 100644
--- a/DOCS/man/en/options.rst
+++ b/DOCS/man/en/options.rst
@@ -122,15 +122,20 @@
Using this option may lead to incorrect subtitle rendering.
-``--ass-hinting=<type>``
+``--ass-hinting=none|light|normal|native``
Set font hinting type. <type> can be:
- :0: no hinting
- :1: FreeType autohinter, light mode
- :2: FreeType autohinter, normal mode
- :3: font native hinter
+ :none: no hinting (default)
+ :light: FreeType autohinter, light mode
+ :normal: FreeType autohinter, normal mode
+ :native: font native hinter
- The default value is 0 (no hinting).
+ .. admonition:: Warning
+
+ Enabling hinting can lead to mispositioned text (in situations it's
+ supposed to match up with video background), or reduce the smoothness
+ of animations with some badly authored ASS scripts. It is recommended
+ to not use this option, unless really needed.
``--ass-line-spacing=<value>``
Set line spacing value for SSA/ASS renderer.
diff --git a/mpvcore/options.c b/mpvcore/options.c
index 79d91c1b04..521b30e7d4 100644
--- a/mpvcore/options.c
+++ b/mpvcore/options.c
@@ -538,7 +538,8 @@ const m_option_t mp_opts[] = {
OPT_FLAG("embeddedfonts", use_embedded_fonts, 0),
OPT_STRINGLIST("ass-force-style", ass_force_style_list, 0),
OPT_STRING("ass-styles", ass_styles_file, 0),
- OPT_INTRANGE("ass-hinting", ass_hinting, 0, 0, 7),
+ OPT_CHOICE("ass-hinting", ass_hinting, 0,
+ ({"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})),
OPT_CHOICE("ass-style-override", ass_style_override, 0,
({"no", 0}, {"yes", 1})),
OPT_FLAG("osd-bar", osd_bar_visible, 0),
diff --git a/sub/ass_mp.c b/sub/ass_mp.c
index 01b4ebff2f..7af3926058 100644
--- a/sub/ass_mp.c
+++ b/sub/ass_mp.c
@@ -132,7 +132,7 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts,
#endif
set_line_spacing = opts->ass_line_spacing;
set_font_scale = opts->sub_scale;
- set_hinting = opts->ass_hinting & 3; // +4 was for no hinting if scaled
+ set_hinting = opts->ass_hinting;
}
ass_set_use_margins(priv, set_use_margins);