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 | Style inquisition. (diff) | |
| download | st-e5295629cdffb711001f3fdffbb9aa4ef772add0.tar.gz st-e5295629cdffb711001f3fdffbb9aa4ef772add0.zip | |
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) { | |||
| 2444 | xw.ch = dc.font.height; | 2444 | xw.ch = dc.font.height; |
| 2445 | 2445 | ||
| 2446 | FcPatternDel(pattern, FC_SLANT); | 2446 | FcPatternDel(pattern, FC_SLANT); |
| 2447 | FcPatternDel(pattern, FC_WEIGHT); | 2447 | FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); |
| 2448 | FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); | 2448 | if(xloadfont(&dc.ifont, pattern)) |
| 2449 | FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); | ||
| 2450 | if(xloadfont(&dc.bfont, pattern)) | ||
| 2451 | die("st: can't open font %s\n", fontstr); | 2449 | die("st: can't open font %s\n", fontstr); |
| 2452 | 2450 | ||
| 2453 | FcPatternDel(pattern, FC_SLANT); | 2451 | FcPatternDel(pattern, FC_WEIGHT); |
| 2454 | FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); | 2452 | FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); |
| 2455 | if(xloadfont(&dc.ibfont, pattern)) | 2453 | if(xloadfont(&dc.ibfont, pattern)) |
| 2456 | die("st: can't open font %s\n", fontstr); | 2454 | die("st: can't open font %s\n", fontstr); |
| 2457 | 2455 | ||
| 2458 | FcPatternDel(pattern, FC_WEIGHT); | 2456 | FcPatternDel(pattern, FC_SLANT); |
| 2459 | FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_MEDIUM); | 2457 | FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ROMAN); |
| 2460 | if(xloadfont(&dc.ifont, pattern)) | 2458 | if(xloadfont(&dc.bfont, pattern)) |
| 2461 | die("st: can't open font %s\n", fontstr); | 2459 | die("st: can't open font %s\n", fontstr); |
| 2462 | 2460 | ||
| 2463 | FcPatternDestroy(pattern); | 2461 | FcPatternDestroy(pattern); |
