Closed AlexKurisu closed 3 years ago
That's probably because ligature originally has a very slightly different patch if it's used together with boxdraw: Basic: https://st.suckless.org/patches/ligatures/0.8.3/st-ligatures-20200430-0.8.3.diff With boxdraw: https://st.suckless.org/patches/ligatures/0.8.3/st-ligatures-boxdraw-20200430-0.8.3.diff
The only difference is that without boxdraw hbtransform
at hb.c
has this code towards the end:
/* Apply the transformation to glyph specs. */
for (int i = 0, specidx = 0; i < len; i++) {
if (glyphs[i].mode & ATTR_WDUMMY)
continue;
if (codepoints[i] != specs[specidx].glyph)
((Glyph *)glyphs)[i].mode |= ATTR_LIGA;
specs[specidx++].glyph = codepoints[i];
}
While with boxdraw it has one more check:
/* Apply the transformation to glyph specs. */
for (int i = 0, specidx = 0; i < len; i++) {
if (glyphs[i].mode & ATTR_WDUMMY)
continue;
if (glyphs[i].mode & ATTR_BOXDRAW) {
specidx++;
continue;
}
if (codepoints[i] != specs[specidx].glyph)
((Glyph *)glyphs)[i].mode |= ATTR_LIGA;
specs[specidx++].glyph = codepoints[i];
}
So the fix is probably to change it to be like so:
/* Apply the transformation to glyph specs. */
for (int i = 0, specidx = 0; i < len; i++) {
if (glyphs[i].mode & ATTR_WDUMMY)
continue;
#if BOXDRAW_PATCH
if (glyphs[i].mode & ATTR_BOXDRAW) {
specidx++;
continue;
}
#endif
if (codepoints[i] != specs[specidx].glyph)
((Glyph *)glyphs)[i].mode |= ATTR_LIGA;
specs[specidx++].glyph = codepoints[i];
}
Thanks @avih.
@AlexKurisu can you try with the above change? Also for reference how do you reproduce this issue?
Yep, above change fixed the issue. To reproduce it you could:
const int boxdraw = 1
in config.hThanks @AlexKurisu, yes mc looks interesting without the change.
Thanks for reporting, much appreciated.
@bakkeby the ligature page has also different patches when combined with scrollback and/or alpha - https://st.suckless.org/patches/ligatures/
I didn't check how they differ, but you probably should.
Just checked, the alpha variant doesn't have any actual code changes (just different line number references), and the scrollback patch just adds an if statement. These should be fine.
Nice.
LIGATURES_PATCH for some reason completely breaks rendering of BOXDRAW_PATCH. LukeSmithxyz/st works fine. Here's screenshot: