asciinema / agg

asciinema gif generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terminal emoji are not present in gifs

jdoss opened this issue · comments

It looks like emoji that are used in the terminal are not getting processed correctly by agg. Here is the same .cast file on my asciinema.org account

image

vs the gif output from agg.

image

At the moment agg can render b&w emojis with Noto Emoji font. If you install this font system-wide then it should find it and use it automatically. Alternatively, you can download the NotoEmoji-Regular.ttf file, put it in some directory, and pass --font-dir <path/to/that/dir> option which will add this additional dir to agg's font lookup paths.

As for color emojis - agg uses fontdue library for text rendering and this lib doesn't yet support color fonts. See mooman219/fontdue#47 . Once fontdue adds support for it, e.g. for Noto Color Emoji as mentioned in that issue, we'll have it in agg.

I think it should also be possible to install a patched font like Nerd Fonts with embedded emojis, and use it by passing --font-family ... option. I haven't tried it though.

I tested with Nerd Fonts but it turns out Nerd Fonts embed all the fancy stuff like Powerline symbols etc but they don't include unicode emojis. So b&w Noto Emoji font is our friend at the moment.

Closing given this works fine when Noto Emoji font is installed.

What am I doing wrong?

ls $HOME/Downloads/Noto_Emoji/static
NotoEmoji-Bold.ttf  NotoEmoji-Light.ttf  NotoEmoji-Medium.ttf  NotoEmoji-Regular.ttf  NotoEmoji-SemiBold.ttf

agg --font-family=NotoEmoji-Regular --font-dir=$HOME/Downloads/Noto_Emoji/static # omitting the rest
Error: no faces matching font family NotoEmoji-Regular

agg --version
agg 1.2.0

uname -a
Linux x22 5.15.58 #1-NixOS SMP Fri Jul 29 15:25:34 UTC 2022 x86_64 GNU/Linux

@gerhard Just remove --font-family=NotoEmoji-Regular and use --font-dir=$HOME/Downloads/Noto_Emoji/static only.

Works a treat, thank you!