diff --git a/frontend/util/fontutil.ts b/frontend/util/fontutil.ts index 86ea0cb26..aa2fb5819 100644 --- a/frontend/util/fontutil.ts +++ b/frontend/util/fontutil.ts @@ -4,6 +4,7 @@ let isJetBrainsMonoLoaded = false; let isLatoFontLoaded = false; let isHackFontLoaded = false; +let isHackNerdFontLoaded = false; let isBaseFontsLoaded = false; let isFiraCodeLoaded = false; let isInterFontLoaded = false; @@ -76,6 +77,37 @@ function loadFiraCodeFont() { firaCodeBold.load(); } +function loadHackNerdFont() { + if (isHackNerdFontLoaded) { + return; + } + isHackFontLoaded = true; + const hackRegular = new FontFace("Hack", "url('fonts/hacknerdmono-regular.ttf')", { + style: "normal", + weight: "400", + }); + const hackBold = new FontFace("Hack", "url('fonts/hacknerdmono-bold.ttf')", { + style: "normal", + weight: "700", + }); + const hackItalic = new FontFace("Hack", "url('fonts/hacknerdmono-italic.ttf')", { + style: "italic", + weight: "400", + }); + const hackBoldItalic = new FontFace("Hack", "url('fonts/hacknerdmono-bolditalic.ttf')", { + style: "italic", + weight: "700", + }); + addToFontFaceSet(document.fonts, hackRegular); + addToFontFaceSet(document.fonts, hackBold); + addToFontFaceSet(document.fonts, hackItalic); + addToFontFaceSet(document.fonts, hackBoldItalic); + hackRegular.load(); + hackBold.load(); + hackItalic.load(); + hackBoldItalic.load(); +} + function loadHackFont() { if (isHackFontLoaded) { return; @@ -137,7 +169,7 @@ function loadFonts() { loadBaseFonts(); loadInterFont(); loadJetBrainsMonoFont(); - loadHackFont(); + loadHackNerdFont(); loadFiraCodeFont(); } diff --git a/public/fonts/hacknerdmono-bold.ttf b/public/fonts/hacknerdmono-bold.ttf new file mode 100644 index 000000000..5cb890bbd Binary files /dev/null and b/public/fonts/hacknerdmono-bold.ttf differ diff --git a/public/fonts/hacknerdmono-bolditalic.ttf b/public/fonts/hacknerdmono-bolditalic.ttf new file mode 100644 index 000000000..58961fa25 Binary files /dev/null and b/public/fonts/hacknerdmono-bolditalic.ttf differ diff --git a/public/fonts/hacknerdmono-italic.ttf b/public/fonts/hacknerdmono-italic.ttf new file mode 100644 index 000000000..30094a32a Binary files /dev/null and b/public/fonts/hacknerdmono-italic.ttf differ diff --git a/public/fonts/hacknerdmono-regular.ttf b/public/fonts/hacknerdmono-regular.ttf new file mode 100644 index 000000000..6c95cc07d Binary files /dev/null and b/public/fonts/hacknerdmono-regular.ttf differ