Skip to content

Commit

Permalink
Ensure Fira Mono is loaded before initializing the player
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Nov 29, 2023
1 parent 7c5013a commit 1c22c97
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions docs/javascripts/extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,16 @@ function createPlayer(src, containerId, opts, setup) {
const container = document.getElementById(containerId);

if (container !== null) {
const player = AsciinemaPlayer.create(src, container, {
theme: 'dracula',
...opts
document.fonts.load("1em Fira Mono").then(() => {
const player = AsciinemaPlayer.create(src, container, {
theme: 'dracula',
terminalFontFamily: "'Fira Mono', monospace",
...opts
});

if (typeof setup === 'function') {
setup(player);
}
});

if (typeof setup === 'function') {
setup(player);
}
}
}

0 comments on commit 1c22c97

Please sign in to comment.