--- config.def.h | 11 ++++++++++- x.c | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/config.def.h b/config.def.h index 482901e..47c4004 100644 --- a/config.def.h +++ b/config.def.h _AT_@ -23,10 +23,19 @@ char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; /* identification sequence returned in DA and DECID */ char *vtiden = "\033[?6c"; -/* Kerning / character bounding-box multipliers */ +/* Kerning / character bounding-box configuration. There are two ways to + * configure this: using scaling factors (cwscale and chscale) in which the + * bounding box is computed by multiplying the dimensions returned by + * Fontconfig by the scaling factors or absolute dimensions in pixels (cwidth + * and cheight). The cwscale factor is only used if cwidth is 0, and the + * chscale factor is only used if cheight is 0. + */ static float cwscale = 1.0; static float chscale = 1.0; +static unsigned int cwidth = 0; +static unsigned int cheight = 0; + /* * word delimiter string * diff --git a/x.c b/x.c index 5828a3b..b55b5ad 100644 --- a/x.c +++ b/x.c _AT_@ -956,8 +956,8 @@ xloadfonts(char *fontstr, double fontsize) } /* Setting character width and height. */ - win.cw = ceilf(dc.font.width * cwscale); - win.ch = ceilf(dc.font.height * chscale); + win.cw = ceilf(cwidth ? cwidth : dc.font.width * cwscale); + win.ch = ceilf(cheight ? cheight : dc.font.height * chscale); FcPatternDel(pattern, FC_SLANT); FcPatternAddInteger(pattern, FC_SLANT, FC_SLANT_ITALIC); -- 2.20.1Received on Wed Jul 10 2019 - 22:42:13 CEST
This archive was generated by hypermail 2.3.0 : Thu Jul 11 2019 - 00:00:39 CEST