liberty-xui: fix X11 FontConfig patterns
Look for styles by parameters rather than literal font names, which is likely to fail, e.g., on Oblique vs Italic for some fonts.
This commit is contained in:
+2
-4
@@ -1035,11 +1035,9 @@ x11_font_open (unsigned style)
|
||||
? FcNameParse ((const FcChar8 *) g_xui.x11_fontname_monospace)
|
||||
: FcNameParse ((const FcChar8 *) g_xui.x11_fontname);
|
||||
if (style & X11_FONT_BOLD)
|
||||
FcPatternAdd (pattern, FC_STYLE, (FcValue) {
|
||||
.type = FcTypeString, .u.s = (FcChar8 *) "Bold" }, FcFalse);
|
||||
FcPatternAddInteger (pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
|
||||
if (style & X11_FONT_ITALIC)
|
||||
FcPatternAdd (pattern, FC_STYLE, (FcValue) {
|
||||
.type = FcTypeString, .u.s = (FcChar8 *) "Italic" }, FcFalse);
|
||||
FcPatternAddInteger (pattern, FC_SLANT, FC_SLANT_ITALIC);
|
||||
|
||||
FcPattern *substituted = FcPatternDuplicate (pattern);
|
||||
FcConfigSubstitute (NULL, substituted, FcMatchPattern);
|
||||
|
||||
Reference in New Issue
Block a user