How to change VSCode font - visual-studio-code

I have a problem with VSCode.
I don't like that font VSCode is using for system, I don't know how to change VSCode sans-serif(system) font. I tried toggle developer tools, but you know it refreshes all stylesheets when you close/open it. Any solutions?

To change your Visual Studio Code Font:
Navigate
File -> Preferences -> Settings -> Commonly Used
Scroll down to and find Editor: Font Family
The default value should be Consolas, 'Courier New', monospace change this with your desired font.
This should automatically change your font in Visual Studio Code

Find workbench.desktop.main.css and edit it. The path varies based on your installation.
Local: C:\Users\{username}\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench
Global: C:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench
Search for the .windows solo class. Ignore entries with multiple classes.
Edit the value for font-family to set the font you want to use.
There are two entries for the .windows class. Make sure to edit the one with the font-family property. Ignore the --monaco-monospace-font property.
Keeping the CSS minified, save the file.
Restart VS Code.
Example:
// Original
.windows{font-family:Segoe WPC,Segoe UI,sans-serif;}
// Modified
.windows{font-family:Comic Sans MS,serif;}
Source: https://dev.to/kunaltanwar/how-to-change-vs-code-ui-font-in-windows-56mj
Note: You may need to do this every time VS Code updates since it will be flagged as corrupted.
https://code.visualstudio.com/docs/supporting/faq#_installation-appears-to-be-corrupt-unsupported
EDIT: Clarification on which property to target since there are multiple .windows classes.

Related

Visual Studio Code workbench (explorer) line height

I have researched like the whole internet about Visual Studio Code and didn't find any information about workbench (explorer with the project directories and files) entries line height.
How can I change the line height in the workbench?
I am asking, because this standard line height in Version: 1.65.2 is too huge for the project with many directories and files. I want to see relevant directories and files in the right structure without continuing scrolling, so I have to decrease this line height.
It is impossible out of the box, but possible with the extension "Customize UI".
Link to the extension: Customize UI for VS Code
Last Update info as of 2022-11-16:
More Info
Version 0.1.65
Released on 6/6/2019, 7:47:09 AM
Last updated
9/25/2022, 3:51:30 AM
Publisher iocave
Unique Identifier iocave.customize-ui
Feature list from the Customize UI README:
This experimental extension allows customizing VSCode user interface beyond what's
normally possible, such as:
Changing interface fonts
Inline titlebar on macOS
Activity bar below sidebar
Custom stylesheet rules conveniently specified in settings.json

Is it possible to change the font in VARIABLES in debugger in VSCode?

How can I change the font family and font size of variables in the screenshot in VSCode?
There is a GitHub issue discussing this problem:
Allow to change the font size and font of the workbench
and someone has added a PR to resolve it:
Add settings for changing the workbench font size and font #144365
So maybe you need to wait for vscode to merge this function.
By the way, in my case,
because the font in variables use the default font of windows10 system - Consolas.
So I choose to change the default font, using Jetbrains Mono to replace Consolas, and it works.

Not able to change VS Code Font Family

I am fairly new to VScode, I wanted to add Ubuntu Mono Font in VScode. I downloaded the file from Google Fonts page. I extracted and Installed all the different Styles that were available. Here is a photo of the downloaded fonts that I had installed.
Then to verify whether the font was installed or not I opened a word file where I could select Ubuntu Mono. On Stackoverflow I came across 2 methods of Changing the Font family, either editing the settings.json file or using the GUI in VScode by writing the Font family name. I am attaching my modified settings.json file here
I tried other options as well like:
"editor.fontfamily":" 'UbuntuMono-Regular', monospace"
"editor.fontfamily":" 'UbuntuMono-Bold', monospace"
"editor.fontfamily":" 'Ubuntu Mono' , monospace"
//here I tried to play around with spaces:
"editor.fontfamily":" ' UbuntuMono ', monospace"
but whatever I do it is showing the same default monospace font. Any Guidance Regarding this will be helpful. My VScode is updated(It shows March 2021 (Version 1.55)) If any more information or Screenshots are required please let me know.
I tried it with the OTF version: UbuntuMono-Regular.otf
Install the font.
The following settings worked.
"editor.fontFamily": "'Ubuntu Mono', monospace"
You have to RESTART VSC
In my case, I am inputing the font name incorrectly,
e.g. I input
'Delugia Mono Regular'
but in fact vscode does not need Regular cause it accepts font family as input, changing it to:
'Delugia Mono'
and it worked.
No need to restart or even save the settings file, the change would appear in 1 second after you've entered a legal fontfamily as input.
Try to disable all installed extensions from vscode and edit the .json file again, choose your font and make sure that it has been installed then save all changes

VS Code customize sidebar

