How can I "install" fonts to use in Visual Studio Code?
I have this beautiful mono font https://github.com/tonsky/FiraCode that I'd like to use in Visual Studio Code in Ubuntu.
I downloaded the font files (.ttf), I understood that to make a font systemwide available I have to copy it to /usr/share/fonts
, so I sudo-copied those files to /usr/share/fonts/truetype/fira-code
I noticed the premissions after the copy were 750, so I chmoded to 755
Now I go to the Visual Studio Code preferences and tell it I will use "Fira Code", and does nothing. If I change it to "DejaVu Sans Mono" for example, it will use that font.
Doing this, I don't see the fonts in LibreOffice, either.
After this fail, I created a .fonts
directory on my home and copied the .ttf files, same result. (I followed the instructons here: https://itsfoss.com/install-fonts-ubuntu-1404-1410/)
Copying the fonts here, I see them in LibreOffice, but I can't use them in Visual Studio Code
So looks like there most be some kind of "font registry" sort to speak, how do you correctly install font files in Ubuntu?
Solution 1:
To set this beautiful fonts up use the following steps
Download the fonts from here
Unzip and in the
ttf
folder double click each file and selectinstall
from the dialogue box that appears-
Setup VSCode:
- Open
File -> Preferences -> Settings
- Top right click on
{}
and theuser settings
(settings.json) will open up -
Add the following lines:
"editor.fontFamily": "'Fira Code'", "editor.fontLigatures": true,
- Note: I had to comment out the normal
font family entry
which I can switch back to by reversing the process.
- Note: I had to comment out the normal
-
To change the font weight add any of the following lines but not all
"editor.fontWeight": "300" // Light "editor.fontWeight": "400" // Regular "editor.fontWeight": "500" // Medium "editor.fontWeight": "600" // Bold
- Open
-
Restart and enjoy.
My sample user settings.json
{
"files.autoSave": "onFocusChange",
"editor.minimap.enabled": false,
"workbench.iconTheme": "material-icon-theme",
"vsicons.projectDetection.autoReload": true,
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
// "editor.fontFamily": "'Noto Mono', 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"breadcrumbs.enabled": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"git.enableSmartCommit": true,
"java.home": "/usr/lib/jvm/java-8-oracle",
// "editor.fontLigatures": true,
"editor.fontFamily": "'Fira Code', 'Noto Mono', 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
// "editor.fontWeight": "300", // Light
// "editor.fontWeight": "400", // Regular
// "editor.fontWeight": "500", // Medium
// "editor.fontWeight": "600" // Bold
}