Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2022-09-06 19:48:41 +0300
committerHarley Acheson <harley.acheson@gmail.com>2022-09-06 19:48:41 +0300
commitda9e685e26021202f5cc82e757f4fdf643548805 (patch)
treee0a6e327f2d64a06b9abb78885389bcaa0c6c239
parent0c242ff72b15fd21d4d2d9af0e3382c9197d4ab5 (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
-rw-r--r--source/blender/blenfont/intern/blf_font.c5
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);