Util: Fix build by disabling SDF rendering on older FreeType

This commit is contained in:
Vicki Pfau 2025-06-06 02:02:37 -07:00
parent c4d3cf7de5
commit edefc04076
1 changed files with 4 additions and 1 deletions

View File

@ -43,9 +43,10 @@ struct mFont* mFontOpen(const char* path) {
if (FT_Init_FreeType(&library)) { if (FT_Init_FreeType(&library)) {
return NULL; return NULL;
} }
#if FREETYPE_MAJOR >= 2 && FREETYPE_MINOR >= 11
FT_Int spread = 5; FT_Int spread = 5;
FT_Property_Set(library, "sdf", "spread", &spread); FT_Property_Set(library, "sdf", "spread", &spread);
#endif
} }
FT_Face face; FT_Face face;
@ -135,6 +136,7 @@ void mPainterDrawText(struct mPainter* painter, const char* text, int x, int y,
break; break;
} }
#if FREETYPE_MAJOR >= 2 && FREETYPE_MINOR >= 11
if (painter->strokeWidth) { if (painter->strokeWidth) {
int xx = x; int xx = x;
int yy = y; int yy = y;
@ -170,6 +172,7 @@ void mPainterDrawText(struct mPainter* painter, const char* text, int x, int y,
painter->fillColor = fillColor; painter->fillColor = fillColor;
lastGlyph = 0; lastGlyph = 0;
} }
#endif
while (*text) { while (*text) {
uint32_t glyph = utf8Char((const char**) &text, NULL); uint32_t glyph = utf8Char((const char**) &text, NULL);