mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
add firacode font
This commit is contained in:
parent
5be08516a5
commit
427540dd61
BIN
public/fonts/firacode-bold.woff2
Normal file
BIN
public/fonts/firacode-bold.woff2
Normal file
Binary file not shown.
BIN
public/fonts/firacode-regular.woff2
Normal file
BIN
public/fonts/firacode-regular.woff2
Normal file
Binary file not shown.
@ -87,6 +87,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
|
|||||||
const availableFontFamilies: DropdownItem[] = [];
|
const availableFontFamilies: DropdownItem[] = [];
|
||||||
availableFontFamilies.push({ label: "JetBrains Mono", value: "JetBrains Mono" });
|
availableFontFamilies.push({ label: "JetBrains Mono", value: "JetBrains Mono" });
|
||||||
availableFontFamilies.push({ label: "Hack", value: "Hack" });
|
availableFontFamilies.push({ label: "Hack", value: "Hack" });
|
||||||
|
availableFontFamilies.push({ label: "Fira Code", value: "Fira Code" });
|
||||||
return availableFontFamilies;
|
return availableFontFamilies;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ let isJetBrainsMonoLoaded = false;
|
|||||||
let isLatoFontLoaded = false;
|
let isLatoFontLoaded = false;
|
||||||
let isHackFontLoaded = false;
|
let isHackFontLoaded = false;
|
||||||
let isBaseFontsLoaded = false;
|
let isBaseFontsLoaded = false;
|
||||||
|
let isFiraCodeLoaded = 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
|
||||||
@ -55,6 +56,25 @@ function loadLatoFont() {
|
|||||||
latoFontBold.load();
|
latoFontBold.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadFiraCodeFont() {
|
||||||
|
if (isFiraCodeLoaded) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
isFiraCodeLoaded = true;
|
||||||
|
let firaCodeRegular = new FontFace("Fira Code", "url('public/fonts/firacode-regular.woff2')", {
|
||||||
|
style: "normal",
|
||||||
|
weight: "400",
|
||||||
|
});
|
||||||
|
let firaCodeBold = new FontFace("Fira Code", "url('public/fonts/firacode-bold.woff2')", {
|
||||||
|
style: "normal",
|
||||||
|
weight: "700",
|
||||||
|
});
|
||||||
|
addToFontFaceSet(document.fonts, firaCodeRegular);
|
||||||
|
addToFontFaceSet(document.fonts, firaCodeBold);
|
||||||
|
firaCodeRegular.load();
|
||||||
|
firaCodeBold.load();
|
||||||
|
}
|
||||||
|
|
||||||
function loadHackFont() {
|
function loadHackFont() {
|
||||||
if (isHackFontLoaded) {
|
if (isHackFontLoaded) {
|
||||||
return;
|
return;
|
||||||
@ -104,6 +124,7 @@ function loadFonts() {
|
|||||||
loadLatoFont();
|
loadLatoFont();
|
||||||
loadJetBrainsMonoFont();
|
loadJetBrainsMonoFont();
|
||||||
loadHackFont();
|
loadHackFont();
|
||||||
|
loadFiraCodeFont();
|
||||||
}
|
}
|
||||||
|
|
||||||
export { loadFonts };
|
export { loadFonts };
|
||||||
|
Loading…
Reference in New Issue
Block a user