ryanoasis / nerd-fonts

Iconic font aggregator, collection, & patcher. 3,600+ icons, 50+ patched fonts: Hack, Source Code Pro, more. Glyph collections: Font Awesome, Material Design Icons, Octicons, & more
https://NerdFonts.com
Other
53.94k stars 3.63k forks source link

Mono fonts contains ligatures #677

Closed csholmq closed 1 year ago

csholmq commented 2 years ago

🎯 Subject of the issue

After reading the following:

By the Nerd Font policy, the variant with the 'Mono' suffix is not supposed to have any ligatures. Use the non-Mono variants to have ligatures.

I downloaded several Mono variants from the patched-fonts directory only to find that did contain ligatures. This was both surprising and a bit problematic since my terminal doesn't allow for turning of ligatures explicitly.

Is the policy inaccurate or are several of the patched fonts wrong?

🔧 Your Setup

Windows Terminal on Windows 11

Tried fonts:

interdependence commented 2 years ago

I can verify that this is also the case with JetBrainsMono. Downloading the NoLigatures patched fonts from the master branch work as expected, but the Mono fonts from the v2.1.0 release branch do contain ligatures.

Finii commented 2 years ago

I guess the documentation (in its generality) is wrong.

font-patcher does not remove ligatures unless --removeligs and --configfile is given in the patching process. The gotta-patch-em-all script invokes this if the supporting helper file is present (that defines which ligatures are to be removed).

These are the fonts that have such definitions:

./src/unpatched-fonts/Overpass/Non-Mono/config.json
./src/unpatched-fonts/Overpass/Mono/config.json
./src/unpatched-fonts/OpenDyslexic/config.json
./src/unpatched-fonts/Ubuntu/config.json
./src/unpatched-fonts/FiraCode/config.json
./src/unpatched-fonts/SpaceMono/config.json
./src/unpatched-fonts/ShareTechMono/config.json
./src/unpatched-fonts/Monoid/config.json
./src/unpatched-fonts/Lekton/config.json
./src/unpatched-fonts/DejaVuSansMono/config.json
./src/unpatched-fonts/Hasklig/config.json
./src/unpatched-fonts/Noto/config.json
./src/unpatched-fonts/Arimo/config.json
./src/unpatched-fonts/Iosevka/config.json
./src/unpatched-fonts/Cousine/config.json
./src/unpatched-fonts/FiraMono/config.json

It seems the Ligatures are present in the Fira font (according to your initial post), which would be unexpected then. Lets see...

$ cat src/unpatched-fonts/FiraMono/config.json
[Subtables]
    ligatures: [
        "'dlig' Discretionary Ligatures lookup 21 subtable",
        "Ligature Substitution lookup 23 subtable" ]

Hmm. Can you give an example ligature that shows up with Fira?

sbatial commented 2 years ago

I stumbled across this issue because the Overpass Nerd Font prints fi as a telephone glyph. When I use the OverpassMono Nerd Font no ligatures/glyphs are rendered though so everything seems to work as specified by the NF policy. (That makes the Nerd Font Variant of Overpass kinda useless for me though bc I don't want Monospace system-wide but I also can't have little telephones in my texts)

I will try to verify which ligatures show up in Fira where none should be.

Finii commented 2 years ago

@BodeSpezial The fi ligature issue should (have been) be solved with #711.

The fonts in this repo's patched-fonts/ are still 'old', so you would need to self-patch I assume. I do not know if that commit is in the RC already (read bottom of that PR).

sbatial commented 2 years ago

Thank you @Finii . My problem was solved by your tip.

I couldn't verify the problem of the issue though.

But I have to say that I wasn't able to set the conditions up to a good extent because I'm not using windows.

Finii commented 2 years ago

A thing I would like to as you: Do you think it is useful to have some nice font (originally with ligatures), that is patched to include symbols, to also drop the ligatures - but only if patched for Nerd Font Mono that is. And Nerd Font Mono means tiny symbols.

I can see uses when users do not want the ligatures of the original font, but they are as likely to not-want them in a mono font as in a non-mono-font. I see not really a correlation there.

But maybe you are not seeing the ligatures at all and it was just @csholmq's problem? Hmm.

Finii commented 2 years ago

What kind of gibberish is that @BodeSpezial ?

A thing I would like to as you

-=> A thing I would like to know of you

was what I intended to ask... :roll_eyes:

Finii commented 2 years ago

