JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Fixing the italic-bold font check. Thanks nsz.
[st.git] / st.c
diff --git a/st.c b/st.c
index cdf1fdc..8ef1346 100644 (file)
--- a/st.c
+++ b/st.c
@@ -2226,7 +2226,12 @@ xloadfonts(char *fontstr, int fontsize) {
        FcResult result;
        double fontval;
 
-       pattern = FcNameParse((FcChar8 *)fontstr);
+       if(fontstr[0] == '-') {
+               pattern = XftXlfdParse(fontstr, False, False);
+       } else {
+               pattern = FcNameParse((FcChar8 *)fontstr);
+       }
+
        if(!pattern)
                die("st: can't open font %s\n", fontstr);
 
@@ -2403,7 +2408,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) {
 
        if(base.mode & ATTR_ITALIC)
                font = &dc.ifont;
-       if(base.mode & (ATTR_ITALIC|ATTR_ITALIC))
+       if(base.mode & (ATTR_ITALIC|ATTR_BOLD))
                font = &dc.ibfont;
 
        if(IS_SET(MODE_REVERSE)) {