Using Two Fonts in VS Code
I give directions on using two fonts simultaneously in VS Code
I love the code ligatures of JetBrains Mono and Fira Code, but I was disappointed at the subtle italics. I also didn’t want to shell out $199 for a font like Operator Mono. I, therefore, found a better option. Using two coding fonts with ligatures.
The theme used (that has an option for the glow effect, which I enabled) is SynthWave ‘84
Please be aware, any time VS Code is updated to a new version or you update the CSS, repeat steps 8-10.
- If not already installed, download and install desired fonts. I’m using JetBrains Monofor my main font and Victor Mono for italics. However, feel free to use whatever combo you’d like. A lot of people like Fira Code instead of JetBrains Mono
- Unzip the downloaded archive
- Install the font
- Windows:
- Select all font files in the folder
- Right-click any of them
- Pick “Install” from the menu.
- Mac:
- Select all font files in the folder and double-click.
- Click open at the prompt
- Click Install Font
- Linux:
- Unpack fonts to
~/.local/share/fonts
(or/usr/share/fonts
, to install fonts system-wide) fc-cache -f -v
- Unpack fonts to
- Windows:
- Go to settings
- To set the desired main font
- In the settings panel, on the left, Navigate to Text Editor>Font
- Set ‘Font Family’ to your preferred font, for example,
JetBrains Mono
orFira Code
- To enable ligatures
- In the settings panel, on the left, Navigate to Text Editor>Font
- Scroll down to ‘Font Ligatures’
- Click ‘edit in settings.json’
- Set ‘editor.fontLigatures’ to
true
if not already set
- Install VSCode Extension: Custom CSS and JS Loader
- Download this style.css (right-click the link and chose ‘save link as’) to your desktop or a preferred location; know the path to the file.
- You can modify this CSS file to suit your needs to change the font weight, for example. If you want to, I suggest using the VS Code development tools by going to Help>Toggle Developer Tools
- Main Font: If you are using a font other than JetBrains Mono
- Edit the styles.css
- Change
JetBrains Mono
to your preferred main font
- Cursive Font: If you are using a font other than JetBrains Mono
- Edit the styles.css
- Change
Victor Mono
to your preferred cursive font
- Update settings.json
- Add the following within the settings.json, without the comments & open or close brackets
{ // open of main json object "vscode_custom_css.imports": ["path-to-file"], "vscode_custom_css.policy": true } // close of main json object
- replace
path-to-file
with the correct path- Windows:
- Example:
file:///C:/Users/MyUserName/Desktop/styles.css
- Example:
- Mac or Linux
- Example “file:///Users/MyUserName/Desktop/style.css”
- Windows:
- replace
- Add the following within the settings.json, without the comments & open or close brackets
- Install the extension, Fix VSCode Checksums this will remove the error, “Your code installation appears to be corrupt”
In the command palette (view>command pallet), run
Reload Custom CSS and JS
You will get an error message saying that the installation is corrupt. This is to be expected and will be resolved in the next two steps.
- In the command palette, run
Fix Checksums: Apply
- Restart VS Code by exiting, not reloading, VS Code and, start it back up.
I took some content from An alternative to Operator Mono font and Multiple Fonts: Alternative to Operator Mono in VSCode