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

Missing emojis in rendered gif #65

Open
zeenix opened this issue Jan 2, 2024 · 10 comments
Open

Missing emojis in rendered gif #65

zeenix opened this issue Jan 2, 2024 · 10 comments

Comments

@zeenix
Copy link

zeenix commented Jan 2, 2024

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:

  • OS: Fedora 39.
  • agg: 1.4.3.
@zeenix
Copy link
Author

zeenix commented Jan 2, 2024

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
Copy link
Author

zeenix commented Jan 2, 2024

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
Copy link
Contributor

ku1ik commented Jan 2, 2024

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
Copy link
Author

zeenix commented Jan 2, 2024

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
Copy link
Author

zeenix commented Jan 2, 2024

Those emojis don't look nice

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

@zeenix
Copy link
Author

zeenix commented Jan 3, 2024

@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. 🤔

@ku1ik
Copy link
Contributor

ku1ik commented Oct 27, 2024

I've just released agg 1.5.0 with improved font and emoji rendering: https://github.com/asciinema/agg/releases/tag/v1.5.0
As long as you have Noto Color Emoji font installed on your system it should render color emoji just fine now.

@zeenix
Copy link
Author

zeenix commented Oct 27, 2024

I've just released agg 1.5.0 with improved font and emoji rendering:

Yay!

Noto Color Emoji font installed

There's a bit of a bummer. 😔 My default font supports emojis just fine so ideally this shouldn't be required but oh well. 🤷‍♂️

@ku1ik
Copy link
Contributor

ku1ik commented Oct 27, 2024

Hmm... actually, have you tried without Noto Color Emoji? I only tried with it installed on my Linux machine, and assumed it's the only way, but maybe resvg (which is now a default renderer) can work it out without this font installed? 🤔

@zeenix
Copy link
Author

zeenix commented Oct 28, 2024

actually, have you tried without Noto Color Emoji?

Turns out I had them installed because of another "cli" that needed me to install these fonts. 😢

I did a test of the latest agg from git and it's obvious that it's taking the inferior looking (I think they look great on the Mac only) emojis from the NCE fonts rather than my default font, which is what I'd have preferred. Maybe it would use them if I didn't have NCE fonts installed but I don't know how one goes on about uninstalling fonts and unfortunately wouldn't have the time and energy to uninstall and reinstall them, just to test this.

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

No branches or pull requests

2 participants