[hackers] [st] ensure that the italic font has the same weight as the normal font || joe9

From: <git_AT_suckless.org>
Date: Tue, 19 Feb 2013 16:11:14 +0100

commit e5295629cdffb711001f3fdffbb9aa4ef772add0
Author: joe9 <joe9mail_AT_gmail.com>
Date: Mon Feb 18 12:31:29 2013 -0500

    ensure that the italic font has the same weight as the normal font
    
    The specified font[] pattern need not have a medium weight. It could be
    specified as a number too or have a different weight other than medium.
    
    Signed-off-by: Christoph Lohmann <20h_AT_r-36.net>

diff --git a/st.c b/st.c
index 19f8346..7befdc0 100644
--- a/st.c
+++ b/st.c
_AT_@ -2444,20 +2444,18 @@ xloadfonts(char *fontstr, int fontsize) {
         xw.ch = dc.font.height;
 
         FcPatternDel(pattern, FC_SLANT);
- FcPatternDel(pattern, FC_WEIGHT);
- FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
- FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
- if(xloadfont(&dc.bfont, pattern))
+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
+ if(xloadfont(&dc.ifont, pattern))
                 die("st: can't open font %s
", fontstr);
 
- FcPatternDel(pattern, FC_SLANT);
- FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
+ FcPatternDel(pattern, FC_WEIGHT);
+ FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD);
         if(xloadfont(&dc.ibfont, pattern))
                 die("st: can't open font %s
", fontstr);
 
- FcPatternDel(pattern, FC_WEIGHT);
- FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_MEDIUM);
- if(xloadfont(&dc.ifont, pattern))
+ FcPatternDel(pattern, FC_SLANT);
+ FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN);
+ if(xloadfont(&dc.bfont, pattern))
                 die("st: can't open font %s
", fontstr);
 
         FcPatternDestroy(pattern);
Received on Tue Feb 19 2013 - 16:11:14 CET

This archive was generated by hypermail 2.3.0 : Thu Feb 21 2013 - 19:27:11 CET