From ff997a5ff2e561fbeac590b590bd8e7c6d2a920b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 14 Nov 2025 12:29:18 -0600 Subject: apply boxdraw patch for perfect box-drawing character alignment Applied st-boxdraw_v2-0.8.5.diff with manual adjustments for st 0.9: - Added boxdraw.c to build sources - Added ATTR_BOXDRAW attribute flag (bit 13, after ATTR_SELECTED) - Integrated boxdraw detection in tsetchar() function - Modified xmakeglyphfontspecs() to use boxdraw for applicable characters - Adjusted indentation for harfbuzz integration compatibility Benefits: - Box-drawing characters now align perfectly regardless of font - Improved visual quality for tmux, tree, dialog output - Covers Unicode U2500-U259F (lines/blocks) and U28XX (braille) --- st.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'st.h') diff --git a/st.h b/st.h index d16f417..e320538 100644 --- a/st.h +++ b/st.h @@ -36,6 +36,7 @@ enum glyph_attribute { ATTR_WIDE = 1 << 10, ATTR_WDUMMY = 1 << 11, ATTR_SELECTED = 1 << 12, + ATTR_BOXDRAW = 1 << 13, ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, }; @@ -118,6 +119,14 @@ void *xmalloc(size_t); void *xrealloc(void *, size_t); char *xstrdup(const char *); +int isboxdraw(Rune); +ushort boxdrawindex(const Glyph *); +#ifdef XFT_VERSION +/* only exposed to x.c, otherwise we'll need Xft.h for the types */ +void boxdraw_xinit(Display *, Colormap, XftDraw *, Visual *); +void drawboxes(int, int, int, int, XftColor *, XftColor *, const XftGlyphFontSpec *, int); +#endif + /* config.h globals */ extern char *utmp; extern char *scroll; @@ -131,3 +140,4 @@ extern unsigned int tabspaces; extern unsigned int defaultfg; extern unsigned int defaultbg; extern unsigned int defaultcs; +extern const int boxdraw, boxdraw_bold, boxdraw_braille; -- cgit v1.2.3