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
This commit is contained in:
Harley Acheson
2022-09-06 09:48:41 -07:00
parent 0c242ff72b
commit da9e685e26

View File

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