Is there any way to customize sidebar in VS Code? In particular, I want to change the font size. Is there a user setting for that? Or, maybe, I can edit it somehow via stylesheet since it's an Electron app, like in Atom?
There are no user-defined stylesheets for vscode.
The only ways to scale various parts of the UI currently are through the overall zoom level (window.zoomLevel) and the editor's font size (editor.fontSize).
I created a feature request for this on the repo.
As mentioned in other answers there are extensions which allow injecting custom CSS, you should be careful using these as they directly manipulate the source code of VS Code which could lead to problems elsewhere and any modifications could break when you update.
I Found a way to change the font of Visual Studio Code Window.
First, open command Pallete, and type "Toggle Developer Tools"
This will open "Chrome Inspector".
Select any text of sidebar of app.
Search .monaco-shell class in "styles" tab at right side inspector ( Where show every styles of the current document ), then the font-family attribute.This is tab and stylesheets.
In workbrench.main.css hit right click and click in "Open Soruce Panel" Show like this
Format the css Code with this icon.
ctrl+f for found font-family attribute again, 'cause the format redirect to end of css document, and get .monaco-shell class like this in ~6371 line.
Change this font ( I have change to Droid sans Mono font ), but you change to you want.
Why i'm not change in the real document css
'Cause, when i changed the font family in the real document css ( C:\Users\${user}\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\workbrench.main.css) generate a error saying "Vscode have a error, please reinstall the program" or similar
When generate a actualization of application, the font family declareated will deleted, and the document css is´t a pretty code.
This process change every fonts of visual studio code application (not include the editor font )
I found it very effective to use the general zoom settings (it's somewhere in that huge settings window). This adjusts the zoom level of the entire app. Tweak it till you like the size of your explorer window, then adjust the settable editor font to be readable with that zoom level. I three parallel code windows of 80 columns plus the explorer on a good 17" laptop monitor, readable if you are OK with 8pt code font (which is actually 11 point font zoomed two notches down).
Although there is no direct way of customize the sidebar from settings as #Daniel Imms mentioned in his answer, but I found 2 plugins which helped to resolve this issue. You can either one of them if you want.
1. Custom CSS and JS Loader
In Custom CSS and JS Loader plugin, you need to create a custom css and then this plugin will inject that code directly in electron-browser/index.html(as VS Code is an electron based editor). I use this CSS in my Mac:
".explorer-viewlet .mac": "font-size: 1.2em !important",
2. CustomizeUI
CustomizeUI relies on the Monkey Patch Extension to inject custom javascript in VSCode. Here is the settings I use (in settings.json) for my Mac:
"customizeUI.stylesheet": {
".explorer-viewlet .mac": "font-size: 1.2em !important; overflow: auto; border-left:none!important",
},

Change default font in netbeans?

Is it possible to change the default font in netbeans? The documentation says:
The font Monospaced is maped to different fonts on different systems.
On Windows it is mapped to "Courier ", on Linux it is mapped to
"Lucida Typewriter".
http://ui.netbeans.org/docs/ui/editor_fonts_colors/Editor_fonts_and_colors.htm
I'm on windows and want to map Monospaced font to 'Consolas' instead of 'Courier'.
P.S. I know that fonts can easily be changed from options, but when I change it in this way, I can no longer use unicode characters. Guess I need to do what they call 'mapping' the monospaced font to other font.
Tools > Options > Fonts and Colors
Set the category "Default", and to the right of that, the font you want to use.
If this does not fix it, try adding:
--laf Nimbus -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd
or
-J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd --laf Metal
to the file : netbeans.conf. You can find it in $NETBEANS_HOME/etc/ folder. Make your application font smaller from system preferences.
To change the font size outside of the editor you can configure by editing the Net Beans conf file, you can find it here:
C:\Program Files\NetBeans 8.0.2\etc\netbeans.conf
Then edit this line:
netbeans_default_options="..."
by adding this at the end:
--fontsize 18
I hope it helps :-)
Life becomes more easier now. Just from Tools menu choose Options and then follow steps on the following screen shot and take care with step 3 and 4 which they are making the default font for all languages:
I have a NetBeans plugin called 'UI-Editor' which allows you to customize virtually any Swing property, including font sizes, colors, and types. Go to Tools->Plugins and search for 'UI-Editor' or go here: http://plugins.netbeans.org/plugin/55618/?show=true
also don't not forget to change the font to the one that support Arabic like Arial for example i am not sure of some one mention that i just tried it
As far as I can tell there's no way to do this. jEdit (http://jedit.org) also uses Swing and DOES do font substitution for all fonts - there's a "automatic font substitution" checkbox in Global Options > Text Area, along with a list of preferred fonts. But jEdit is otherwise not as capable as Netbeans.