Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nerd Fonts nonMono not selectable with Windows Terminal #1098

Closed
3 tasks done
Finii opened this issue Feb 1, 2023 · 13 comments · Fixed by #1099
Closed
3 tasks done

Nerd Fonts nonMono not selectable with Windows Terminal #1098

Finii opened this issue Feb 1, 2023 · 13 comments · Fixed by #1099

Comments

@Finii
Copy link
Collaborator

Finii commented Feb 1, 2023

🗹 Requirements

  • I have searched the issues for my issue and found nothing related and/or helpful
  • I have searched the FAQ for help
  • I have searched the Wiki for help

🎯 Subject of the issue

Experienced behavior:

After installing

Caskaydia Cove Nerd Font Complete Regular.otf
Caskaydia Cove Nerd Font Complete Mono Regular.otf
Caskaydia Cove Nerd Font Complete Windows Compatible Regular.otf
Caskaydia Cove Nerd Font Complete Mono Windows Compatible Regular.otf

only the Nerd Font Mono variants are visible in Windows Terminal, when not selecting all fonts.

This is possibly a regression, I believe this had been fixed before.

They ARE selectable with Gnome-Terminal which is also picky sometimes.

Expected behavior:

Can select all 4

Example symbols:

🔧 Your Setup

  • Which font are you using (e.g. Anonymice Powerline Nerd Font Complete.ttf)?
    See above
  • Where did you get the file from (download link, self patched, source downloaded from link...)
    Release zip 2.3.3
  • Which terminal emulator are you using (e.g. iterm2, urxvt, gnome, konsole)?
    Windows Terminal 1.15.3466.0
  • Are you using OS X, Linux or Windows? And which specific version or distribution?
    Windows 10 no wait 11

★ Screenshots (Optional)

grafik

@Finii
Copy link
Collaborator Author

Finii commented Feb 1, 2023

😭

image

@Finii
Copy link
Collaborator Author

Finii commented Feb 1, 2023

Counterexample (old naming engine active)

image

Edit: Red herring, has nothing to do with naming engine

@Finii
Copy link
Collaborator Author

Finii commented Feb 1, 2023

5170911 font-patcher: Improve 'Mono' compatibility with Windows

image

SIGH

@Finii
Copy link
Collaborator Author

Finii commented Feb 1, 2023

The sourcefont IS selectable with Windows Terminal, but has no Panose??

image

Edit: It's selectable because the VF has Panose bits, but the same static one has not

Finii added a commit that referenced this issue Feb 1, 2023
[why]
Some fonts have invalid (or unset) Panose flags. When we create a "Nerd
Font Mono" font the Panose proportion is set to 'monospace'. This
make the font selectable in certain applications that need monospaced
fonts.

After #764 the "Nerd Font" variant shall (again) be detected as
monospaced font, but the glyphs have a big right side bearing (hang into
the next 'cell'). So we need to set the Panose bits there also.

[how]
We already have a check if the font is propably monospaced, independent
from Panose. This is used to prevent --mono patching on originally
proportional fonts.

If we find out with that check that the font is (most probably)
monospaced we also set the appropriate bits in Panose; unless Panose has
valid values that contradict that change.

Fixes: #1098

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@237dmitry
Copy link

WT Preview 1.17.1023.0
Fonts from 2.3.3 release.

I often change settings by editing the configuration file, but everything works through the GUI.

Screenshot 2023-02-01 211650

Screenshot 2023-02-01 212358

@Finii
Copy link
Collaborator Author

Finii commented Feb 2, 2023

@237dmitry Thanks for the information.

You have the all fonts selected, then it's no problem. But you can not select the font if all fonts is deselected, albeit it should be possible.

image

And we tracked it down to be a glitch in the Cascadia Code release, see the Issue there (linked above).

Anyhow, added code that autocorrects bad/wrong/missing Panose flags.

@237dmitry
Copy link

