Changeset - r27542:44cebefe4f42
[Not reviewed]
master
0 1 0
PeterN - 15 months ago 2023-06-06 22:38:11
peter1138@openttd.org
Fix #10964: Missing FontConfig format for language. (#10965)
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/os/unix/font_unix.cpp
Show inline comments
 
@@ -104,13 +104,13 @@ bool SetFallbackFont(FontCacheSettings *
 
	auto fc_instance = FcConfigReference(nullptr);
 
	assert(fc_instance != nullptr);
 

	
 
	/* 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());
 
	/* We only want to know the filename. */
 
	FcObjectSet *os = FcObjectSetBuild(FC_FILE, FC_SPACING, FC_SLANT, FC_WEIGHT, nullptr);
 
	/* Get the list of filenames matching the wanted language. */
0 comments (0 inline, 0 general)