From edefc04076ab02dfd7a549dafdfa27824d357772 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 6 Jun 2025 02:02:37 -0700 Subject: [PATCH] Util: Fix build by disabling SDF rendering on older FreeType --- src/util/image/font.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/image/font.c b/src/util/image/font.c index 8c144150f..b4e191726 100644 --- a/src/util/image/font.c +++ b/src/util/image/font.c @@ -43,9 +43,10 @@ struct mFont* mFontOpen(const char* path) { if (FT_Init_FreeType(&library)) { return NULL; } - +#if FREETYPE_MAJOR >= 2 && FREETYPE_MINOR >= 11 FT_Int spread = 5; FT_Property_Set(library, "sdf", "spread", &spread); +#endif } FT_Face face; @@ -135,6 +136,7 @@ void mPainterDrawText(struct mPainter* painter, const char* text, int x, int y, break; } +#if FREETYPE_MAJOR >= 2 && FREETYPE_MINOR >= 11 if (painter->strokeWidth) { int xx = x; int yy = y; @@ -170,6 +172,7 @@ void mPainterDrawText(struct mPainter* painter, const char* text, int x, int y, painter->fillColor = fillColor; lastGlyph = 0; } +#endif while (*text) { uint32_t glyph = utf8Char((const char**) &text, NULL);