asciinema / asciinema-player

Web player for terminal session recordings
https://docs.asciinema.org/manual/player/
Apache License 2.0
2.67k stars 266 forks source link

Font size changes between first and following page loads in Firefox #193

Closed thomasjsn closed 8 months ago

thomasjsn commented 2 years ago

First page load:

<pre class="asciinema-terminal cursor blink" style="width: 103ch; height: 40em; font-size: 76.8453%; line-height: 1.33333em;"></pre>

image

Following page loads:

<pre class="asciinema-terminal cursor blink" style="width: 103ch; height: 40em; font-size: 108.883%; line-height: 1.33333em;"></pre>

image

This can be replicated loading the page with CTRL+F5

This is my snippet to load asciinema:

AsciinemaPlayer.create('\/2019\/10\/rpi-ds18b20-temp-sensors\/297112.cast', document.getElementById('cast-297112.cast'), {
      cols:  103 ,
      rows:  30 ,
      poster: 'npt:0:01'
    });
ku1ik commented 1 year ago

Recently released v3.3.0 has an improvement to font measurements in player initialization which has a chance to solve the above problem. You may want to give it a try.

ku1ik commented 1 year ago

@thomasjsn have you had a chance to test with newer player version?

thomasjsn commented 1 year ago

@thomasjsn have you had a chance to test with newer player version?

I'm still using version 1.x and haven't been working on my site for a while, so unfortunately no.

thomasjsn commented 11 months ago

Alright, I finally found the time to upgrade to the latest version. And the issue seems to be fixed — the font size no longer changes between first and following page loads. :+1: