mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
switch to use hacknerdmono font
This commit is contained in:
parent
11a4e4b2e1
commit
85d8bd35c7
@ -4,6 +4,7 @@
|
|||||||
let isJetBrainsMonoLoaded = false;
|
let isJetBrainsMonoLoaded = false;
|
||||||
let isLatoFontLoaded = false;
|
let isLatoFontLoaded = false;
|
||||||
let isHackFontLoaded = false;
|
let isHackFontLoaded = false;
|
||||||
|
let isHackNerdFontLoaded = false;
|
||||||
let isBaseFontsLoaded = false;
|
let isBaseFontsLoaded = false;
|
||||||
let isFiraCodeLoaded = false;
|
let isFiraCodeLoaded = false;
|
||||||
let isInterFontLoaded = false;
|
let isInterFontLoaded = false;
|
||||||
@ -76,6 +77,37 @@ function loadFiraCodeFont() {
|
|||||||
firaCodeBold.load();
|
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() {
|
function loadHackFont() {
|
||||||
if (isHackFontLoaded) {
|
if (isHackFontLoaded) {
|
||||||
return;
|
return;
|
||||||
@ -137,7 +169,7 @@ function loadFonts() {
|
|||||||
loadBaseFonts();
|
loadBaseFonts();
|
||||||
loadInterFont();
|
loadInterFont();
|
||||||
loadJetBrainsMonoFont();
|
loadJetBrainsMonoFont();
|
||||||
loadHackFont();
|
loadHackNerdFont();
|
||||||
loadFiraCodeFont();
|
loadFiraCodeFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
public/fonts/hacknerdmono-bold.ttf
Normal file
BIN
public/fonts/hacknerdmono-bold.ttf
Normal file
Binary file not shown.
BIN
public/fonts/hacknerdmono-bolditalic.ttf
Normal file
BIN
public/fonts/hacknerdmono-bolditalic.ttf
Normal file
Binary file not shown.
BIN
public/fonts/hacknerdmono-italic.ttf
Normal file
BIN
public/fonts/hacknerdmono-italic.ttf
Normal file
Binary file not shown.
BIN
public/fonts/hacknerdmono-regular.ttf
Normal file
BIN
public/fonts/hacknerdmono-regular.ttf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user