marty-oehme / bemoji

Emoji picker that remembers your favorites, with support for bemenu/wofi/rofi/dmenu and wayland/X11.
MIT License
106 stars 6 forks source link

`noto-fonts-emoji` support ? #25

Closed foxjaw closed 9 months ago

foxjaw commented 10 months ago

I'm not sure if this is only my setup issue but, bemoji outputs empty list. I already have noto-fonts-emoji installed on my arch. I'm using fuzzel btw. Should I do something more ?

LOGS

$[~]$ echo $BEMOJI_PICKER_CMD 
fuzzel --dmenu
$[~]$ bemoji 
info: main.c:1154: version: 1.9.2 +cairo +png +svg(nanosvg) -assertions
info: config.c:1475: loading configuration from /etc/xdg/fuzzel/fuzzel.ini
info: wayland.c:2018: HDMI-A-1: 1920x1080+0x0@60Hz DELL S2216H 21.68" scale=1 PPI=106x108 (physical) PPI=106x108 (logical), DPI=101.60
info: fcft.c:338: fcft: 3.1.6 +graphemes +runs +svg(nanosvg) -assertions
info: fcft.c:377: fontconfig: 2.14.2, freetype: 2.13.2, harfbuzz: 8.3.0, utf8proc: 2.9.0 (Unicode 15.1.0)
info: fcft.c:838: /usr/share/fonts/TTF/iosevka-regular.ttc: size=12.00pt/17px, dpi=101.60
info: main.c:455: theme: hicolor
My fonts.conf ``` sans-serif Noto Sans Open Sans Droid Sans Roboto serif Noto Serif Droid Serif Roboto Slab monospace Iosevka Noto Sans Mono Droid Sans Mono Roboto Mono ```

Fuzzel issue tracker here

marty-oehme commented 9 months ago

Hi @foxjaw,

going by the logs you posted, it seems fcft it does not load the noto-fonts at all.

I have not worked with a fontconfig file in a while but I believe the font family for this noto font may be <family>Noto Color Emoji</family>, <family>Noto Emoji</family>, or something similar and not Noto Sans Mono or one of the serif or sans styles. Also, perhaps it needs a cache refresh with fc-cache for it to grab newly preferred families.

In the end though, I am not sure how this could be due to bemoji itself - we just create a list of emoji and send it on to other pickers (in this case fuzzel). Perhaps you can manually copy a few emoji from here and feed them into fuzzel to see if it displays them correctly on its own?

foxjaw commented 9 months ago

noto-fonts-emoji is a font btw. I think you wrote bemoji in a way where it does not support emoji fonts at all. And only supports text files preloaded with emoji per line.

Right now I'm using rofimoji (which works with noto-fonts-emoji) with fuzzel as picker. Works without any issue.

marty-oehme commented 9 months ago

noto-fonts-emoji is a font btw. I think you wrote bemoji in a way where it does not support emoji fonts at all.

noto-fonts-emoji is an Archlinux package containing the NotoColorEmoji font - it is the reason I have suggested for you to include it in preferred font families. I am also confident bemoji 'supports' emoji fonts since I am personally using it with exactly the noto package you mentioned, only with bemenu instead of fuzzel (and, as mentioned above it is really the pickers that do all the heavy font-related lifting).

And only supports text files preloaded with emoji per line.

I am either not sure what this means or how you suppose displaying fonts on a system functions.

Unfortunately, I believe I am not sure how to help further with your issues, but am glad to hear you found an alternative that works for you. Should we close this issue then?

foxjaw commented 9 months ago

Tqvm for explanation. Can you provide your font config ? I'm not sure how to prefer noto emoji font family.
rofimoji is little buggy though.

I have read archwiki & it states we're required to set font fallbacks as match_tests

marty-oehme commented 9 months ago

Sure, my full fontconfig is here. However, I am fairly sure this will not help you a lot in your issue. From what I can see, I would assume the font-handling library in fuzzel does not pick up the right emoji font for you.

I can tell you that, should you be using a similar layout to mine, you want to look closely at the monospace family and add Noto Emoji Color towards the top of it. So that in the end it looks a little like:

  <alias>
    <family>monospace</family>
    <prefer><family>Noto Color Emoji</family></prefer>
    <prefer><family>Iosevka</family></prefer>
  </alias>

with the second font being whatever you actually want to use to display the monospace fonts on your system (Probably something like Iosevka, Source Code Pro, Jetbrains Mono similar).

The log line info: fcft.c:838: /usr/share/fonts/noto/NotoColorEmoji.ttf should appear somewhere in your terminal when you start fuzzel with any emoji piped in. If it does not then double check that the /usr/share/fonts/noto/NotoColorEmoji.ttf file exists on your system.

Ultimately, the most probable cause is that some other font supplies its own smaller set of emojis or place holders and Noto Emoji is never called upon to provide its icons - that's why you want to 'prefer' it to other fonts somewhere along the line.

Hope that helps - if it still does not I can probably also not help out any further. You might have more luck asking in the Archlinux forums directly then!

foxjaw commented 9 months ago

@marty-oehme This before Iosevka worked

<family>Noto Color Emoji</family>

But what I said in this comment is still true. Caz bemoji generates a txt file in .local/share/bemoji/emojis.txt by parsing noto-color-emoji.ttf which is not how I expect it to work.