Re: [dev][st] Disable bold fonts?

From: Wolfgang Corcoran-Mathe <first.lord.of.teal_AT_gmail.com>
Date: Sun, 30 Mar 2014 12:17:35 -0400

> 2014-03-30 8:09 GMT+03:00 Wolfgang Corcoran-Mathe:
> Obviously, bold fonts are still loaded/unloaded, etc. Has anyone created
> a cleaner and more comprehensive patch to disable bold fonts entirely?

>> On Sun, Mar 30 at 16:50 +0300, Tarmo Heiskanen wrote:
>> I am using this patch to disable both bold font and italics

Thank you, Tarmo. With a minor tweak to make it work with 0.4.1:

================================================================
--- st-0.4.1/st.c.orig 2013-04-20 09:29:39.000000000 -0400
+++ st-0.4.1/st.c 2014-03-30 11:06:19.157465821 -0400
_AT_@ -283,7 +283,7 @@
 /* Drawing Context */
 typedef struct {
         Colour col[LEN(colorname) < 256 ? 256 : LEN(colorname)];
- Font font, bfont, ifont, ibfont;
+ Font font;
         GC gc;
 } DC;
 
_AT_@ -2536,21 +2536,6 @@
         xw.cw = dc.font.width;
         xw.ch = dc.font.height;
 
- FcPatternDel(pattern, FC_SLANT);
- FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC);
- 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);
 }
 
_AT_@ -2573,15 +2558,6 @@
         XftFontClose(xw.dpy, dc.font.match);
         FcPatternDestroy(dc.font.pattern);
         FcFontSetDestroy(dc.font.set);
- XftFontClose(xw.dpy, dc.bfont.match);
- FcPatternDestroy(dc.bfont.pattern);
- FcFontSetDestroy(dc.bfont.set);
- XftFontClose(xw.dpy, dc.ifont.match);
- FcPatternDestroy(dc.ifont.pattern);
- FcFontSetDestroy(dc.ifont.set);
- XftFontClose(xw.dpy, dc.ibfont.match);
- FcPatternDestroy(dc.ibfont.pattern);
- FcFontSetDestroy(dc.ibfont.set);
 }
 
 void
_AT_@ -2721,13 +2697,9 @@
         if(base.mode & ATTR_ITALIC) {
                 if(base.fg == defaultfg)
                         base.fg = defaultitalic;
- font = &dc.ifont;
- frcflags = FRC_ITALIC;
         } else if((base.mode & ATTR_ITALIC) && (base.mode & ATTR_BOLD)) {
                 if(base.fg == defaultfg)
                         base.fg = defaultitalic;
- font = &dc.ibfont;
- frcflags = FRC_ITALICBOLD;
         } else if(base.mode & ATTR_UNDERLINE) {
                 if(base.fg == defaultfg)
                         base.fg = defaultunderline;
_AT_@ -2752,8 +2724,6 @@
                  * 196 - 231 – highest 256 color cube
                  * 252 - 255 – brightest colors in greyscale
                  */
- font = &dc.bfont;
- frcflags = FRC_BOLD;
         }
 
         if(IS_SET(MODE_REVERSE)) {

Received on Sun Mar 30 2014 - 18:17:35 CEST

This archive was generated by hypermail 2.3.0 : Sun Mar 30 2014 - 18:24:06 CEST