diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2022-09-06 19:48:41 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2022-09-06 19:48:41 +0300 |
commit | da9e685e26021202f5cc82e757f4fdf643548805 (patch) | |
tree | e0a6e327f2d64a06b9abb78885389bcaa0c6c239 /source | |
parent | 0c242ff72b15fd21d4d2d9af0e3382c9197d4ab5 (diff) |
Fix T100823: Do Not Load Non-Scalable Fonts
Do not allow the loading of old-style non-scalable fonts.
See D15884 for more details.
Differential Revision: https://developer.blender.org/D15884
Reviewed by Brecht Van Lommel
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 3ddeaaaf1c7..b96c01e704d 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -1361,6 +1361,11 @@ bool blf_ensure_face(FontBLF *font) return false; } + if (font->face && !(font->face->face_flags & FT_FACE_FLAG_SCALABLE)) { + printf("Font is not scalable\n"); + return false; + } + err = FT_Select_Charmap(font->face, FT_ENCODING_UNICODE); if (err) { err = FT_Select_Charmap(font->face, FT_ENCODING_APPLE_ROMAN); |