Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
Fix UI font families to accept multiple fonts
Browse files Browse the repository at this point in the history
Fixes #30
  • Loading branch information
qyurila authored Sep 8, 2022
1 parent 782a94e commit fd191fa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,17 @@ define([

let fontFamily = this.configurationService.getValue("customizeUI.font.regular");
if (typeof (fontFamily) == "string" && fontFamily.length > 0) {
if (fontFamily.indexOf(",") == -1) {
fontFamily = `"${fontFamily}"`
}
this.setFontFamily(fontFamily);
}

let monospaceFamily = this.configurationService.getValue("customizeUI.font.monospace");
if (typeof (monospaceFamily) == "string" && monospaceFamily.length > 0) {
if (monospaceFamily.indexOf(",") == -1) {
monospaceFamily = `"${monospaceFamily}"`
}
this.setMonospaceFontFamily(monospaceFamily);
}
}
Expand All @@ -56,11 +62,11 @@ define([
}

setFontFamily(fontFamily) {
addStyle(`.mac, .windows, .linux { font-family: "${fontFamily}" !important; }`);
addStyle(`.mac, .windows, .linux { font-family: ${fontFamily} !important; }`);
}

setMonospaceFontFamily(fontFamily) {
addStyle(`.mac, .windows, .linux { --monaco-monospace-font:"${fontFamily}" !important; }`);
addStyle(`.mac, .windows, .linux { --monaco-monospace-font: ${fontFamily} !important; }`);
}

updateFontSize(fontSizeMap) {
Expand Down

0 comments on commit fd191fa

Please sign in to comment.