githubnext / monaspace

An innovative superfamily of fonts for code
https://monaspace.githubnext.com
SIL Open Font License 1.1
13.15k stars 219 forks source link

docs: `dlig` enables all ligatures #131

Closed nickmccurdy closed 1 month ago

nickmccurdy commented 7 months ago

I've noticed that Monaspace enables all ligatures with dlig, so we can simplify the usage for VSCode:

"editor.fontFamily": "'calt', 'liga', 'dlig'"

This is equivalent to enabling all ligatures separately:

"editor.fontFamily": "'calt', 'liga', 'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06' 'ss07', 'ss08'"
massimo-cassandro commented 7 months ago

same for me I noticed that there are differences between the https://monaspace.githubnext.com/ page and the repository readme

nickmccurdy commented 7 months ago

That's being tracked in #77. This issue is specifically about behavior in VSCode.

quot commented 7 months ago

This occurs in Wezterm too, so I don't think it's just a VSCode issue unless they both use Harfbuzz.

dlig seems to override and enable all ss0x options. Disabling a single ss0x option requires disabling dlig.

Disabling dlig doesn't seem to affect texture healing, so I don't mind that. But based on the Monaspace instructions, that doesn't seem to be how it's intended to work.

Wezterm font shaping docs: https://wezfurlong.org/wezterm/config/font-shaping.html

dlig disabled: image

dlig enabled with no ss0x options: image

dlig enabled with ss05 explicitly disabled: image

dlig disabled with ss05 explicitly disabled: image

Here is a minimal config if anyone would like to reproduce the issue in Wezterm. ~/.config/wezterm/wezterm.lua:

local wezterm = require("wezterm")
config = wezterm.config_builder()
config.font = wezterm.font_with_fallback {
  { family = "Monaspace Neon",
    harfbuzz_features = {
    'calt',
    'liga',
    'dlig',
    'ss01', -- ligatures related to the equals glyph like != and ===.
    'ss02', -- ligatures related to the greater than or less than operators.
    'ss03', -- ligatures related to arrows like -> and =>.
    'ss04', -- ligatures related to markup, like </ and />.
    'ss05=0', -- ligatures related to the F# programming language, like |>.
    'ss06', -- ligatures related to repeated uses of # such as ## or ###.
    'ss07', -- ligatures related to the asterisk like ***.
    'ss08', -- ligatures related to combinations like .= or .-.
    }
  }
}
return config
nickmccurdy commented 7 months ago

This occurs in Wezterm too, so I don't think it's just a VSCode issue unless they both use Harfbuzz.

It's likely they both are, as Wezterm uses it by default and VSCode renders text with Chromium.

Krzysztof-Cieslak commented 7 months ago

dlig enabling everything is by-design behaviour (but it was introduced fairly late in the development cycle) - the problem is in the documentation/webpage which didn't get updated to cover this change.

Sorry for the confusion!

nickmccurdy commented 7 months ago

Thanks for clarifying, I had a feeling this would be the case but wanted to confirm.

spikespaz commented 2 months ago

So the little generator tool on the website is broken?

spikespaz commented 2 months ago

This now does work: image

akhiljalagam commented 2 months ago

@spikespaz can you post your config snippet please?

spikespaz commented 2 months ago

@spikespaz can you post your config snippet please?

From where

heathercran commented 1 month ago

dlig is no longer used, as of version 1.1