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

Nerd Font icons are not displayed #64

Open
qgrp-m-kondratenko opened this issue Dec 30, 2023 · 2 comments
Open

Nerd Font icons are not displayed #64

qgrp-m-kondratenko opened this issue Dec 30, 2023 · 2 comments

Comments

@qgrp-m-kondratenko
Copy link

qgrp-m-kondratenko commented Dec 30, 2023

Describe the bug
When rendering the cast containing icons from Nerd Fonts, the icons are not displayed in the resulting gif.

To Reproduce
Steps to reproduce the behavior:

  1. Create /tmp/test.cast from test.zip. It contains a recording of bash shell that uses starship with Nerd Font icons.
  2. View the recording with ascinema play /tmp/test.cast. Nerd Font icons are displayed properly.
    play
  3. Generate gif agg --font-family 'FiraCode Nerd Font' /tmp/test.cast /tmp/out.gif.
  4. View the gif firefox /tmp/out.gif.
  5. See the missing icons.
    out

Expected behavior
Icons are supposed to be visible the same way as when using ascinema play /tmp/test.cast

Versions:

  • OS: Fedora Linux 39
  • agg: 1.4.3

Additional Context:

agg -vvv --font-family 'FiraCode Nerd Font' /tmp/test.cast /tmp/out.gif
[INFO  agg] terminal size: 135x34
[INFO  agg] selected font families: ["FiraCode Nerd Font"]
[INFO  agg] selected theme: dracula
[DEBUG agg::renderer::fontdue] looking up font for families=["FiraCode Nerd Font"], weight=400, style=Normal
[DEBUG agg::renderer::fontdue] found font with id=ID(380)
[INFO  agg] gif dimensions: 1180x686
[DEBUG agg::renderer::fontdue] looking up font for families=["FiraCode Nerd Font"], weight=700, style=Normal
[DEBUG agg::renderer::fontdue] found font with id=ID(440)
[DEBUG agg::renderer::fontdue] looking up font for families=["FiraCode Nerd Font"], weight=400, style=Normal
[DEBUG agg::renderer::fontdue] found font with id=ID(380)
2 / 2 [======] 100.00 % 5.05/s [INFO  agg] rendering finished in 0.39664295s
@ku1ik
Copy link
Contributor

ku1ik commented Feb 14, 2024

I see that the branch icon (between "on" and "main") is rendered correctly, so that means the Nerd Font is loaded and used fine.

The package and duck icons are emojis. agg doesn't support color emojis, but you can have monochrome emojis rendered with Noto Emoji font as explained here.

So the most of this is expected and working as intended. The only thing which I'm not sure about is the missing up arrow after the $ sign... It's not an emoji, so should have rendered with FiraCode Nerd Font. Can you try with another Nerd Font, e.g. JetBrains Mono?

@qgrp-m-kondratenko
Copy link
Author

@ku1ik Changing the font to "JetBrainsMono NF" produced the exact same result.
However changing the renderer to "--renderer resvg" more or less fixed the issue for both fonts.
The icons are displayed, just not the way they are displayed in the terminal.

agg -vvv --font-family 'FiraCode Nerd Font' --renderer resvg test.cast out.gif
[INFO  agg] terminal size: 135x34
[INFO  agg] selected font families: ["FiraCode Nerd Font"]
[INFO  agg] selected theme: dracula
[INFO  agg] gif dimensions: 1151x686
[WARN  usvg_text_layout] Fallback from FiraCode Nerd Font to Symbola.
[WARN  usvg_text_layout] Fallback from FiraCode Nerd Font to Symbola.
[WARN  usvg_text_layout] Fallback from FiraCode Nerd Font to Symbola.
2 / 2 [===============================] 100.00 % 13.56/s [INFO  agg] rendering finished in 0.14776781s

out

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