diff options
-rw-r--r-- | DOCS/man/options.rst | 22 | ||||
-rw-r--r-- | sub/ass_mp.c | 8 | ||||
-rw-r--r-- | sub/osd.c | 2 | ||||
-rw-r--r-- | sub/osd.h | 1 |
4 files changed, 30 insertions, 3 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 987746aeb0..68bc01eafd 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -1969,9 +1969,9 @@ Subtitles Default: no. -``--embeddedfonts``, ``--no-embeddedfonts`` +``--embeddedfonts=<yes|no>`` Use fonts embedded in Matroska container files and ASS scripts (default: - enabled). These fonts can be used for SSA/ASS subtitle rendering. + yes). These fonts can be used for SSA/ASS subtitle rendering. ``--sub-pos=<0-100>`` Specify the position of subtitles on the screen. The value is the vertical @@ -2461,6 +2461,20 @@ Subtitles If the video stream contains no closed captions, or if no video is being decoded, the CC track will remain empty and will not show any text. +``--sub-font-provider=<auto|none|fontconfig>`` + Which libass font provider backend to use (default: auto). ``auto`` will + attempt to use the native font provider: fontconfig on Linux, CoreText on + OSX, DirectWrite on Windows. ``fontconfig`` forces fontconfig, if libass + was built with support (if not, it behaves like ``none``). + + The ``none`` font provider effectively disables system fonts. It will still + attempt to use embedded fonts (unless ``--embeddedfonts=no`` is set; this is + the same behavior as with all other font providers), ``subfont.ttf`` if + provided, and fonts in the ``fonts`` sub-directory if provided. (The + fallback is more strict than that of other font providers, and if a font + name does not match, it may prefer not to render any text that uses the + missing font.) + Window ------ @@ -3625,6 +3639,10 @@ OSD This option is somewhat experimental and could be replaced by another mechanism in the future. +``--osd-font-provider=<...>`` + See ``--sub-font-provider`` for details and accepted values. Note that + unlike subtitles, OSD never uses embedded fonts from media files. + Screenshot ---------- diff --git a/sub/ass_mp.c b/sub/ass_mp.c index 34e05a230c..bb003a3edd 100644 --- a/sub/ass_mp.c +++ b/sub/ass_mp.c @@ -96,8 +96,14 @@ void mp_ass_configure_fonts(ASS_Renderer *priv, struct osd_style_opts *opts, if (default_font && !mp_path_exists(default_font)) default_font = NULL; + int font_provider = ASS_FONTPROVIDER_AUTODETECT; + if (opts->font_provider == 1) + font_provider = ASS_FONTPROVIDER_NONE; + if (opts->font_provider == 2) + font_provider = ASS_FONTPROVIDER_FONTCONFIG; + mp_verbose(log, "Setting up fonts...\n"); - ass_set_fonts(priv, default_font, opts->font, 1, config, 1); + ass_set_fonts(priv, default_font, opts->font, font_provider, config, 1); mp_verbose(log, "Done.\n"); talloc_free(tmp); @@ -64,6 +64,8 @@ static const m_option_t style_opts[] = { OPT_FLAG("italic", italic, 0), OPT_CHOICE("justify", justify, 0, ({"auto", 0}, {"left", 1}, {"center", 2}, {"right", 3})), + OPT_CHOICE("font-provider", font_provider, 0, + ({"auto", 0}, {"none", 1}, {"fontconfig", 2})), {0} }; @@ -137,6 +137,7 @@ struct osd_style_opts { int bold; int italic; int justify; + int font_provider; }; extern const struct m_sub_options osd_style_conf; |