(Don't get me wrong, I accuse myself (or the autocorrect shit) that garbled my question.)

sbatial commented 2 years ago

(Don't get me wrong, I accuse myself (or the autocorrect shit) that garbled my question.)

I understood it that way haha.

Your initial question took me a bit to be sure what you meant but I figured you meant "to ask" so all good. 👌

But I'm not sure if I understand your question properly... What symbols do you mean? Unicode and non-latin characters?

If so that would probably be useful.

Although I think the current naming is really confusing. I always struggle to pick the right font because of the 'Mono' or not naming regarding monospacing but also ligatures (but only sometimes?). Wouldn't it be easier to have a "_ligature" suffix for example? That should also not 'break' anything necessarily.

rosenbergj commented 2 years ago

I can confirm this issue: CaskaydiaCove 2.1.0 Mono has ligatures (the characters => together look like an arrow), but the original Cascadia Code Mono does not have ligatures.

Ideally I would be able to pick ligatures-or-not and monospaced-icons-or-not separately, but if I can't, I'd prefer no ligatures.

Finii commented 2 years ago

but the original Cascadia Code Mono does

There is no font called Cascadia Code Mono, probably you mean Cascadia Mono.

Cascadia Mono would be called CaskaydiaMono Nerd Font or CaskaydiaMono Nerd Font Mono (depending of added symbol sizes). CaskaydiaCove * is patched from Cascadia Code (non-mono).

Compare:

rosenbergj commented 2 years ago

Cascadia Mono would be called CaskaydiaMono Nerd Font or CaskaydiaMono Nerd Font Mono (depending of added symbol sizes).

Got it. Though there do not seem to be any CaskaydiaMono fonts that exist. It seems that every Caskaydia font was built from Cascadia Code rather than Cascadia Mono, and this repo therefore doesn't provide any non-ligature versions of Caskaydia*. Is that correct?

If so, then perhaps this is just a documentation issue, since several .md files within patched-fonts/CascadiaCode say "By the Nerd Font policy, the variant with the 'Mono' suffix is not supposed to have any ligatures." But there are fonts in patched-fonts/CascadiaCode that have Mono in the filename, but as mentioned, they appear to be built from Cascadia Code rather than Cascadia Mono. Perhaps that line in the documentation should be changed to make clear that there are no non-ligature fonts to be found within that subdirectory.

(However, that line read to me as correct, and I still think it's a bug that, for example, patched-fonts/CascadiaCode/Regular/complete/Caskaydia Cove Regular Nerd Font Complete Mono Windows Compatible.otf has ligatures.)

(I will try Delugia; thank you for the link!)

Finii commented 2 years ago

I still think it's a bug that, for example

Mono after Nerd Font means 'added symbols are same width as the letters' (which some people call too small), but it is then indeed monospaced; while in the other fonts the symbols are ... often 1.5 times the width of the letter (better visible, but not monospaced).

I will try to come up with a documentation fix today. The naming is indeed hard, see for example https://github.com/ryanoasis/nerd-fonts/issues/746#issuecomment-1003694798 ff...

G-Rath commented 2 years ago

this repo therefore doesn't provide any non-ligature versions of Caskaydia*. Is that correct?

That seems to be the case from what I can tell - would it be possible for this repo to provide a non-ligature version of that font?

(I've not yet looked into building my own version as I've got very little experience with fonts and am weary of all the "this repo is huge" warnings I've seen around, but understand if that is the answer in this case)

Finii commented 2 years ago

@G-Rath The repo mentioned in the bottom of https://github.com/ryanoasis/nerd-fonts/issues/677#issuecomment-1109311144 is not a viable solution for you?

Of course we could provide Caskaydia Mono, but with the current rate of PR inclusion it might be only for the patient, sorry.

G-Rath commented 2 years ago

@Finii 🤦‍♂️I'd completely missed that - it looks like it does the trick, thanks

tx46 commented 2 years ago

I'm not sure if this is the right place to ask the question, but I'm trying to understand why my patched nerd fonts (e.g., JetBrains Mono or SFMono) do not have any ligatures. I want ligatures when using mono fonts - what can I do to fix that?

Finii commented 2 years ago

I'm not sure if this is the right place to ask the question, but I'm trying to understand why my patched nerd fonts (e.g., JetBrains Mono or SFMono) do not have any ligatures. I want ligatures when using mono fonts - what can I do to fix that?

font-patcher does not remove ligatures (when run standalone / manually). If you use patch em all some ligatures are removed in some fonts, which is a leftover from older times and is probably a problem for releases.

If you can set up something where I can reproduce the ligature removal I can have a look at it. Please include download links to the source font and which version of font-patcher you use. Please create a new issue, if you do that (as to keep this issue on topic).

There is also a bug in older fontforge versions that break ligatures, so maybe upgrading to FontForge March 2022 Release can help in that cases. There are warning messages if you have that with your fontforge.

github-actions[bot] commented 10 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.