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

Hard to find information about Font Fallback(Fontconfig) #670

Open
Jipok opened this issue Sep 24, 2021 · 9 comments
Open

Hard to find information about Font Fallback(Fontconfig) #670

Jipok opened this issue Sep 24, 2021 · 9 comments

Comments

@Jipok
Copy link

Jipok commented Sep 24, 2021

This is a great project. But I was surprised that there are so many patched fonts when there is a font fallback mechanism in Linux. I went through all the readme, but I couldn't find a good way to install the font. There are only a bunch of options out there using patched fonts. I didn't think I was the first to think about it. A little search opened up this discussion for me: #84
After a while, I still found that there was a file 10-nerd-font-symbols.conf and I didn't have to write the config myself.
But what really frustrated me was that I couldn't find the font itself with the icons anywhere. I tried to look at the patching script for a bit, but I didn't figure it out.
In general, about an hour after I decided to install this font for myself, I was able to find a mention of Symbols-2048-em Nerd Font Complete.ttf in some css file. Although its modification date and other files nearby confused me, it still turned out to be what I was looking for.

So that other people do not suffer as I do, I suggest doing one or all of these points:

  • Add information about 10-nerd-font-symbols.conf and Symbols-2048-em Nerd Font Complete.ttf to the readme.
  • Recommend this method as preferable at least for GNU/Linux. I do not know how other OS deals with this.
  • Add this information or at least the font itself to the site.
  • Add downloading and copy of these files as an option for the installation script.
@Jipok Jipok changed the title Hard to find information on Font Fallback(Fontconfig) Hard to find information about Font Fallback(Fontconfig) Sep 24, 2021
@ryanoasis
Copy link
Owner

Thanks. This is valuable critical feedback

@Finii
Copy link
Collaborator

Finii commented Nov 20, 2021

But I was surprised that there are so many patched fonts when there is a font fallback mechanism in Linux.

The reason is simple. It is true that the font rendering engine primarily uses the font you selected; and if a certain code point / symbol is not available another font is used that includes the missing one. BUT.

Lets assume you have the raw symbol font installed and a nice console font without the symbols. Now you try to use this with your carefully crafted powerline setup. What you will notice is that the symbols usually look 'out of place'. They do not blend with the console font, they are too big or too small, a bit too high or low.

In some setups they might even be too wide. If you use a monospaced console font you expect all glyphs to be equally wide. But maybe the symbol font is a bit wider, thus the symbol leaks over into the space of the next letter.

So when we patch a font the symbols are scaled and shifted in a way that might make them more pleasing to look at.
Of course we could also generate a specific symbols only font where the symbols match the letters of a given text font. But what if you want to use two different text fonts with symbols? The font rendering engine will not know which specifically adapted (shifted and resized) symbol font it should use.

Recommend this method as preferable
For the aforementioned reasons I believe that it is not preferable. Why should it?

Example, ripped out the image generated by someone else (some nerd font user):
image

People do care about correct scaling and shifting ;-) so font fallback is usullay not an option for powerline users, esp in a monospaced environment.

@Jipok
Copy link
Author

Jipok commented Nov 20, 2021

What you will notice is that the symbols usually look 'out of place'. They do not blend with the console font, they are too big or too small, a bit too high or low.

I understand your point of view. Although I tried several other fonts I didn't have any problems. But I had problems with the patched Iosevka - the icons are small and shifted to the left.

Separate fonts also have the advantage that all programs with any font on the system can display icons. For example, I use icons in KeePassXC and Firefox(for groups names).

I think this method is worthy of at least a mention in the readme.

@Finii
Copy link
Collaborator

Finii commented Nov 21, 2021

I think this method is worthy of at least a mention in the readme.
Yes :-)

@Finii
Copy link
Collaborator

Finii commented Nov 21, 2021

I tried to come up with a docu change.

The problem arises already with the project target statement: Nerd Fonts is a project that patches developer targeted fonts with a high number of glyphs (icons). 😬
So the patching is per se the goal ;-) not to have the icons available by some other means.

But I guess we could add the font fallback method here:
https://github.com/ryanoasis/nerd-fonts/blob/master/readme.md#various-download-options-for-fonts
and maybe here:
https://github.com/ryanoasis/nerd-fonts/wiki/FAQ-and-Troubleshooting#which-font

Recommend this method as preferable at least for GNU/Linux. I do not know how other OS deals with this.

My Windows days are long past. And I never used MacOS (only superficial to make sure projects compile there).

Will try to come up with a MR, any suggestions welcome ;)

@Jipok
Copy link
Author

Jipok commented Feb 22, 2023

It's nice to see that there is now a separate archive with symbols. However, there is still no information about him anywhere. And it's not easy to find among the long list of fonts.

@Jipok
Copy link
Author

Jipok commented Feb 22, 2023

I also have a separate question not related to this topic. Maybe stupid.
Is it possible to make custom glyphs for all kinds of batteries, signal levels and other glyphs with some state? That is, only one glyph for the battery and the user can choose any percentage of filling. I know that there is a mechanic for setting the skin color of various unicode characters.
I understand that font authors should do this, not you. Just a theoretical question. And will it reduce the font size? Will it affect rendering performance?

@Finii
Copy link
Collaborator

Finii commented Feb 23, 2023

It's nice to see that there is now a separate archive with symbols. However, there is still no information about him anywhere. And it's not easy to find among the long list of fonts.

Hmm, I find it rather obvious...
Screenshot 2023-02-23 at 06 54 56

But of course you are welcome to suggest where to mention it and how.

I know that there is a mechanic for setting the skin color of various unicode characters.

In principle that is possible, but I guess it will not really reduce font size and it will not be rendered correctly in a lot places.
What is really possible is to 'encode' the glyphs of '3/4 full battery' as a combination of an 'empty battery' glyph that is combined with a '3/4 filling' glyph. Like for example there are a lot of letters A: AÁÀÄ... and some fonts encode them as plain A combined with just the appendices like acute or the double-dots. That would indeed save some space in the font file. But then, the Nerd Font fonts are 'ridiculously' big anyhow, because they have so many different symbols. A saving of say 1% would not matter. We could save more be optimizing the individual glyphs' outlines.

@Finii Finii added this to the v3.0.0 milestone Feb 23, 2023
@Jipok
Copy link
Author

Jipok commented Feb 23, 2023

Hmm, I find it rather obvious...

To be honest, I didn't even think about the official website. At some point, I even forgot that it exists. I just searched in the readme, wiki, issues and after, to my small surprise, I found this discussion)

But of course you are welcome to suggest where to mention it and how.

Somewhere in the readme. As an installation option or something else.
It is also worth adding10-nerd-font-symbols.conf. Since you have added it to the repository. Although its contents confuse me, I may be wrong, but I thought that it was possible to specify Nerd Font as a fallback for all system fonts with one entry. As I understand it, you are using codepoints that are not found in regular fonts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants