asciinema / agg

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

Fira Code Nerd Font doesn't render correctly #44

Closed pieterdd closed 1 year ago

pieterdd commented 1 year ago

(Sidenote: very pleased to discover this official tool from the asciinema team to render recordings to video. Small file sizes, no notable compression artifacts, written in Rust, good job guys!)

Describe the bug agg seems to have trouble rendering some Nerd Font characters that otherwise render normally for me. Here's a comparison of GIF render vs. web player:

image

image

To Reproduce Steps to reproduce the behavior:

  1. Set your terminal font to FiraCode Nerd Font Mono
  2. Start a recording
  3. Trigger the rendering of a character requiring a Nerd Font
  4. Observe that the rendering works correctly locally
  5. Finish the recording and upload it
  6. On the asciinema.org page of your recording, observe that the character doesn't get rendered correctly
  7. Set the 'Terminal font family' setting of your recording to 'Nerd Font - Fira Code' and save
  8. Observe that the character rendering has been fixed on the website
  9. Render the GIF

Expected behavior The character should render correctly in the GIF as well.

Versions:

Additional context I used the Windows Terminal app.

ku1ik commented 1 year ago

Hey Pieter, thanks for appreciation!

I assume you read this section https://github.com/asciinema/agg#fonts ? What's the command line, and how are you specifying the font-family option?

pieterdd commented 1 year ago

Apologies, I had missed that part. When invoked as agg --font-family "FiraCode Nerd Font Mono" testfoo.cast testfoo.gif, this is what I see in the GIF:

image

This is what I see in reality while recording:

image

It's not pixel-perfect, but it does indeed work. I can imagine that these fonts are kinda tricky to work with so I'd be okay closing the thread.

ku1ik commented 1 year ago

Right, making it pixel perfect on all (major) OSes is really hard given font engines' output differs in subtle ways. Not impossible, although I don't have bandwidth to chase this at the moment.

pieterdd commented 1 year ago

I understand, no worries. Thank you for work on this tool regardless!