Showing posts with label Fira Code. Show all posts
Showing posts with label Fira Code. Show all posts

Thursday, December 12, 2019

Fira Code Font in NOTEPAD++ , Sublime3 and VSCODE

Fira Code: monospaced font with programming ligatures




Fira Code: monospaced font with programming ligatures







 =================== SUBLIME =================


Installing

Make sure you install the font.



Enabling

Preferences --> Settings
Add before "ignored_packages":
"font_face": "Fira Code",
"font_options":
[
 "subpixel_antialias"
],

Antialias

If you want enable antialias, add in font_options: "gray_antialias"


 

 =================== NOTEPAD++ =================

 

It won't currently work "out of the box". The text rendering needs tweaked but you can do it with a plugin. Keep in mind support for ligatures is not officially supported so you might run into issues.
This is the easiest way I know (without recompiling) to get ligatures to work in Notepad++:
  1. Install a recent version of Fira Code (use either the normal font or the retina as those are the only ones that seem to work).
  2. Install LuaScript via the Plugin Manager (you can also use PythonScript if you are more comfortable with it or want to use a 10 ton hammer).
  3. Select the font via Settings > Style Configurator > Global Styles > Global Override. Select "Fira Code" for the font style and turn on Enable global font
  4. Edit the LuaScript startup file by doing Plugins > LuaScript > Edit Startup Script and add the following code:
editor1.Technology = SC_TECHNOLOGY_DIRECTWRITE
editor2.Technology = SC_TECHNOLOGY_DIRECTWRITE
Restart and enjoy.

 

 =================== VS CODE =================

 

Requirements

Make sure you install the font.

Using the Settings Editor

To open the settings editor, first from the File menu choose Preferences, Settings or use keyboard shortcut Ctrl+, (Cmd+, on Mac).
To enable FiraCode in the settings editor, under "Commonly Used", expand the "Text Editor" settings and then click on "Font". In the "Font Family" input box type Fira Code, replacing any content. Tick the check box "Enables/Disables font ligatures" under "Font Ligatures" to enable the special ligatures.

Manually editing settings.json

Visual Studio Code allows you to also edit the underlying settings.json config file. First open the settings editor as described above, then click the "curly brackets" icon to open the "settings.json" file.
Then paste the following lines and save the file.
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
If this doesn't work for you, you can try:
  1. restarting VS Code;
  2. wrapping the "Fira Code" section with additional apostrophes:
    "editor.fontFamily": "'Fira Code'",
    "editor.fontLigatures": true,

Font weights

To achieve different weights add one of the following (verified on Mac):
    "editor.fontWeight": "300" // Light
    "editor.fontWeight": "400" // Regular
    "editor.fontWeight": "500" // Medium
    "editor.fontWeight": "600" // Bold
To use Retina weight, change Font name to FiraCode-Retina if macOS (exactly that, no spaces):
    "editor.fontFamily": "FiraCode-Retina",
or 'Fira Code Retina' if Windows or Linux:
    "editor.fontFamily": "Fira Code Retina",