Skip to content

Commit

Permalink
Merge pull request #434 from jonpetersathan/develop
Browse files Browse the repository at this point in the history
Adding support for Nerd Fonts in iframes
  • Loading branch information
ku1ik authored May 9, 2024
2 parents 6ef2f46 + 5cbb842 commit 68a675e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion assets/css/_base.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./_source_sans_pro.css";
@import "./fonts/source_sans_pro.css";

html {
height: 100%;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $primary: #06989a;
@import "./_user_profile.scss";
@import "./_user_login.scss";
@import "./_user_edit.scss";
@import "./powerline-symbols.css";
@import "./fonts/powerline-symbols.css";
@import "./fonts/fira-code-nerd-font.css";
@import "./fonts/jetbrains-mono-nerd-font.css";
@import "~asciinema-player/dist/bundle/asciinema-player.css";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@font-face {
font-family: 'Powerline Symbols';
src: local('Powerline Symbols'), local('PowerlineSymbols'), url('../static/fonts/PowerlineSymbols.otf') format('opentype');
src: local('Powerline Symbols'), local('PowerlineSymbols'), url('../../static/fonts/PowerlineSymbols.otf') format('opentype');
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../static/fonts/SourceSansPro-Light.ttf') format('truetype');
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url('../../static/fonts/SourceSansPro-Light.ttf') format('truetype');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url('../static/fonts/SourceSansPro-Regular.ttf') format('truetype');
src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url('../../static/fonts/SourceSansPro-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 600;
src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), url('../static/fonts/SourceSansPro-Semibold.ttf') format('truetype');
src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), url('../../static/fonts/SourceSansPro-Semibold.ttf') format('truetype');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../static/fonts/SourceSansPro-Bold.ttf') format('truetype');
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url('../../static/fonts/SourceSansPro-Bold.ttf') format('truetype');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: italic;
font-weight: 400;
src: local('Source Sans Pro Italic'), local('SourceSansPro-It'), url('../static/fonts/SourceSansPro-Italic.ttf') format('truetype');
src: local('Source Sans Pro Italic'), local('SourceSansPro-It'), url('../../static/fonts/SourceSansPro-Italic.ttf') format('truetype');
}
6 changes: 4 additions & 2 deletions assets/css/iframe.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import "./_source_sans_pro.css";
@import "./fonts/source_sans_pro.css";
@import "./fonts/fira-code-nerd-font.css";
@import "./fonts/jetbrains-mono-nerd-font.css";
@import "~asciinema-player/dist/bundle/asciinema-player.css";
@import "./powerline-symbols.css";
@import "./fonts/powerline-symbols.css";

body.iframe {
background-color: transparent;
Expand Down
4 changes: 2 additions & 2 deletions lib/asciinema_web/controllers/recording/iframe.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
</p>

<script>
window.addEventListener('load', function() {
window.addEventListener('load', async function() {
const opts = <%= safe_json(player_opts(@asciicast, @player_opts)) %>;
const player = window.createPlayer(
const player = await window.createPlayer(
<%= safe_json(player_src(@asciicast)) %>,
document.getElementById('player'),
{
Expand Down

0 comments on commit 68a675e

Please sign in to comment.