Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grey incomplete list of emojis through krunner #1

Closed
Bumbadawg opened this issue Aug 27, 2019 · 17 comments
Closed

Grey incomplete list of emojis through krunner #1

Bumbadawg opened this issue Aug 27, 2019 · 17 comments
Labels
documentation Improvements or additions to documentation

Comments

@Bumbadawg
Copy link

Screenshot_20190827_192327
I set the emoticon in KDE settings to various packs but it didn't change.
Also i can't find the configuration window, nor the executable to run from CLI. Hints to get colourful full list of emojis ?

@Bumbadawg
Copy link
Author

Emojis work fine in other application like Steam/Firefox, but not Krunner.

@alex1701c
Copy link
Owner

alex1701c commented Sep 14, 2019

Sorry for answering so late, I haven't received a notification 😶

The full list of emojis is in the settings dialog, you can find in in the System Settings and then "Plasma Search" or the settings icon on the left side of Krunner.
If you have launched it you have to search for "EmojiRunner" .

krunner
configure

@alex1701c
Copy link
Owner

alex1701c commented Sep 14, 2019

After a lot of testing I found a simple solution 😇
I have tried in on a new KUbuntu 18.04 install with KDE Plasma 5.12 LTS and
I have only executed the following instructions:

Copy the config file to ~/.config/fontconfig/fonts.conf:
fonts.conf.txt
The file has a .txt extension because I can't attach a .conf file.

Install nerd-fonts from Github.
fonts-emojione and fonts-noto-color-emoji from your package manager.

After installing these packages run fc-cache -f -v and reboot.

@Bumbadawg Thank you for mentioning this issue and if you encounter other problems feel free to ask 😀.
PS: The new version of the EmojiRunner pastes the emojis significantly faster so I would recommend to install the new version.

@alex1701c alex1701c added the documentation Improvements or additions to documentation label Sep 14, 2019
@Bumbadawg
Copy link
Author

Wonderful, i switched back to breeze emojis, installed those fonts, cleaned the font cache, reboot and it works !
PS: latest update: the .local/share/emojirunner/paste.py is owned by root, you should demote any user files to user rights.

@alex1701c
Copy link
Owner

First of all I am happy that it works !👍

And you are right regarding the user permissions issue, but this Python script has been removed.
Now the plugin uses xdotool to emit Ctrl+V, this is way faster and resource lighter.

@Bumbadawg
Copy link
Author

Indeed for the folder. Thanks for your work, it's very useful to spam eggplants followed by communicative sweat drops to my mates.
+1 for xdotool. Keep up the good work

@Bumbadawg
Copy link
Author

going back to you, the font.conf actually messed up my system fonts for MPV, how would you set EmojiOne as "append" only for this kwin script ?

@Bumbadawg Bumbadawg reopened this Sep 23, 2019
@alex1701c
Copy link
Owner

alex1701c commented Sep 23, 2019

First of all how does MVP look like in your case ?

But going back to your idea: You can actually change the modes and binding properties so that EmojiOne is used as a fallback.
And maybe you can try to remove the lines where the mode="assign" .

As far as I know there is no way to change the font for just one application, but I am by all means
no expert when it comes to Linux fonts.

Maybe https://www.omgubuntu.co.uk/2016/03/enable-color-emoji-linux-svg-font can help you.

I hope that you have now at least a starting point for fixing this issue 🙃

PS: Do the fonts work fine in MVP if you have the fonts.conf removed and what distro are you running?

Edit: Can you try this fontconfig out ? It is maybe less "aggressive" 😅

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

    <dir>~/.fonts</dir>
    <dir>/usr/share/fonts</dir>

    <match target="font">
        <edit mode="assign" name="lcdfilter"><const>lcddefault</const></edit>
        <edit mode="assign" name="autohint"><bool>false</bool></edit>
    </match>

    <match target="pattern">
        <test qual="any" name="family"><string>monospace</string></test>
        <edit name="family" mode="append" binding="strong"><string>EmojiOne</string></edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family"><string>serif</string></test>
        <edit name="family" mode="append" binding="strong"><string>EmojiOne</string></edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family"><string>sans-serif</string></test>
        <edit name="family" mode="append" binding="strong"><string>EmojiOne</string></edit>
    </match>
</fontconfig>

@Bumbadawg
Copy link
Author

IT JUST WORKS.

@Bumbadawg
Copy link
Author

PS: My distro is KDE Neon (ubuntu 18.04 + KDE 5.16).

@alex1701c
Copy link
Owner

IT JUST WORKS.

Thanks for the quick feedback, I will add a section for this to the README.md

@alex1701c
Copy link
Owner

