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
52.68k stars 3.59k forks source link

BlexMono and IBM Plex Mono weights don't match #1541

Closed matterhorn103 closed 3 months ago

matterhorn103 commented 3 months ago

🗹 Requirements

🎯 Subject of the issue

Experienced behavior: The BlexMono Nerd Fonts are lighter than the IBM Plex Mono fonts on my system with the same weight name.

Expected behavior: 1:1 weight correspondence.

Extra information: Prior to updating to KDE Plasma 6.0.1 I already had lsd set up and working with the symbols-only Nerd Font as a fallback font. For some reason that stopped working and I will have to reconfigure my fonts. While exploring the other approach (using the patched font) I noticed the mismatch in weights.

🔧 Your Setup

★ Screenshots (Optional)

Above is BlexMono Medium, bottom is IBM Plex Mono Medium as obtained from the OpenSUSE Tumbleweed main repos. Both are at 10pt.

Screenshot_20240314_133419 Screenshot_20240314_133453

matterhorn103 commented 3 months ago

By the way, the reason that using SymbolsNerdFontRegular.ttf as a fallback font no longer works in KDE Plasma 6 is due to this "bug".

It actually comes down to a deliberate change in Qt 6.5 to disable font fallback for PUA glyphs.

Hopefully if anyone looks to report the issue here they will find this comment.

Finii commented 3 months ago

Issue 1541 :-) Well, 1541 will always remind me of my first very fast computer mass storage: image Where we thrilled when it came about in the early 1980s...

Sorry, I digress.

Konsole; hmm, can you check this with some non-terminal program first, like Libreoffice Writer? I have no Konsole installed and thus can not try (without leaving my lazy mode).

OH!! I see it, never mind. This should be an easy fix, hold on...

image

Finii commented 3 months ago

I am too dumb...

image

The fonts do look same, weight wise, and fontforge font-diff does not find any outline differences, so the weight should be preserved. Looking on metadata now.

image

matterhorn103 commented 3 months ago

Hmm you're right, in LibreOffice Writer for example they look identical. Perhaps something to do with KDE/Plasma/Qt then – the differences are there both in Konsole and in the fonts section of the system settings menu. I'll investigate.

Oh, and thanks for the rapid response.

Finii commented 3 months ago

Well, I guess the problem is this:

image

The hinting in otf and ttf is completely different, maybe that is the problem. You can try installing the ttf version of IBM Plex from their repo https://github.com/IBM/plex/releases (or from our repo under src/unpatched-fonts/).

And I just noticed that they have had updates :grimacing:

If you prefer to keep the Tumbleweed font, you could also try a self patch. That should be easy enough, for example with the docker-patcher (if you ever used docker before).

:thinking: :thought_balloon: Why has Tumbleweed an even older font than we have?

Finii commented 3 months ago

They did change the hinting in the 2.4 version (we have 2.3)

image

Finii commented 3 months ago

Naming looks ok on our side (some time ago we had problems with fonts that had the wrong family/style name).

image

Finii commented 3 months ago

AH, gotcha!

image

lowestrecppem controls the hinting of small sizes; this should probably not be different.

Edit:

AND the PS weight name in the ttf is book while it is normal in the otf. Why differs this? If the application chooses the font based on PS weight it will probably get the wrong font. Not that usually applications choose the font by PS weight, but still strange the differences.

Finii commented 3 months ago

It actually comes down to a deliberate change in Qt 6.5 to disable font fallback for PUA glyphs.

How ridiculous is that? oldherl is of course right. The statement in the top indicates that any PUA glyph, even if available in the current font, is mapped to some random fallback font. That would be broken of course. But Qt knows better, as usual, than decades of people who thought how font systems can work most efficiently :roll_eyes:

matterhorn103 commented 3 months ago

Why has Tumbleweed an even older font than we have?

Possibly because I made a mistake, it's not from the main repo at all but from the "M17N:fonts" repository. I might ask them to update to 6.4 (with Mono 2.4).

It might be to do with hinting. I also found this bug report for Konsole in Plasma 6. And I feel like the .otf font is noticeably heavier now in Kate. So maybe there are bugs with font hinting that need to be ironed out or something.

I'll grab the latest .ttf and .otf from IBM directly and see if they render differently for me.

matterhorn103 commented 3 months ago

Ok yes, that seems to be it, the otf font is being rendered significantly bolder than the ttf in both Konsole and Kate, even with the most recent 6.4 release.