Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

Fix font preloading (#649)

Christopher Chedeauf261d6f2fc4d
diff --git a/public/fonts.css b/public/fonts.css
new file mode 100644
index 0000000000..e8722a7950
--- /dev/null
+++ b/public/fonts.css
@@ -0,0 +1,13 @@
+/* http://www.eaglefonts.com/fg-virgil-ttf-131249.htm */
+@font-face {
+ font-family: "Virgil";
+ src: url("FG_Virgil.ttf");
+ font-display: swap;
+}
+
+/* https://github.com/microsoft/cascadia-code */
+@font-face {
+ font-family: "Cascadia";
+ src: url("Cascadia.ttf");
+ font-display: swap;
+}
diff --git a/public/index.html b/public/index.html
index ab820bfa54..438f754ada 100644
--- a/public/index.html
+++ b/public/index.html
@@ -48,16 +48,17 @@
<meta name="twitter:image" content="https://excalidraw.com/og-image.png" />
<link rel="icon" href="%PUBLIC_URL%/logo.png" />
+ <link rel="stylesheet" href="%PUBLIC_URL%/fonts.css" />
<link
rel="preload"
- href="/FG_Virgil.ttf"
+ href="%PUBLIC_URL%/FG_Virgil.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>
<link
rel="preload"
- href="/Cascadia.ttf"
+ href="%PUBLIC_URL%/Cascadia.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
diff --git a/src/styles.scss b/src/styles.scss
index 2c37501b10..c7f57ecce7 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -1,19 +1,5 @@
@import "./theme.css";
-/* http://www.eaglefonts.com/fg-virgil-ttf-131249.htm */
-@font-face {
- font-family: "Virgil";
- src: url("/FG_Virgil.ttf");
- font-display: swap;
-}
-
-/* https://github.com/microsoft/cascadia-code */
-@font-face {
- font-family: "Cascadia";
- src: url("/Cascadia.ttf");
- font-display: swap;
-}
-
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;