switch to inter font

This commit is contained in:
sawka 2024-07-05 14:09:27 -07:00
parent 9b3042829c
commit 11a4e4b2e1
3 changed files with 16 additions and 2 deletions

View File

@ -8,7 +8,7 @@
--grey-text-color: #666; --grey-text-color: #666;
--main-bg-color: #000000; --main-bg-color: #000000;
--border-color: #333333; --border-color: #333333;
--base-font: normal 15px / normal "Lato", sans-serif; --base-font: normal 15px / normal "Inter", sans-serif;
--fixed-font: normal 12px / normal "Hack", monospace; --fixed-font: normal 12px / normal "Hack", monospace;
--accent-color: rgb(88, 193, 66); --accent-color: rgb(88, 193, 66);
--panel-bg-color: rgba(31, 33, 31, 1); --panel-bg-color: rgba(31, 33, 31, 1);

View File

@ -6,6 +6,7 @@ let isLatoFontLoaded = false;
let isHackFontLoaded = false; let isHackFontLoaded = false;
let isBaseFontsLoaded = false; let isBaseFontsLoaded = false;
let isFiraCodeLoaded = false; let isFiraCodeLoaded = false;
let isInterFontLoaded = false;
function addToFontFaceSet(fontFaceSet: FontFaceSet, fontFace: FontFace) { function addToFontFaceSet(fontFaceSet: FontFaceSet, fontFace: FontFace) {
// any cast to work around typing issue // any cast to work around typing issue
@ -106,6 +107,19 @@ function loadHackFont() {
hackBoldItalic.load(); hackBoldItalic.load();
} }
function loadInterFont() {
if (isInterFontLoaded) {
return;
}
isInterFontLoaded = true;
const interFont = new FontFace("Inter", "url('fonts/inter-variable.woff2')", {
style: "normal",
weight: "400",
});
addToFontFaceSet(document.fonts, interFont);
interFont.load();
}
function loadBaseFonts() { function loadBaseFonts() {
if (isBaseFontsLoaded) { if (isBaseFontsLoaded) {
return; return;
@ -121,7 +135,7 @@ function loadBaseFonts() {
function loadFonts() { function loadFonts() {
loadBaseFonts(); loadBaseFonts();
loadLatoFont(); loadInterFont();
loadJetBrainsMonoFont(); loadJetBrainsMonoFont();
loadHackFont(); loadHackFont();
loadFiraCodeFont(); loadFiraCodeFont();

Binary file not shown.