sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 1b82f3af307734c0be05241d35751bc0593c339d
parent 899f6289bb3d1081eb2a886bc93651b4e63f16d8
Author: Szabolcs Nagy <nsz@port70.net>
Date:   Sat,  3 Nov 2012 00:28:39 +0100

add st boldcolor patch
Diffstat:
Ast.suckless.org/patches/boldcolor.md | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Ast.suckless.org/patches/index.md | 4++++
Ast.suckless.org/patches/st-0.3-boldcolor.diff | 52++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+), 0 deletions(-)

diff --git a/st.suckless.org/patches/boldcolor.md b/st.suckless.org/patches/boldcolor.md @@ -0,0 +1,49 @@ +boldcolor +========= + +Description +----------- + +This is a hack to allow using different color for bold, italic +or underlined text when the text is in defaultfg color otherwise. + +Makes the special attributes more visible, when no bold or italic +font is available, or the defaultfg is a special color (>255 value). + +Usage +----- + +example config.h + + static const char *colorname[] = { + // ... + [255]=0, + // extra + "#00cc00", + "#333333", + "#cdba96", + "#99ff00", + "#ffff00", + }; + + static unsigned int defaultfg = 7; + static unsigned int defaultbg = 0; + static unsigned int defaultcs = 256; + static unsigned int defaultucs = 257; + // we don't want bold font (dc.bfont == dc.font) + #define NOBOLDFONT 1 + // we have extra colors to mark bold, italic and underline + #define DEFAULTBOLD 258 + #define DEFAULTITALIC 259 + #define DEFAULTUNDERLINE 260 + +Download +-------- +* [st-0.3-boldcolor.diff][0] + +[0]: st-0.3-boldcolor.diff + +Author +------ + + * Szabolcs Nagy - nsz diff --git a/st.suckless.org/patches/index.md b/st.suckless.org/patches/index.md @@ -0,0 +1,4 @@ +Patches +------- +Much like the [dwm patches](http://dwm.suckless.org/patches/) but for st. + diff --git a/st.suckless.org/patches/st-0.3-boldcolor.diff b/st.suckless.org/patches/st-0.3-boldcolor.diff @@ -0,0 +1,52 @@ +diff -r db4f3f0ef420 st.c +--- a/st.c Fri Nov 02 20:08:51 2012 +0100 ++++ b/st.c Sat Nov 03 00:19:19 2012 +0100 +@@ -2260,8 +2260,10 @@ + xw.cw = dc.font.width; + xw.ch = dc.font.height; + ++#ifndef NOBOLDFONT + FcPatternDel(pattern, FC_WEIGHT); + FcPatternAddInteger(pattern, FC_WEIGHT, FC_WEIGHT_BOLD); ++#endif + if(xloadfont(&dc.bfont, pattern)) + die("st: can't open font %s\n", fontstr); + +@@ -2397,6 +2399,10 @@ + /* greyscale */ + fg = &dc.xft_col[base.fg + 4]; + } ++#ifdef DEFAULTBOLD ++ if(base.fg == defaultfg) ++ fg = &dc.xft_col[DEFAULTBOLD]; ++#endif + /* + * Those ranges will not be brightened: + * 8 - 15 – bright system colors +@@ -2406,10 +2412,22 @@ + font = &dc.bfont; + } + +- if(base.mode & ATTR_ITALIC) +- font = &dc.ifont; +- if(base.mode & (ATTR_ITALIC|ATTR_ITALIC)) +- font = &dc.ibfont; ++ if(base.mode & ATTR_ITALIC) { ++ if(base.mode & ATTR_BOLD) { ++ font = &dc.ibfont; ++ } else { ++ font = &dc.ifont; ++#ifdef DEFAULTITALIC ++ if(base.fg == defaultfg) ++ fg = &dc.xft_col[DEFAULTITALIC]; ++#endif ++ } ++ } ++ ++#ifdef DEFAULTUNDERLINE ++ if((base.mode & ATTR_UNDERLINE) && base.fg == defaultfg) ++ fg = &dc.xft_col[DEFAULTUNDERLINE]; ++#endif + + if(IS_SET(MODE_REVERSE)) { + if(fg == &dc.xft_col[defaultfg]) {