Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Disable ligatures #374

Closed
corelon opened this issue Apr 19, 2017 · 4 comments
Closed

Disable ligatures #374

corelon opened this issue Apr 19, 2017 · 4 comments
Milestone

Comments

@corelon
Copy link

corelon commented Apr 19, 2017

Hi,

Although I like ligatures for coding with fonts like Fira Code, some other fonts (Space Mono) have ligatures that I would not like to see in the code (e.g. fi).
Is it possible to disable ligatures as a setting somewhere?

Many thanks,

Nikos

@bryphe
Copy link
Member

bryphe commented Apr 19, 2017

Hi @corelon ,

Thanks for trying out Oni and for the feedback!

There is no setting that exists today, ligatures are always on, but I believe this should be relatively straightforward - the ligatures are controlled by a CSS property font-variant-ligatures. So we'd just need to add a config that controls this property:
https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-ligatures

@corelon
Copy link
Author

corelon commented Apr 20, 2017

Hi @extr0py ,

Thank you very much for that.

@bryphe
Copy link
Member

bryphe commented Apr 20, 2017

Definitely! Thanks for your comments on the PR. I'll reopen this to track more fine-grained control of the ligature support as you suggested.

@bryphe bryphe reopened this Apr 20, 2017
@bryphe
Copy link
Member

bryphe commented Apr 28, 2017

I experimented and dug around a bit, and it looks like VSCode implemented this a bit differently:
microsoft/vscode#192

.monaco-editor.enable-ligatures {
    -webkit-font-feature-settings: "liga" on, "calt" on;
    font-feature-settings: "liga" on, "calt" on;
}

I was hoping that this would enable a bit of finer-grained control over the behavior of the ligatures, to exclude some and not others, but it still causes the fi ligature to be rendered via Space Mono. So I tried out with Space Mono, and it doesn't help the situation there.

Looking at Space Mono, the best bet is to disable ligatures for that font via editor.fontLigatures = false. It seems like it is mostly a stylistic font as opposed to a development font.

I'm also tracking some extensibility to this with #412 - having CSS theming support for Oni plugins. With that, a plugin could do some more fine-grained control over text rendering too.

I'll close this for now as I think the best bet for Space Mono is to use editor.fontLigatures false, but feel free to reopen if there is something I missed.

@bryphe bryphe closed this as completed Apr 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants