From 200065cc2fc971191846beb5c4362a6b1c7e0a47 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Sat, 9 Nov 2024 17:00:49 +0100 Subject: [PATCH] options: rename --sub-ass-hinting to --sub-hinting Because it also affects plain text subtitles. --- DOCS/interface-changes/sub-ass-options.txt | 1 + DOCS/man/options.rst | 2 +- options/options.c | 3 ++- options/options.h | 2 +- sub/sd_ass.c | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/DOCS/interface-changes/sub-ass-options.txt b/DOCS/interface-changes/sub-ass-options.txt index 849747157076d..7772e945164c7 100644 --- a/DOCS/interface-changes/sub-ass-options.txt +++ b/DOCS/interface-changes/sub-ass-options.txt @@ -1,2 +1,3 @@ rename `--sub-ass-line-spacing` to `--sub-line-spacing` rename `--sub-ass-shaper` to `--sub-shaper` +rename `--sub-ass-hinting` to `--sub-hinting` diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index a190141da8fbc..da06c54946042 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -2506,7 +2506,7 @@ Subtitles Using this option may lead to incorrect subtitle rendering. -``--sub-ass-hinting=`` +``--sub-hinting=`` Set font hinting type. can be: :none: no hinting (default) diff --git a/options/options.c b/options/options.c index a722593da5dc5..244b0aecbacb9 100644 --- a/options/options.c +++ b/options/options.c @@ -313,8 +313,9 @@ const struct m_sub_options mp_subtitle_sub_opts = { .flags = UPDATE_SUB_HARD}, {"sub-ass-styles", OPT_STRING(ass_styles_file), .flags = M_OPT_FILE | UPDATE_SUB_HARD}, - {"sub-ass-hinting", OPT_CHOICE(ass_hinting, + {"sub-hinting", OPT_CHOICE(sub_hinting, {"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})}, + {"sub-ass-hinting", OPT_REPLACED("sub-hinting")}, {"sub-shaper", OPT_CHOICE(sub_shaper, {"simple", 0}, {"complex", 1})}, {"sub-ass-shaper", OPT_REPLACED("sub-shaper")}, {"sub-ass-prune-delay", OPT_DOUBLE(ass_prune_delay), M_RANGE(-1.0, DBL_MAX)}, diff --git a/options/options.h b/options/options.h index e888b866fbe7a..63a936eb50e89 100644 --- a/options/options.h +++ b/options/options.h @@ -116,7 +116,7 @@ struct mp_subtitle_opts { bool use_embedded_fonts; char **ass_style_override_list; char *ass_styles_file; - int ass_hinting; + int sub_hinting; int sub_shaper; double ass_prune_delay; bool ass_justify; diff --git a/sub/sd_ass.c b/sub/sd_ass.c index c7bb1e35e6748..e54aa91c085da 100644 --- a/sub/sd_ass.c +++ b/sub/sd_ass.c @@ -537,7 +537,7 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim, if (converted || shared_opts->ass_style_override[sd->order]) { set_sub_pos = 100.0f - shared_opts->sub_pos[sd->order]; set_line_spacing = opts->sub_line_spacing; - set_hinting = opts->ass_hinting; + set_hinting = opts->sub_hinting; } if (total_override || shared_opts->ass_style_override[sd->order] == ASS_STYLE_OVERRIDE_SCALE) { set_font_scale = opts->sub_scale;