asciinema / agg

asciinema gif generator
Apache License 2.0
1.12k stars 38 forks source link

Missing emojis in rendered gif #65

Open zeenix opened 6 months ago

zeenix commented 6 months ago

Describe the bug

I wanted to create a gif of my gimoji project in action to put in the README. However, turns out that agg is for some reason not able to render the emoji characters. Attaching both the cast (had to mart it as txt to satisfy Github) and generated gif.

gimoji gimoji.txt

To Reproduce Steps to reproduce the behavior:

  1. Record an asciinema cast with a gimoji run.
  2. Use agg to convert to gif.
  3. See all the missing emojis.

Expected behavior Emojis to be there in the gif.

Versions:

zeenix commented 6 months ago

Oh and keep in mind that in my example, i'm indirectly launching gimoji through a git commit hook (the usual way to use it) but it can be launched directly.

zeenix commented 6 months ago

I think this is related to (probably a duplicate even of) #19. As you can see, I'm also using starship and the emojis in the prompt are missing from the gif as well. I think 1.4 didn't fix #19.

ku1ik commented 6 months ago

Works for me:

$ agg -v --font-size 28 gimoji.{cast,gif}
[INFO  agg] terminal size: 113x29
[INFO  agg] selected font families: ["JetBrains Mono", "Fira Code", "DejaVu Sans Mono", "Liberation Mono", "DejaVu Sans", "Noto Emoji"]
[INFO  agg] selected theme: dracula
[INFO  agg] gif dimensions: 1932x1176
42 / 42 [===================================================================] 100.00 % 34.95/s
[INFO  agg] rendering finished in 1.202138s

gimoji

Have you read https://github.com/asciinema/agg#emoji and have Noto Emoji font installed?

When you run agg with -v option it shows what fonts it detected, and Noto Emoji must be there for emoji rendering to work.

zeenix commented 6 months ago

Have you read https://github.com/asciinema/agg#emoji and have Noto Emoji font installed?

Oh, I had not. Thanks.

Currently agg supports only monochrome emojis via Noto Emoji font.

That's a bit sad. Those emojis don't look nice and wouldn't make for a good demo gif. The main point is to impress people on their first visit to the repo and crates.io page. :)

It would be great if agg would use my system fonts (as I'd expect it to), especially since it's a native binary running directly on the system.

zeenix commented 6 months ago

Those emojis don't look nice

To see what i mean, have a look at our current screenshot in the README

zeenix commented 6 months ago

@ku1ik also I see that in your run, you also get the strange blue background. That makes it even worse. I wonder how starfish folks managed to produce their gif, which doesn't seem to have this emoji issue. 🤔