commit e5295629cdffb711001f3fdffbb9aa4ef772add0 from: joe9 via: Christoph Lohmann <20h@r-36.net> date: Tue Feb 19 15:09:05 2013 UTC 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@r-36.net> commit - 0e738c3d7291675472380a25b74f0358306541e5 commit + e5295629cdffb711001f3fdffbb9aa4ef772add0 blob - 19f8346fc1dcc03ae06d7f813d7f50eb9e7ff949 blob + 7befdc0c05beb481eb2c0e48b312b2449563868f --- st.c +++ st.c @@ -2444,22 +2444,20 @@ 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)) - die("st: can't open font %s\n", fontstr); - - FcPatternDel(pattern, FC_SLANT); FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); - if(xloadfont(&dc.ibfont, pattern)) - die("st: can't open font %s\n", fontstr); - - FcPatternDel(pattern, FC_WEIGHT); - FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_MEDIUM); if(xloadfont(&dc.ifont, pattern)) die("st: can't open font %s\n", fontstr); + FcPatternDel(pattern, FC_WEIGHT); + FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); + if(xloadfont(&dc.ibfont, pattern)) + die("st: can't open font %s\n", fontstr); + + FcPatternDel(pattern, FC_SLANT); + FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); + if(xloadfont(&dc.bfont, pattern)) + die("st: can't open font %s\n", fontstr); + FcPatternDestroy(pattern); }