nbedos / termtosvg

Record terminal sessions as SVG animations
https://nbedos.github.io/termtosvg/
BSD 3-Clause "New" or "Revised" License
9.71k stars 436 forks source link

powerline fonts have mangled output #14

Open gvoysey opened 6 years ago

gvoysey commented 6 years ago

on ubuntu 16.04, firefox 60.0.2, a recorded session shows mangled powerline fonts in my oh-too-blingy zsh config.

compare static png: image attached SVG:

rendered.zip

immanuelfodor commented 6 years ago

Same here. I use https://github.com/chris-marsh/pureline with Noto Mono on Manjaro Linux, and the special characters in the SVG are unrecognizable. Even when I try to provide the --font="Noto Mono" parameter.

nbedos commented 6 years ago

Yeah, I noticed that with powerline fonts. I have no idea why the output is mangled though. All characters of a line in the SVG animation have the same vertical position and font size. What's the difference between powerline fonts and regular fonts?

immanuelfodor commented 6 years ago

Supporting more characters out of the box I think. However, asciinema recordings are fine...

~ Sent from my mobile

On Wed, Jul 4, 2018, 21:11 Nicolas Bedos notifications@github.com wrote:

Yeah, I noticed that with powerline fonts. I have no idea why the output is mangled though. All characters of a line in the SVG animation have the same vertical position and font size. What's the difference between powerline fonts and regular fonts?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nbedos/termtosvg/issues/14#issuecomment-402545145, or mute the thread https://github.com/notifications/unsubscribe-auth/AUMXW-ZfaRpj4FAB90aAYCFYS9RW7Qo_ks5uDRN7gaJpZM4VBYRQ .

gvoysey commented 6 years ago

What's the difference between powerline fonts and regular fonts?

I'm not sure in general. In my case, i'm using https://github.com/abertsch/Menlo-for-Powerline

ylmrx commented 6 years ago

I use the Nerd Font package and Tilix as a terminal emulator, it shows the same behavior for many of the fonts (within the terminal emulator and the browser). (these size problems come and go with the commit on the font repo side) So, it's related to the font itself and pyte (the python library in charge of rendering a cool term window). hard to correct it in termtosvg.

@immanuelfodor : Maybe you unchecked the "allow webpage to specify font" in preferences > display > advanced (I had the very same problem). If you specify the font, it should be more like : "Noto Mono for Powerline" or something like this (I don't think Noto Mono will carry the "powerline" cool chars)

immanuelfodor commented 6 years ago

@ylmrx nope, it's untouched (default checked) in my FF.

I tried termtosvg --font "Noto Mono for Powerline" but it does not help. However, the Hack font works well, so it must be an issue with Noto Mono as you suggested in your last sentence.

BTW does this mean that the user viewing the recording should have the font installed on his/her machine? Or is the font embedded into the SVG so the output is multiplatform and environment independent?

ylmrx commented 6 years ago

The SVG doesn't include the font. You need to have the specific font installed. It's not too bad as there's a failover font "monospace" (which your browser links to a default one), and it's platform-independent. However, this won't be a "powerline"-friendly (as it's perfectly non-standard)

gvoysey commented 6 years ago

The SVG doesn't include the font. You need to have the specific font installed.

Which is interesting, because even when this is true the powerline output is still off.

amcgregor commented 5 years ago

The SVG doesn't include the font. You need to have the specific font installed.

Which is interesting, because even when this is true the powerline output is still off.

I present my hand-massaged ("mangled") clone of window_frame_js named hasklug-apprentice-progressive-window-compact, updated to:

SVG with embedded font.

Here's an example utilizing the Powerline symbols of that font in my Zsh and Vim setup:

SVG with embedded font using Powerline symbols.

marcstreeter commented 4 years ago

same here, I probably will just open regular terminal window and record from there until this is figured out.