History

sub: add sub-scale-signs

Allows --sub-scale to alow scale typesetting

llyyr committed 1 year ago

Commit baecbb11 parent 996e58a5 files · +14 −3Browse files

Unified · Split

5 files
  1. DOCS/interface-changes/sub-scale-signs.txt +1 −0
  2. DOCS/man/options.rst +6 −0
  3. options/options.c +1 −0
  4. options/options.h +1 −0
  5. sub/sd_ass.c +5 −3
DOCS/interface-changes/sub-scale-signs.txt+1−0
@@ -0,0 +1 @@
1add `--sub-scale-signs` to allow `--sub-scale` to also scale events detected to be signs by libass
DOCS/man/options.rst+6−0
@@ -2447,6 +2447,12 @@ Subtitles · 2446 unmodified lines
2447 This affects ASS subtitles as well, and may lead to incorrect subtitle2447 This affects ASS subtitles as well, and may lead to incorrect subtitle
2448 rendering. Use with care, or use ``--sub-font-size`` instead.2448 rendering. Use with care, or use ``--sub-font-size`` instead.
2449 2449
2450``--sub-scale-signs=<yes|no>``
2451 When set to yes, also apply ``--sub-scale`` to typesetting (or "signs").
2452 When this is set to no, ``--sub-scale`` is only applied to dialogue. The
2453 distinction between dialogue and typesetting is done on a best effort basis
2454 and is not infallible (default: no).
2455
2450``--sub-scale-by-window=<yes|no>``2456``--sub-scale-by-window=<yes|no>``
2451 Whether to scale subtitles with the window size (default: yes). If this is2457 Whether to scale subtitles with the window size (default: yes). If this is
2452 disabled while ``--sub-scale-with-window`` is set to yes, changing the window2458 disabled while ``--sub-scale-with-window`` is set to yes, changing the window
options/options.c+1−0
@@ -298,6 +298,7 @@ const struct m_sub_options mp_subtitle_sub_opts = { · 297 unmodified lines
298 {"sub-gray", OPT_BOOL(sub_gray)},298 {"sub-gray", OPT_BOOL(sub_gray)},
299 {"sub-ass", OPT_BOOL(ass_enabled), .flags = UPDATE_SUB_HARD},299 {"sub-ass", OPT_BOOL(ass_enabled), .flags = UPDATE_SUB_HARD},
300 {"sub-scale", OPT_FLOAT(sub_scale), M_RANGE(0, 100)},300 {"sub-scale", OPT_FLOAT(sub_scale), M_RANGE(0, 100)},
301 {"sub-scale-signs", OPT_BOOL(sub_scale_signs)},
301 {"sub-line-spacing", OPT_FLOAT(sub_line_spacing), M_RANGE(-1000, 1000)},302 {"sub-line-spacing", OPT_FLOAT(sub_line_spacing), M_RANGE(-1000, 1000)},
302 {"sub-ass-line-spacing", OPT_REPLACED("sub-line-spacing")},303 {"sub-ass-line-spacing", OPT_REPLACED("sub-line-spacing")},
303 {"sub-use-margins", OPT_BOOL(sub_use_margins)},304 {"sub-use-margins", OPT_BOOL(sub_use_margins)},
options/options.h+1−0
@@ -104,6 +104,7 @@ struct mp_subtitle_opts { · 103 unmodified lines
104 bool ass_scale_with_window;104 bool ass_scale_with_window;
105 struct osd_style_opts *sub_style;105 struct osd_style_opts *sub_style;
106 float sub_scale;106 float sub_scale;
107 bool sub_scale_signs;
107 float sub_gauss;108 float sub_gauss;
108 bool sub_gray;109 bool sub_gray;
109 bool ass_enabled;110 bool ass_enabled;
sub/sd_ass.c+5−3
@@ -559,13 +559,15 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim, · 558 unmodified lines
559 set_force_flags |= ASS_OVERRIDE_BIT_FONT_NAME559 set_force_flags |= ASS_OVERRIDE_BIT_FONT_NAME
560 | ASS_OVERRIDE_BIT_FONT_SIZE_FIELDS560 | ASS_OVERRIDE_BIT_FONT_SIZE_FIELDS
561 | ASS_OVERRIDE_BIT_COLORS561 | ASS_OVERRIDE_BIT_COLORS
562 | ASS_OVERRIDE_BIT_BORDER562 | ASS_OVERRIDE_BIT_BORDER;
563 | ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;563 if (!opts->sub_scale_signs)
564 set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;
564#if LIBASS_VERSION >= 0x01703020565#if LIBASS_VERSION >= 0x01703020
565 set_force_flags |= ASS_OVERRIDE_BIT_BLUR;566 set_force_flags |= ASS_OVERRIDE_BIT_BLUR;
566#endif567#endif
567 }568 }
568 if (shared_opts->ass_style_override[sd->order] == ASS_STYLE_OVERRIDE_SCALE)569 if (shared_opts->ass_style_override[sd->order] == ASS_STYLE_OVERRIDE_SCALE &&
570 !opts->sub_scale_signs)
569 set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;571 set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE;
570 if (converted)572 if (converted)
571 set_force_flags |= ASS_OVERRIDE_BIT_ALIGNMENT;573 set_force_flags |= ASS_OVERRIDE_BIT_ALIGNMENT;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t