Allows --sub-scale to alow scale typesetting
Unified · Split
| @@ -0,0 +1 @@ | ||
| 1 | +add `--sub-scale-signs` to allow `--sub-scale` to also scale events detected to be signs by libass | |
| @@ -2447,6 +2447,12 @@ Subtitles · 2446 unmodified lines | ||
| 2447 | 2447 | This affects ASS subtitles as well, and may lead to incorrect subtitle |
| 2448 | 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 | 2456 | ``--sub-scale-by-window=<yes|no>`` |
| 2451 | 2457 | Whether to scale subtitles with the window size (default: yes). If this is |
| 2452 | 2458 | disabled while ``--sub-scale-with-window`` is set to yes, changing the window |
| @@ -298,6 +298,7 @@ const struct m_sub_options mp_subtitle_sub_opts = { · 297 unmodified lines | ||
| 298 | 298 | {"sub-gray", OPT_BOOL(sub_gray)}, |
| 299 | 299 | {"sub-ass", OPT_BOOL(ass_enabled), .flags = UPDATE_SUB_HARD}, |
| 300 | 300 | {"sub-scale", OPT_FLOAT(sub_scale), M_RANGE(0, 100)}, |
| 301 | + {"sub-scale-signs", OPT_BOOL(sub_scale_signs)}, | |
| 301 | 302 | {"sub-line-spacing", OPT_FLOAT(sub_line_spacing), M_RANGE(-1000, 1000)}, |
| 302 | 303 | {"sub-ass-line-spacing", OPT_REPLACED("sub-line-spacing")}, |
| 303 | 304 | {"sub-use-margins", OPT_BOOL(sub_use_margins)}, |
| @@ -104,6 +104,7 @@ struct mp_subtitle_opts { · 103 unmodified lines | ||
| 104 | 104 | bool ass_scale_with_window; |
| 105 | 105 | struct osd_style_opts *sub_style; |
| 106 | 106 | float sub_scale; |
| 107 | + bool sub_scale_signs; | |
| 107 | 108 | float sub_gauss; |
| 108 | 109 | bool sub_gray; |
| 109 | 110 | bool ass_enabled; |
| @@ -559,13 +559,15 @@ static void configure_ass(struct sd *sd, struct mp_osd_res *dim, · 558 unmodified lines | ||
| 559 | 559 | set_force_flags |= ASS_OVERRIDE_BIT_FONT_NAME |
| 560 | 560 | | ASS_OVERRIDE_BIT_FONT_SIZE_FIELDS |
| 561 | 561 | | ASS_OVERRIDE_BIT_COLORS |
| 562 | − | ASS_OVERRIDE_BIT_BORDER | |
| 563 | − | ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE; | |
| 562 | + | ASS_OVERRIDE_BIT_BORDER; | |
| 563 | + if (!opts->sub_scale_signs) | |
| 564 | + set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE; | |
| 564 | 565 | #if LIBASS_VERSION >= 0x01703020 |
| 565 | 566 | set_force_flags |= ASS_OVERRIDE_BIT_BLUR; |
| 566 | 567 | #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 | 571 | set_force_flags |= ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE; |
| 570 | 572 | if (converted) |
| 571 | 573 | set_force_flags |= ASS_OVERRIDE_BIT_ALIGNMENT; |