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

Some glyphs are not centered in 2.2.2 Release #940

Closed
3 tasks done
siduck opened this issue Sep 25, 2022 · 17 comments
Closed
3 tasks done

Some glyphs are not centered in 2.2.2 Release #940

siduck opened this issue Sep 25, 2022 · 17 comments

Comments

@siduck
Copy link

siduck commented Sep 25, 2022

🗹 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:
Some glyphs arent centered well but they did work when I was using old release like 2.2.0 but recently installed 2.2.2 release and they dont center now.

image

(Note : those icons which look centered are from material design icon fonts )

Expected behavior:
Icons should center!
image

Example symbols:
f111, f658, f011, f135, f466, f855

🔧 Your Setup

  • JetbrainsMono Nerd Font Complete.ttf
  • The release page
  • St
  • Gnu / Void Linux
@Finii
Copy link
Collaborator

Finii commented Sep 25, 2022

I can see it.

Left to right: v2.2.0-RC v2.2.0 v2.2.2

image

Currently I would say that nothing should have touched this. Will dig in.

@Finii
Copy link
Collaborator

Finii commented Sep 25, 2022

BTW, there is no JetbrainsMono Nerd Font Complete.ttf

I tried JetBrains Mono Regular Nerd Font Complete.ttf

@siduck
Copy link
Author

siduck commented Sep 25, 2022

yes it was a typo!

@Finii
Copy link
Collaborator

Finii commented Sep 26, 2022

Well, this is a bit more complicated. Not technically, but what we want to achieve.

Nerd Fonts is primarily for people that work in some kind of text window ('terminal'). Usually you need a monospaced font for that. Monospaced means each 'letter' is displayed in the same 'cell'. The symbols need to be scaled down to fit into that cell also. This results in the Nerd Font Mono variants.

But usually letters are slender, and to scale a round-ish icon down to fit into that cell makes it very very small. Too small for most people. For this reason there are also Nerd Font (without Mono) fonts. Here the symbols are not scaled down, but usually are 1.3 to 1.8 cells wide.
The typical terminal emulators / consoles have no problem with these 'too big' symbols. But a lot of terminals require the font to be still monospaced. This means that all glyphs in the font have the same width (one cell), but some glyphs extend into the next / neighboring cell. A lot of code exists, in tools, that add a blank ( ) after each symbol, to add a bit of space for the symbol.
Of course that does only work if people work with the same assumption. And that is: There are symbol glyphs that are bigger then one cell, but they extend only to the right and not to the left.

You can see an example with the standby-symbol on the right in the picture above. It is left aligned to the cell, but wider then one cell, and the cell size is kept consistent with all other glyphs / the letters (so that the terminal emulator does accept the font as monospaced).

The problem with v2.2.0 was specifically that it broke all the terminal emulators. For example v2.1.0 has the same behavior like v2.2.2 and is unusable for you.

The change in v2.2.0 has been introduced by exactly the problem you describe. For people that use the Nerd Fonts and the symbols therein in GUI contexts. This is just another goal.

What can be done?

I do not know this dialog you show. The first question for me is: WHY does it use JetBrainsMono Nerd Font. Would it not make more sense to use JetBrains Mono and rely on font fallback for Symbols-2048-em Nerd Font Complete.ttf And/or the symbols should specify that symbols only font specifically.

Maybe you can not change that or that dialog is some system dialog. Then this issue needs to be taken to the maintainer of that dialog.

If you are self patching, you can create a font for GUI usage by adding --variable-width-glyphs to the patching process.

See also

@Finii Finii added the wontfix label Sep 26, 2022
@Finii
Copy link
Collaborator

Finii commented Sep 26, 2022

... and rely on font fallback for ...

  • Install a non-Nerd Font text font (for example JetBrains Mono (maybe additionally to JetBrainsMono Nerd Font))
  • Install Symbols-2048-em\ Nerd\ Font\ Complete.ttf from the release package NerdFontsSymbolsOnly.zip
  • Install 10-nerd-font-symbols.conf for fontconfig
  • Change GUI dialog to use JetBrains Mono
  • Symbols are automagically taken out if Symbols-Only font (which will center the glyphs)

See also https://github.com/ryanoasis/nerd-fonts/wiki/Font-Substitution-&-Fallback

Edit: Make clear that the font in the first point shall not include Nerd Font in the name, but is the original font
Edit: Add link to Wiki for font fallback
Edit: The Wiki is underwhelming ... somewhere we have more explanations... searching ...

@siduck
Copy link
Author

siduck commented Sep 26, 2022

Thanks for the explanation. I was not using JetbrainsMono Font Mono because the glyphs in it are small.

look :

image

@Finii
Copy link
Collaborator

Finii commented Sep 26, 2022

Yes.

You need to change the font (just) of the GUI thingy. Or if that does not specify JetBrainsMono Nerd Font, have the Symbols only font also installed and preferred by the GUI font renderer.

https://github.com/ryanoasis/nerd-fonts/releases/download/v2.2.2/NerdFontsSymbolsOnly.zip

The symbols in that font will show centered.

@Finii
Copy link
Collaborator

Finii commented Sep 26, 2022

Ah, sorry, just now I expanded your image and actually read the text 😬

Yes, fill in there JetBrains Mono and install that font (the original, not Nerd Font version).
And then install the Symbols Only font as well.
And then set up your fontconfig. In that way the renderer will take JetBrains Mono for the GUI thing, and detecting that the icons are missing in that font will fall back to Symbols Only which have the symbols centered.

@Finii
Copy link
Collaborator

Finii commented Sep 26, 2022

On my system the 10-nerd-font-symbols.conf need to go into /etc/fonts/conf.d/

@siduck
Copy link
Author

siduck commented Sep 26, 2022

oh this seems complex 😨 , cant it just be in one font file?

@Finii
Copy link
Collaborator

Finii commented Sep 26, 2022

In principle we could create 3 font flavors here.

The strict monospaced one (Nerd Font Mono)
The big-symbols monospaced one (Nerd Font)
The proportional one (Nerd Font Proportional) this is the one you want/need

We create only the first two, because they are used in terminal emulators. For Delugia for example I create all three versions. But here, Nerd Fonts, has only the first two. Because we also create the 🙄 Windows Compat fonts, which leaves us with 4 fonts at the moment, and it would be 6 if we add Nerd Font Proportional. Which you have to multiply by 600 (because we patch 600 fonts). That is a storage size issue.

I really really want to do away with the Windows Compat fonts, and afterwards it would be no problem to add the Proportional variant. But that also will take time (and persuasion).

If it's just you, and you need that one font, I can patch that for you, no problem, and put it somewhere. ?

@siduck
Copy link
Author

siduck commented Sep 26, 2022

The issue's that many people would try to use my rice and this isnt just a terminal issue, This happens in my gtk widget too ( images above )

@siduck
Copy link
Author

siduck commented Sep 26, 2022

I guess i'll have to use 2.2.0 R.C version forever!

@Finii
Copy link
Collaborator

Finii commented Sep 26, 2022

Terminal issue? There should be no terminal issue? Could you explain/show?
What I have seen and talked about was GUI usage (i.e. gtk etc).

@Finii
Copy link
Collaborator

Finii commented Sep 26, 2022

This happens in my gtk widget too

As I pointed out, that is a bug in the widget, it uses the wrong font. If you want to place just an icon somewhere you need to use the Symbols Only font.

@siduck
Copy link
Author

siduck commented Sep 26, 2022

oh nevermind, I misread. I guess I'll just use the mono font for centered glyphs and just increase the font size. Font works fine in terminals. Closing this issue!

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 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 Apr 3, 2023
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