FiraCode icon indicating copy to clipboard operation
FiraCode copied to clipboard

I can't make ligatures work in VSCode.

Open UkrainianCitizen opened this issue 7 years ago • 23 comments

It seems that Fira Code font just doesn't work. I think so because it is resemblant to the font, which appears in this issue https://github.com/tonsky/FiraCode/issues/373 The OS is macOS High Sierra. My settings.json:

{
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "files.autoSave": "afterDelay",
    "explorer.confirmDragAndDrop": false,
    "terminal.integrated.shell.osx": "/bin/bash",
    "editor.fontSize": 16,
    "editor.formatOnPaste": true,
    "editor.formatOnSave": true,
    "workbench.editor.highlightModifiedTabs": true,
    "explorer.sortOrder": "type",
    "editor.cursorStyle": "block",
    "editor.cursorBlinking": "smooth",
    "files.trimFinalNewlines": true,
    "editor.fontFamily": "'Fira Code'",
    "workbench.colorTheme": "One Monokai",
    "editor.fontLigatures": true
}

This line from https://github.com/tonsky/FiraCode/issues/373 apparently makes font work, BUT ligatures still don't work.

"editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",

How can I fix this?

And, please, don't redirect me to https://github.com/tonsky/FiraCode/wiki#troubleshooting, I've already been there.

UkrainianCitizen avatar Sep 11 '19 07:09 UkrainianCitizen

Config seems ok. Let’s see some screenshots?

tonsky avatar Sep 11 '19 12:09 tonsky

Had a similar problem. Close all VS Code files and windows and reopen.

BenRoe avatar Sep 11 '19 21:09 BenRoe

@BenRoe I already tried this. Doesn't work.

UkrainianCitizen avatar Sep 11 '19 22:09 UkrainianCitizen

@tonsky Знімок екрана 2019-09-12 о 01 15 07 The same piece of code with this line "editor.fontFamily": "'Fira Code', 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'", Знімок екрана 2019-09-12 о 01 19 41

UkrainianCitizen avatar Sep 11 '19 22:09 UkrainianCitizen

@UkrainianCitizen I don't use single quotes in VSCode font settings, and looks like it works fine. Added fat arrow (=>) as an example. This is version 2 from release notes.

image

shvgn avatar Sep 11 '19 22:09 shvgn

It does not seem like single quotes make any difference though.

shvgn avatar Sep 11 '19 22:09 shvgn

@UkrainianCitizen this is not Fira Code on both screenshot. Have you installed the font? How? Where? Do other apps see it?

tonsky avatar Sep 12 '19 11:09 tonsky

@UkrainianCitizen this is not Fira Code on both screenshot. Have you installed the font? How? Where? Do other apps see it?

I am sorry, do I need to install it somehow before using? I thought I should just enable ligatures and define Fira Code as a font in order to use it. At least I didn't see any instructions for doing that. For instance, for Intellij IDEA I've just assigned Fira Code as an editor font and enabled ligatures - and everything there works like a charm.

UkrainianCitizen avatar Sep 12 '19 14:09 UkrainianCitizen

@UkrainianCitizen I don't use single quotes in VSCode font settings, and looks like it works fine. Added fat arrow (=>) as an example. This is version 2 from release notes.

image

There is no difference for me too, but I just tried that cause it was stated in the troubleshooting guide as one of the solutions.

UkrainianCitizen avatar Sep 12 '19 14:09 UkrainianCitizen

Yes. Please consult https://github.com/tonsky/FiraCode/wiki#installing-font

tonsky avatar Sep 12 '19 15:09 tonsky

@tonsky Please, add some hints for installing the font here, because there is NO INFO at all here that you have to install it.

UkrainianCitizen avatar Sep 13 '19 08:09 UkrainianCitizen

@tonsky Please, add these instructions for installing the font here, because there is NO INFO at all here that you have to install it.

Seriously 🤣🤣🤣 It's like the first thing in wiki... Aaand it's same for all editors, VS Code isn't like the only editor that requires you to install a font, all of them require that.

burtek avatar Sep 16 '19 09:09 burtek

@tonsky Please, add these instructions for installing the font here, because there is NO INFO at all here that you have to install it.

Seriously 🤣🤣🤣 It's like the first thing in wiki... Aaand it's same for all editors, VS Code isn't like the only editor that requires you to install a font, all of them require that.

Intellij DOES NOT! That's why the original install font section can't apply to all editors, Jetbrains products in particular because you must not install the font for its products on any system! Plus it is quite possible that people can overlook this https://github.com/tonsky/FiraCode/wiki as I did because I was looking just for VSCode, I found the table with editors on the readme, and I ended up here https://github.com/tonsky/FiraCode/wiki/VS-Code-Instructions. I did overlook the original page but it would be helpful to have at the beginning of the editor specific page some kind of reminder that you must proceed here only if you have installed the font for this specific editor. Similar smart stuff does Github in its guide for installing ssh in order to prevent from overlooking some prerequisites such as

Checked for existing SSH keys
Generated a new SSH key and added it to the ssh-agent

UkrainianCitizen avatar Sep 17 '19 14:09 UkrainianCitizen

@UkrainianCitizen makes a good point. I added a link to install to every page. Thanks!

tonsky avatar Sep 18 '19 09:09 tonsky

@UkrainianCitizen Maybe you've already found out the way, but just for the sake of other users,

One of solutions: wrapping the "Fira Code" section with additional apostrophes (from https://github.com/tonsky/FiraCode/wiki#installing-font : thanks to @tonsky ) Add below to the JSON file in 'Settings - Launch - Edit it setting.json' "editor.fontFamily": "'Fira Code'", "editor.fontLigatures": true,

Careful with quotes and commas.

brandonwie avatar Jan 07 '20 00:01 brandonwie

@brandonwie Thanks, though it seems that if the font installed for IDE which requires such an installation, everything works without additional apostrophes. My Fira Code fonts started working as soon as I installed the fonts.

UkrainianCitizen avatar Jan 08 '20 10:01 UkrainianCitizen

Had a similar problem. Close all VS Code files and windows and reopen.

Worked. Thanks

gihanmu avatar Jul 31 '20 14:07 gihanmu

@UkrainianCitizen Maybe you've already found out the way, but just for the sake of other users,

One of solutions: wrapping the "Fira Code" section with additional apostrophes (from https://github.com/tonsky/FiraCode/wiki#installing-font : thanks to @tonsky ) Add below to the JSON file in 'Settings - Launch - Edit it setting.json' "editor.fontFamily": "'Fira Code'", "editor.fontLigatures": true,

Careful with quotes and commas.

Just put "editor.fontLigatures": true. It work for me!

whermerson avatar Aug 23 '20 12:08 whermerson

I have same problem like yours, Its work for me when:

Install this font on the Mac computer instead of installing it to the user

apple support

kvsur avatar Dec 09 '20 06:12 kvsur

installing font on system after setting config worked for me

TsheriSherpa avatar Oct 25 '21 07:10 TsheriSherpa