summaryrefslogtreecommitdiffstats
path: root/libass/ass_fontselect.h
diff options
context:
space:
mode:
authorOleg Oshmyan <chortos@inbox.lv>2022-11-15 21:50:13 +0200
committerOleg Oshmyan <chortos@inbox.lv>2023-08-06 00:54:14 +0300
commit1630dbeeef3b541e86af0c324a53a05a4f5a4b22 (patch)
treeaf01b343ec8c0613ca50f513a1d9ae684dcc6599 /libass/ass_fontselect.h
parent91422bdb9497e8484b3248f5ae7eb50d41e2555d (diff)
downloadlibass-1630dbeeef3b541e86af0c324a53a05a4f5a4b22.tar.bz2
libass-1630dbeeef3b541e86af0c324a53a05a4f5a4b22.tar.xz
fontselect: eagerly compute is_postscript in get_font_info
This lets us get rid of the font format check in ass_coretext, which is not available on Mac OS X 10.5 and prerelease 10.6. This fixes https://github.com/libass/libass/issues/595, which is about 10.6 prerelease build 10A190, the last Mac OS X build available for PowerPC CPUs. A separate commit will expand on this and make us compatible with 10.5 on all CPUs. This partly reverts commit d0566318ee5035ca3a4d2d65d46a80a4e3d8244c, where eager is_postscript was replaced by lazy check_postscript because back then ass_directwrite eagerly loaded all of the system's fonts and reading is_postscript from each font slowed it down significantly. But eventually (in particular but not only because even without this it was still slow for huge font collections) ass_directwrite learnt to load fonts lazily, so there's a decent chance that this lazy check_postscript (as well as the lazy get_font_index) isn't necessary at all any more and can be removed in the future.
Diffstat (limited to 'libass/ass_fontselect.h')
-rw-r--r--libass/ass_fontselect.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libass/ass_fontselect.h b/libass/ass_fontselect.h
index 07fad7b..43366bb 100644
--- a/libass/ass_fontselect.h
+++ b/libass/ass_fontselect.h
@@ -158,7 +158,7 @@ typedef char *(*GetFallbackFunc)(void *priv,
typedef struct font_provider_funcs {
GetDataFunc get_data; /* optional/mandatory */
- CheckPostscriptFunc check_postscript; /* mandatory */
+ CheckPostscriptFunc check_postscript; /* optional */
CheckGlyphFunc check_glyph; /* mandatory */
DestroyFontFunc destroy_font; /* optional */
DestroyProviderFunc destroy_provider; /* optional */
@@ -211,6 +211,12 @@ struct ass_font_provider_meta_data {
// See FONT_WEIGHT_*
int width; // Font weight in percent, normally 100
// See FONT_WIDTH_*
+
+ /**
+ * Whether the font contains PostScript outlines.
+ * Unused if the font provider has a check_postscript function.
+ */
+ bool is_postscript;
};
struct ass_font_stream {