From 287b177dfd6751431295b1f89b8aa68fa264e54e Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 18 Feb 2025 14:33:27 -0500 Subject: ensure font includes en-US --- main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index c903d02..b491136 100644 --- a/main.c +++ b/main.c @@ -683,10 +683,13 @@ int main(void) { { // find a suitable font FcPattern *pattern = FcPatternCreate(); + FcLangSet *langs = FcLangSetCreate(); + FcLangSetAdd(langs, (const FcChar8 *)"en-US"); + FcPatternAddLangSet(pattern, FC_LANG, langs); FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_REGULAR); FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); FcPatternAddInteger(pattern, FC_WIDTH, FC_WIDTH_NORMAL); - FcPatternAddString(pattern, FC_FONTFORMAT, (FcChar8 *)"TrueType"); + FcPatternAddString(pattern, FC_FONTFORMAT, (const FcChar8 *)"TrueType"); FcConfigSubstitute(0, pattern, FcMatchPattern); FcDefaultSubstitute(pattern); FcResult result = 0; @@ -702,6 +705,7 @@ int main(void) { } FcPatternDestroy(pattern); FcPatternDestroy(font); + FcLangSetDestroy(langs); } TTF_Font *font = TTF_OpenFont(font_path, 18); if (!font) { -- cgit v1.2.3