sergei-grechanik / st-graphics

A fork of the simple terminal that supports the kitty graphics protocol
MIT License
15 stars 2 forks source link

Unable to patch it with st-ligatures #2

Closed prateekshukla1108 closed 1 month ago

prateekshukla1108 commented 2 months ago

I can't figure out which of the patches will work

sergei-grechanik commented 2 months ago

Try this branch (or cherry-pick the head commit): https://github.com/sergei-grechanik/st-graphics/tree/graphics-with-ligatures There were quite a few conflicts, mostly straightforward, but most importantly I had to slightly modify the hbtransform function in hb.c:

    /* Fill buffer with codepoints. */
    for (rune_idx = 0, glyph_idx = start; glyph_idx < end; glyph_idx++, rune_idx++) {
        hbrunebuffer.runes[rune_idx] = glyphs[glyph_idx].u;
        mode = glyphs[glyph_idx].mode;
        if (mode & ATTR_WDUMMY)
            hbrunebuffer.runes[rune_idx] = 0x0020;
        /* Draw spaces for image placeholders. */
        if (mode & ATTR_IMAGE)
            hbrunebuffer.runes[rune_idx] = 0x0020;
    }

Both ligatures and images seem to work, but I haven't tested it extensively.

sergei-grechanik commented 1 month ago

Fixed a couple of bugs and mentioned the patch in the readme, closing as done.

prateekshukla1108 commented 1 month ago

great I think that adding features like font2 boxdraw scrollback geometry and xresources will make it very much usable and better than most of the terminals