From 1034ec91b8e42d7c4184dd6d0ea6076706d1182e Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Thu, 22 Oct 2020 02:20:57 +0530 Subject: [PATCH] fix(fonts): move fonts to public folder so that its served as static assets via cra & works in export (#2264) --- {src/fonts => public}/Cascadia.ttf | Bin {src/fonts => public}/Cascadia.woff2 | Bin {src/fonts => public}/FG_Virgil.otf | Bin {src/fonts => public}/FG_Virgil.ttf | Bin {src/fonts => public}/FG_Virgil.woff2 | Bin public/fonts.css | 13 +++++++++++++ public/index.html | 17 +++-------------- src/css/app.scss | 14 -------------- src/excalidraw-embed/webpack.prod.config.js | 1 + 9 files changed, 17 insertions(+), 28 deletions(-) rename {src/fonts => public}/Cascadia.ttf (100%) rename {src/fonts => public}/Cascadia.woff2 (100%) rename {src/fonts => public}/FG_Virgil.otf (100%) rename {src/fonts => public}/FG_Virgil.ttf (100%) rename {src/fonts => public}/FG_Virgil.woff2 (100%) create mode 100644 public/fonts.css diff --git a/src/fonts/Cascadia.ttf b/public/Cascadia.ttf similarity index 100% rename from src/fonts/Cascadia.ttf rename to public/Cascadia.ttf diff --git a/src/fonts/Cascadia.woff2 b/public/Cascadia.woff2 similarity index 100% rename from src/fonts/Cascadia.woff2 rename to public/Cascadia.woff2 diff --git a/src/fonts/FG_Virgil.otf b/public/FG_Virgil.otf similarity index 100% rename from src/fonts/FG_Virgil.otf rename to public/FG_Virgil.otf diff --git a/src/fonts/FG_Virgil.ttf b/public/FG_Virgil.ttf similarity index 100% rename from src/fonts/FG_Virgil.ttf rename to public/FG_Virgil.ttf diff --git a/src/fonts/FG_Virgil.woff2 b/public/FG_Virgil.woff2 similarity index 100% rename from src/fonts/FG_Virgil.woff2 rename to public/FG_Virgil.woff2 diff --git a/public/fonts.css b/public/fonts.css new file mode 100644 index 00000000..165bf6a5 --- /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.woff2"); + font-display: swap; +} + +/* https://github.com/microsoft/cascadia-code */ +@font-face { + font-family: "Cascadia"; + src: url("Cascadia.woff2"); + font-display: swap; +} diff --git a/public/index.html b/public/index.html index 9de77154..0a4bb6fd 100644 --- a/public/index.html +++ b/public/index.html @@ -81,6 +81,9 @@ href="manifest.json" style="--pwacompat-splash-font: 24px Virgil" /> + + + <% if (process.env.REACT_APP_INCLUDE_GTAG === 'true') { %>