Font rendering question - FS Lola Medium Regular.ttf
Andrew Murray <[email protected]> Thu, 22 Aug 2024 20:06:10 +1000
| Newsgroups | gmane.comp.fonts.freetype.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Over at Python Pillow, a user is trying to render a space character with =
FS Lola Medium Regular.ttf - =
https://github.com/python-pillow/Pillow/issues/8272
If it helps, the font is available at =
https://github.com/user-attachments/files/16443570/FS.Lola.Medium.Regular.=
zip
Pillow is currently raising an error because the glyph bitmap has no =
buffer for the space character. Here is code to demonstrate that it is =
present for the letter A, but missing for the space character.
FT_Library library;
FT_Init_FreeType(&library);
FT_Face face =3D NULL;
FT_New_Face(library, "./FS Lola Medium Regular.ttf", 0, &face);
FT_Set_Pixel_Sizes(face, 0, 27);
FT_Load_Glyph(face, 66, FT_LOAD_DEFAULT | FT_LOAD_RENDER);
printf(face->glyph->bitmap.buffer ? "has buffer\n" : "no buffer\n");
FT_Load_Glyph(face, 33, FT_LOAD_DEFAULT | FT_LOAD_RENDER);
printf(face->glyph->bitmap.buffer ? "has buffer\n" : "no =
buffer\n=E2=80=9D);
My question - is it acceptable for a space character to have no bitmap =
buffer, since there are no pixels to draw? Or should it still have one, =
and this font is broken in some way?
Thanks very much.=