diff options
| author | joe9 <joe9mail@gmail.com> | 2013-02-18 12:31:29 -0500 | 
|---|---|---|
| committer | Christoph Lohmann <20h@r-36.net> | 2013-02-19 16:09:05 +0100 | 
| commit | e5295629cdffb711001f3fdffbb9aa4ef772add0 (patch) | |
| tree | fedff48f3c63bca3ba215ed440097dcbd163fa64 | |
| parent | 0e738c3d7291675472380a25b74f0358306541e5 (diff) | |
| download | st-e5295629cdffb711001f3fdffbb9aa4ef772add0.tar.gz st-e5295629cdffb711001f3fdffbb9aa4ef772add0.tar.bz2  | |
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>
| -rw-r--r-- | st.c | 16 | 
1 files changed, 7 insertions, 9 deletions
@@ -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\n", 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\n", 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\n", fontstr);  	FcPatternDestroy(pattern);  | 
