Skip to content

Instantly share code, notes, and snippets.

@IgnoredAmbience
Last active May 8, 2024 06:50
Show Gist options
  • Save IgnoredAmbience/7c99b6cf9a8b73c9312a71d1209d9bbb to your computer and use it in GitHub Desktop.
Save IgnoredAmbience/7c99b6cf9a8b73c9312a71d1209d9bbb to your computer and use it in GitHub Desktop.
Noto Emoji Color fontconfig for Konsole
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
Usage:
0. Ensure that the Noto fonts are installed on your machine.
1. Install this file to ~/.config/fontconfig/conf.d/99-noto-mono-color-emoji.conf
2. Run `fc-cache`
3. Set Konsole to use "Noto Mono" as the font.
4. Restart Konsole.
-->
<fontconfig>
<match>
<test name="family"><string>Noto Mono</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Color Emoji</string>
</edit>
</match>
</fontconfig>
@Geremia
Copy link

Geremia commented May 24, 2022

Using this 99-noto-mono-color-emoji.conf, not all my emojis are color in Konsole:
Screenshot_20220524_141210_trimmed

Also, setting the Konsole font to "Noto Mono" doesn't seem necessary. It was set to Hack in the above image.

@gunslingerfry
Copy link

gunslingerfry commented Oct 7, 2022

The reason why some of the emojis don't work for abcfy2 is because it's not handling the multi-code emojis (called grapheme clusters, or zwj sequence). For example LGBT flag 🏳️‍🌈: looks like this in konsole: 🏳<fe0f><200d>🌈
The empty flag + <fe0f> the 16th 'variation selector' character (indicating color, I believe) + <200d> is the zero width joiner + rainbow

How to fix it, I don't know.

@pabsan-0
Copy link

This distorted my terminal default font too, making it appear shorter and wider. Removing the binding="strong" from the original example worked for me.

As noted in some comment above, I also swapped the Noto Mono for my konsole's monospace.

Thanks a bunch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment