mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 02:09:52 +00:00
Disable libass fallbacks for fontconfig < 2.4.2
libass doesn't support fontconfig < 2.4.2 so fallbacks for these ancient versions aren't needed anymore. Also update the man page (English, German) to reflect the change. Additionally note that -embeddedfonts controls the use of ASS script embedded fonts too. -embeddedfonts is now always enabled by default. Fonts are never extracted into a directory anymore but passed to libass via memory.
This commit is contained in:
parent
e28e4a1b15
commit
42a87fc611
@ -2193,7 +2193,6 @@ Siehe auch \-vf expand.
|
||||
Schaltet das Zeichnen von SSA/ASS-Untertiteln ein.
|
||||
Mit dieser Option wird libass für externe SSA/ASS-Untertitel und
|
||||
Matroska-Spuren verwendet.
|
||||
Du möchtest vielleicht auch \-embeddedfonts verwenden.
|
||||
.br
|
||||
.I ANMERKUNG:
|
||||
Wenn fontconfig eincompiliert wurde, schaltet \-ass automatisch \-fontconfig
|
||||
@ -2320,17 +2319,10 @@ Speichert den Untertitel-Substream eines VOB-Streams.
|
||||
Siehe auch die Optionen \-dump*sub und \-vobsubout*.
|
||||
.
|
||||
.TP
|
||||
.B \-embeddedfonts (nur bei FreeType)
|
||||
Aktiviert die Extraktion von in Matroska eingebetteten Schriften (Standard:
|
||||
deaktiviert).
|
||||
.B \-noembeddedfonts
|
||||
Deaktiviert die Nutzung von in Matroska-Dateien und ASS-Untertiteln eingebetteten Schriften (Standard:
|
||||
aktiviert).
|
||||
Diese Schriften können für das Rendern von SSA/ASS-Untertiteln verwendet werden
|
||||
(Option \-ass).
|
||||
Schriftdateien werden im Verzeichnis ~/.mplayer/\:fonts angelegt.
|
||||
.br
|
||||
.I ANMERKUNG:
|
||||
Bei der Verwendung von FontConfig 2.4.2 oder neuer werden eingebettete
|
||||
Schriften direkt vom Speicher geöffnet; diese Option ist per Voreinstellung
|
||||
aktiviert.
|
||||
.
|
||||
.TP
|
||||
.B \-ffactor <Nummer>
|
||||
|
@ -2072,7 +2072,6 @@ Also see \-vf expand.
|
||||
Turn on SSA/ASS subtitle rendering.
|
||||
With this option, libass will be used for SSA/ASS
|
||||
external subtitles and Matroska tracks.
|
||||
You may also want to use \-embeddedfonts.
|
||||
.br
|
||||
.I NOTE:
|
||||
Unlike normal OSD, libass uses fontconfig by default. To disable it, use
|
||||
@ -2197,15 +2196,10 @@ Dumps the subtitle substream from VOB streams.
|
||||
Also see the \-dump*sub and \-vobsubout* options.
|
||||
.
|
||||
.TP
|
||||
.B \-embeddedfonts (FreeType only)
|
||||
Enables extraction of Matroska embedded fonts (default: disabled).
|
||||
.B \-noembeddedfonts
|
||||
Disables use of fonts embedded in Matroska containers and ASS scripts (default: enabled).
|
||||
These fonts can be used for SSA/ASS subtitle
|
||||
rendering (\-ass option).
|
||||
Font files are created in the ~/.mplayer/\:fonts directory.
|
||||
.br
|
||||
.I NOTE:
|
||||
With FontConfig 2.4.2 or newer, embedded fonts are opened directly from memory,
|
||||
and this option is enabled by default.
|
||||
.
|
||||
.TP
|
||||
.B \-ffactor <number>
|
||||
|
8
ass_mp.c
8
ass_mp.c
@ -41,11 +41,7 @@ float ass_font_scale = 1.;
|
||||
float ass_line_spacing = 0.;
|
||||
int ass_top_margin = 0;
|
||||
int ass_bottom_margin = 0;
|
||||
#if defined(FC_VERSION) && (FC_VERSION >= 20402)
|
||||
int extract_embedded_fonts = 1;
|
||||
#else
|
||||
int extract_embedded_fonts = 0;
|
||||
#endif
|
||||
int use_embedded_fonts = 1;
|
||||
char **ass_force_style_list = NULL;
|
||||
int ass_use_margins = 0;
|
||||
char *ass_color = NULL;
|
||||
@ -285,7 +281,7 @@ ASS_Library *ass_init(void)
|
||||
priv = ass_library_init();
|
||||
ass_set_message_cb(priv, message_callback, NULL);
|
||||
ass_set_fonts_dir(priv, path);
|
||||
ass_set_extract_fonts(priv, extract_embedded_fonts);
|
||||
ass_set_extract_fonts(priv, use_embedded_fonts);
|
||||
ass_set_style_overrides(priv, ass_force_style_list);
|
||||
free(path);
|
||||
return priv;
|
||||
|
2
ass_mp.h
2
ass_mp.h
@ -36,7 +36,7 @@ extern float ass_font_scale;
|
||||
extern float ass_line_spacing;
|
||||
extern int ass_top_margin;
|
||||
extern int ass_bottom_margin;
|
||||
extern int extract_embedded_fonts;
|
||||
extern int use_embedded_fonts;
|
||||
extern char **ass_force_style_list;
|
||||
extern int ass_use_margins;
|
||||
extern char *ass_color;
|
||||
|
@ -329,8 +329,8 @@
|
||||
{"ass-bottom-margin", &ass_bottom_margin, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL},
|
||||
{"ass-use-margins", &ass_use_margins, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||
{"noass-use-margins", &ass_use_margins, CONF_TYPE_FLAG, 0, 1, 0, NULL},
|
||||
{"embeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||
{"noembeddedfonts", &extract_embedded_fonts, CONF_TYPE_FLAG, 0, 1, 0, NULL},
|
||||
{"embeddedfonts", &use_embedded_fonts, CONF_TYPE_FLAG, 0, 0, 1, NULL},
|
||||
{"noembeddedfonts", &use_embedded_fonts, CONF_TYPE_FLAG, 0, 1, 0, NULL},
|
||||
{"ass-force-style", &ass_force_style_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL},
|
||||
{"ass-color", &ass_color, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
{"ass-border-color", &ass_border_color, CONF_TYPE_STRING, 0, 0, 0, NULL},
|
||||
|
@ -3670,7 +3670,7 @@ if (opts->ass_enabled && ass_library) {
|
||||
struct demuxer *d = mpctx->sources[j].demuxer;
|
||||
for (int i = 0; i < d->num_attachments; i++) {
|
||||
struct demux_attachment *att = d->attachments + i;
|
||||
if (extract_embedded_fonts
|
||||
if (use_embedded_fonts
|
||||
&& att->name && att->type && att->data && att->data_size
|
||||
&& (strcmp(att->type, "application/x-truetype-font") == 0
|
||||
|| strcmp(att->type, "application/x-font") == 0))
|
||||
|
Loading…
Reference in New Issue
Block a user