diff --git a/options.h b/options.h index 8d4ae9d..69601da 100644 --- a/options.h +++ b/options.h @@ -10,7 +10,7 @@ * * Font options */ -static char *font[] = { "Cascadia Code PL:size=8:style=Bold:antialias=true:autohint=true", +static char *font[] = { "Fantasque Sans Mono:size=8:style=Bold:antialias=true:autohint=true", "DejaVu Sans Mono:size=8:antialias=true:autohint=true", "Noto Color Emoji:size=8:antialias=true:autohint=true", "fontawesome:size=8:antialias=true:autohint=true", @@ -31,6 +31,10 @@ char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; static float cwscale = 1.0; static float chscale = 1.0; +/* Character rendering offsets in pixels */ +static float cxoffset = 0; +static float cyoffset = 0; + /* Text drawing options */ static int brightbold = 0; /* Should bright text also be bold? */ static unsigned int cols = 80; /* Number of columns */ diff --git a/x.c b/x.c index e50a99a..5e79828 100644 --- a/x.c +++ b/x.c @@ -1532,8 +1532,8 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x if (glyphidx) { specs[numspecs].font = font->match; specs[numspecs].glyph = glyphidx; - specs[numspecs].x = (short)xp; - specs[numspecs].y = (short)yp; + specs[numspecs].x = (short)xp + cxoffset; + specs[numspecs].y = (short)yp + cyoffset; xp += runewidth; numspecs++; continue; diff --git a/xresources.h b/xresources.h index 4274707..98c68ad 100644 --- a/xresources.h +++ b/xresources.h @@ -47,4 +47,6 @@ ResourcePref resources[] = { { "statalpha", FLOAT, &statalpha }, { "cwscale", FLOAT, &cwscale }, { "chscale", FLOAT, &chscale }, + { "cyoffset", FLOAT, &cyoffset }, + { "cxoffset", FLOAT, &cxoffset }, };