[Bf-blender-cvs] [da9e685e260] master: Fix T100823: Do Not Load Non-Scalable Fonts

Harley Acheson noreply at git.blender.org
Tue Sep 6 18:49:40 CEST 2022


Commit: da9e685e26021202f5cc82e757f4fdf643548805
Author: Harley Acheson
Date:   Tue Sep 6 09:48:41 2022 -0700
Branches: master
https://developer.blender.org/rBda9e685e26021202f5cc82e757f4fdf643548805

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

===================================================================

M	source/blender/blenfont/intern/blf_font.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list