Well, I have used this config over the day and noted that in some occasions simple digits are replaced with emojis for instance 1 gets shown as 1️⃣ .
This only happens on some occasions, that's why I haven't noticed it when writing the initial fix.

The reason for this is that the digit 1 is available in two fonts (the original and appended one) but because the binding of the emoji font is set to strong the emoji font is chosen. If the binding would be set to weak the (sometimes uncolored) emojis of the original font would be used.

I have done some digging and tried a lot of tweaks and I came up with a modified version of the archived emojione-color Github repo.
I have tested it and it seems to work with Krunner, Firefox, Konsole and MPV, it would be
very nice if you could try it out and give feedback 😃

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
    <test name="family" compare="eq">
        <string>Bitstream Vera Serif</string>
    </test>
    <edit name="family" mode="assign_replace">
      <string>Bitstream Vera Serif</string>
    </edit>
    <edit name="family" mode="append_last">
      <string>serif</string>
    </edit>
  </match>

  <match>
    <test qual="any" name="family">
        <string>serif</string>
    </test>
    <edit name="family" mode="prepend_first">
      <string>Bitstream Vera Serif</string>
    </edit>
    <edit name="family" mode="prepend_first">
      <string>EmojiOne</string>
    </edit>
  </match>

  <match target="font">
    <test name="family" compare="eq">
        <string>Bitstream Vera Sans</string>
    </test>
    <edit name="family" mode="assign_replace">
      <string>Bitstream Vera Sans</string>
    </edit>
    <edit name="family" mode="append_last">
      <string>sans-serif</string>
    </edit>
  </match>

  <match target="pattern">
    <test qual="any" name="family">
        <string>sans-serif</string>
    </test>
    <edit name="family" mode="prepend_first">
      <string>Bitstream Vera Sans</string>
    </edit>
    <edit name="family" mode="prepend_first">
      <string>EmojiOne</string>
    </edit>
  </match>

  <match target="font">
    <test name="family" compare="eq">
        <string>Bitstream Vera Sans Mono</string>
    </test>
    <edit name="family" mode="assign_replace">
      <string>Bitstream Vera Sans Mono</string>
    </edit>
    <edit name="family" mode="append_last">
      <string>monospace</string>
    </edit>
  </match>

  <match target="pattern">
    <test qual="any" name="family">
        <string>monospace</string>
    </test>
    <!--
    Make Bitstream Vera Sans Mono the first result
    Note: If you want a different monospace font, this is where you change it.
    -->
    <edit name="family" mode="prepend_first">
      <string>Bitstream Vera Sans Mono</string>
    </edit>
    <edit name="family" mode="prepend_first">
      <string>EmojiOne</string>
    </edit>
  </match>

  <alias binding="strong">
    <family>emoji</family>
    <default><family>EmojiOne</family></default>
  </alias>

  <!-- Alias requests for the other emoji fonts -->
  <alias binding="strong">
    <family>Apple Emoji</family>
    <prefer><family>EmojiOne</family></prefer>
    <default><family>sans-serif</family></default>
  </alias>
  <alias binding="strong">
    <family>Segoe UI Emoji</family>
    <prefer><family>EmojiOne</family></prefer>
    <default><family>sans-serif</family></default>
  </alias>
  <alias binding="strong">
    <family>Noto Emoji</family>
    <prefer><family>EmojiOne</family></prefer>
    <default><family>sans-serif</family></default>
  </alias>
</fontconfig>

@alex1701c alex1701c reopened this Sep 23, 2019
@Bumbadawg
Copy link
Author

I confirm i had those blue one all around. Now with the latest build of emojione + your fonts.conf i don't have them anymore. But so are the emojis in krunner, even after a font cache cleanup.

@alex1701c
Copy link
Owner

At this point I can only recommend to try the https://github.com/eosrei/twemoji-color-font fonts and their fontconfig out, because I can't reproduce this issue, sorry.

Btw: The reason the emojis work in Steam and Firefox is that they handle the emojis themselves, while this Krunner plugin uses you system wide configuration.

I hope that you can figure this issue somehow out 😃.

@IlabSentuser
Copy link

Hello. I am having the gray emojis problem. I already checked everything stated here when i installed it. I managed to make it work for a short but unknown period of time, i am not sure if it stopped working after i updated the system or after a certain library got updated. I just noticed that color was gone today. I have followed the instructions here but this time i cant get it working. I am a linux vegan (i use arch btw hahaha) One thing thats definitively important, i am sure, is that before if i went to the config i could see the colored emojis there. But now they are all grey. I have installed the packages stated here and rebooted. Any idea?

@IlabSentuser
Copy link

Thanks a lot @fabianski7 i did as stated in that post and i have it working now, i also learned a little about the problem so i really appreciate that you pointed out those links. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants