diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-14 12:29:18 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-14 12:29:18 -0600 |
| commit | ff997a5ff2e561fbeac590b590bd8e7c6d2a920b (patch) | |
| tree | c78c4af66ba113c96fb52d3dbf79c082ba7d33f8 /st.h | |
| parent | 88fdb847bfc5c735a32cade72abf0dfaaa11ac5a (diff) | |
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)
Diffstat (limited to 'st.h')
| -rw-r--r-- | st.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; |
