gnotclub / xst

st fork that uses Xresources and some pretty good patches
MIT License
537 stars 73 forks source link

The plans for Color Emojis #163

Open actionless opened 1 week ago

actionless commented 1 week ago

@neeasade previously mentioned that in the potential todo list (https://github.com/gnotclub/xst/issues/82)

what's your current thoughts on merging in https://github.com/odknt/st ?

i just did a quick smoke-testing and it seems to work:

2024-11-01--1730427703_277x42_scrot

i think together with font2 which we are already supporting (which would fix fontsize for emojis) - it should be looking alright, without problem with the width

actionless commented 1 week ago

also, @odknt, i've noticed that in general by the feature-set your fork of st is quite similar to ours - so mb you'll be interested to develop together one common application?

odknt commented 1 week ago

I have used xst in the past and am interested in improving it, so I may create a PR, though I can't promise.

I have rewritten the source code in my fork to use cairo instead of libxft to support color emoji, but it seems to be supported by libxft since 2.3.5.

Therefore, I believe that xst can display color emoji with a simple modification.

odknt commented 1 week ago

After a little checking of the source code, we found that xst already supports color emoji. I was able to display color emoji by adding color=true to the font attribute specified in st.font_fallback in .Xresources.

Also, the font2 specification in config.h was broken and could not be used. If st.font_fallback in .Xresources is not specified, fonts_count is never set, so the font specified in font2 is never loaded.

actionless commented 1 week ago

did you managed to make it work on practice? 🤔 if so, could you please share the screenshot and the st.font string?

to my knowledge it's not intended to work with colors emojis

actionless commented 6 days ago

oh, my bad, i found the issue in my test setup - i was using Emoji One font which wasn't working, but another font, Noto Color Emoji worked allright - so i think it may be due to svg-format font or smth like that

actionless commented 6 days ago

so after setting it like this it actually worked:

st.font: Monospace:pixelsize=26:antialias=true:autohint=true;
st.font_fallback: Noto Color Emoji:pixelsize=20:color=true,Meslo LG S for Lcarsline:pixelsize=22,DejaVu Sans Mono:pixelsize=25

2024-11-06--1730926914_135x42_scrot

and as i was forseeing, indeed alt_font thing fixed the width problem

actionless commented 6 days ago

also, is there specific reason you chosen to use cairo there, @odknt ?

and btw you're still welcome to join the development as for example another feature you're maintaining in your fork is also in our list: https://github.com/gnotclub/xst/issues/47

actionless commented 6 days ago

Also, the font2 specification in config.h was broken and could not be used.

it was broken when building xst with -flto=auto, but i finally found a moment to fix that: https://github.com/gnotclub/xst/pull/164

odknt commented 6 days ago

also, is there specific reason you chosen to use cairo there, @odknt ?

When I forked st, libxft did not support color emoji. So I had to rewrite it by using cairo.

and btw you're still welcome to join the development as for example another feature you're maintaining in your fork is also in our list: https://github.com/gnotclub/xst/issues/47

I honestly don't know much about SIXEL support, as I just merged patches created by others.