Fix #10964: Missing FontConfig format for language. (#10965)

This commit is contained in:
PeterN 2023-06-06 23:38:11 +01:00 committed by GitHub
parent eda3defcb5
commit f249715db3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ bool SetFallbackFont(FontCacheSettings *settings, const std::string &language_is
/* Fontconfig doesn't handle full language isocodes, only the part
* before the _ of e.g. en_GB is used, so "remove" everything after
* the _. */
std::string lang = language_isocode.substr(0, language_isocode.find('_'));
std::string lang = fmt::format(":lang={}", language_isocode.substr(0, language_isocode.find('_')));
/* First create a pattern to match the wanted language. */
FcPattern *pat = FcNameParse((const FcChar8 *)lang.c_str());