asciinema / asciicast2gif

Generate GIF animations from asciicasts (asciinema recordings)
MIT License
1.2k stars 83 forks source link

some characters are not visible #45

Closed igordot closed 2 years ago

igordot commented 6 years ago

I tried converting a recording to a GIF.

docker run --rm -v $PWD:/data asciinema/asciicast2gif https://asciinema.org/a/193932.json 193932.gif

The original on the website looks fine: asciicast

But as you can see, the GIF is not: 193932

In a possibly related issue, the thumbnail on the website is fine, but not in the embed.

ku1ik commented 5 years ago

It looks to me like the Docker image is missing some fallback fonts. It's based on Ubuntu, and we only install Bitstream Vera Mono font explicitly: https://github.com/asciinema/asciicast2gif/blob/master/Dockerfile#L37

dnozay commented 4 years ago

There is a copy of Bistream Vera Mono that has been patched with a lot of symbols: https://github.com/ryanoasis/nerd-fonts Powerline symbols is nice, but does not cover all the symbols used in other popular zsh themes, eg. powerlevel9k and powerlevel10k

With default docker image: test2

Tested locally, adding the patched font in the system:

FROM asciinema/asciicast2gif
COPY BitstreamVeraSansMonoNerdFontComplete.ttf /usr/share/fonts/truetype

test

dnozay commented 4 years ago
FROM asciinema/asciicast2gif

# for unicode emojis
RUN wget https://github.com/eosrei/twemoji-color-font/releases/download/v12.0.1/TwitterColorEmoji-SVGinOT-Linux-12.0.1.tar.gz && \
    tar zxf TwitterColorEmoji-SVGinOT-Linux-12.0.1.tar.gz && \
    cd TwitterColorEmoji-SVGinOT-Linux-12.0.1 && \
    cp TwitterColorEmoji-SVGinOT.ttf /usr/share/fonts/truetype

# for zsh powerline + nerd fonts
COPY BitstreamVeraSansMonoNerdFontComplete.ttf /usr/share/fonts/truetype

# for more unicode emojis
COPY NotoColorEmoji.ttf /usr/share/fonts/truetype
COPY NotoEmoji-Regular.ttf /usr/share/fonts/truetype

# for correct box drawing
RUN apt-get update && \
    apt-get -y install ttf-ancient-fonts && \
    rm -rf /var/lib/apt/lists/*
docker build --tag asciicast2gif:nerdfont .
docker run --rm -v $PWD:/data asciicast2gif:nerdfont \
   asciinema/asciicast2gif https://asciinema.org/a/193932.json test.gif

original-issue

greyltc commented 4 years ago

I guess my issue is a font one too.

docker run --rm -v $PWD:/data asciinema/asciicast2gif https://asciinema.org/a/327214.json out2.gif

Doesn't generate the appropriate gif.

Any chance we can get an updated official docker image with some more/fixed fonts?

ku1ik commented 2 years ago

Closing as asciicast2gif is dead. Try https://github.com/asciinema/agg instead.