With unchecked Show all fonts the *.otf fonts are out of view at all.

@Finii
Copy link
Collaborator Author

Finii commented Feb 2, 2023

@237dmitry

Not if they have correct Panose information?
Excatly that was this issue about.

Edit: Remove wrong image

@Finii
Copy link
Collaborator Author

Finii commented Feb 2, 2023

Here, the 4 fonts just created by

$ fontforge font-patcher src/unpatched-fonts/CascadiaCode/Regular/CascadiaCode-Regular.otf --also-windows
$ fontforge font-patcher src/unpatched-fonts/CascadiaCode/Regular/CascadiaCode-Regular.otf --also-windows --mono

grafik

grafik

("all fonts" still unselected), note version 2.3.3-32

You see, no problem with otf at all.

Edit: Sorry finishing edit only now, because ... I can not work on that Windows machine, it drives me crazy (because it runs in 'Germany' mode which is ridiculous

@237dmitry
Copy link

Not if they have correct Panose information?

Sorry, but I don't know what Panose is. *.otf font information is correct in Windows (11) Font Manager. But they are not visible either in the conhost settings or in the WT settings (if the Show all fonts checkbox is unchecked)

@Finii
Copy link
Collaborator Author

Finii commented Feb 3, 2023

Fonts have much more information stored than the Font Manager is able to show. And then there are tables that stem from different companies (i.e. Adobe/Apple/Microsoft as the big ones) that store 'almost similar but different' information.

To cite Yannis Haralambous:

[You] should be aware of the fact that everything pertaining to encodings, and to fonts in particular, is considered to be industrial knowledge and therefore cannot be disseminated, at least not completely. It is hard to imagine how badly the “specifications” of certain technologies are written, whether because of negligence or out of a conscious desire to prevent the full use of the technologies. Some of the appendices of this book were written for the very purpose of describing certain technologies with a reputation for inaccessibility, such as AAT tables and TrueType instructions, as clearly and exhaustively as possible.

Panose links

@237dmitry
Copy link

237dmitry commented Feb 3, 2023

I looked more closely at the version of the font, it is 2.3.0, I will reinstall it now and answer. I wanted to replace it, but for some reason I forgot, I changed it only in Linux.

Reinstalled.

No difference. OTF invisible.

Screenshot 2023-02-03 124225

Screenshot 2023-02-03 124454

Finii added a commit to b-/nerd-fonts that referenced this issue Feb 17, 2023
[why]
Some fonts have invalid (or unset) Panose flags. When we create a "Nerd
Font Mono" font the Panose proportion is set to 'monospace'. This
make the font selectable in certain applications that need monospaced
fonts.

After ryanoasis#764 the "Nerd Font" variant shall (again) be detected as
monospaced font, but the glyphs have a big right side bearing (hang into
the next 'cell'). So we need to set the Panose bits there also.

[how]
We already have a check if the font is propably monospaced, independent
from Panose. This is used to prevent --mono patching on originally
proportional fonts.

If we find out with that check that the font is (most probably)
monospaced we also set the appropriate bits in Panose; unless Panose has
valid values that contradict that change.

Fixes: ryanoasis#1098

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2023
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this issue Nov 24, 2023
[why]
Some fonts have invalid (or unset) Panose flags. When we create a "Nerd
Font Mono" font the Panose proportion is set to 'monospace'. This
make the font selectable in certain applications that need monospaced
fonts.

After ryanoasis#764 the "Nerd Font" variant shall (again) be detected as
monospaced font, but the glyphs have a big right side bearing (hang into
the next 'cell'). So we need to set the Panose bits there also.

[how]
We already have a check if the font is propably monospaced, independent
from Panose. This is used to prevent --mono patching on originally
proportional fonts.

If we find out with that check that the font is (most probably)
monospaced we also set the appropriate bits in Panose; unless Panose has
valid values that contradict that change.

Fixes: ryanoasis#1098

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants