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
54.76k stars 3.65k forks source link

nf-hack behaves differently than the original hack-font #1245

Closed zeus86 closed 7 months ago

zeus86 commented 1 year ago

🗹 Requirements

🎯 Subject of the issue

Experienced behavior: On Arch (x86_64, Kernel 6.3.2) with Bash on Konsole (23.04.1) and oh-my-posh the hack-font provided by the arch-repos (extra/ttf-hack 3.003-3) behaves differently on rendering e.g. powerline-symbols. The original hack-font already contains some powerline-symbols (which do render correctly in konsole), but the nf-hack font slightly squishes the symbols together (depending on font-size. however, the usable range is broken anyways, i usually use fonsize 10.0). On the example of the right|left-hard-devider icons, it looks like, as if the triangle is misplaced by 1px or so, see screenshots for details. While it doesn't look super-annoying, the original hack-font renders differently. So far i tested some more fonts (but without direct comparison to their original counterpart), namely dejavu-sans, 3270, anonymice-pro, meslo and sourcecode pro, but all of them seem to render slightly off, so i thought this was a konsole-issue, however, og-hack renders fine... (tested basically all other konsole-options which might have an influence but with no result)

Expected behavior: Both fonts should behave identical

Example symbols:

★ Screenshots (Optional)

fonsize=10: original hack-font:
og-hack

nf-hack:
nf-hack
another example with more colors:
nf-hack-root

Finii commented 1 year ago

Sorry to see your problem.

All pre-existing Powerline glyphs are (have to be) dropped when a font is Nerd Fonts patched. But I will check why there are differences.

By displaced 1 px you mean sidewards (1 px to the right)? What I also maybe see is that they seem to be 1 px less tall and 1 px further up (meaning the whole symbol is 2 px less tall, but centered).

What you can try is to switch to monospaced antialiasing, that should remove the faint greenish line after "zeus". All the differences look like an antialiasing/rescaling problem.

It is indeed possible to generate a font that does not show the faint lines (see #780), but that raises other problems in other terminals, so what we do not is a compromise. But I will check original Hack, how they solve it.

But please do write if this is your problem or something else?

zeus86 commented 1 year ago

@Finii I think you are right, but the faint line is there regardless if i use the monospaced font or not, just some symbols (like the arch logo) are smaller in the monospace variant, the faint aliased line persists, or better "is unchanged".

But yes, this is my problem :)

zeus86 commented 1 year ago

interesting note on top of that: if i increase the vertical spacing between the lines in konsole, the effects gets even more pronounced (but i guess this comes from how oh-my-posh does the rendering of the background-colors). anyhow, i cannot reduce the spacing to less than zero.

Finii commented 1 year ago

image Left to right: Hack, Nerd Font, Cascadia Code

We have the least amount of overlap. This is related to

Maybe we should revive that. Also our glyph has no "overlap patch" but is a simple triangle which becomes more and more problematic when overlap is increased.

Maybe we want to have this in 3.1.0, I would not change behavior again already in a bugfix release.

Finii commented 1 year ago

Somehow the cell height is higher than intended here:

image

Hmm, konsole ... where do I get that from ;-) Sigh.

zeus86 commented 1 year ago

Hmm, konsole ... where do I get that from ;-) Sigh.

It is the default-terminal of KDE/plasma :)

Finii commented 1 year ago

...and many more (at least basically all useable dividers)

Well, I guess the open triangle thing (also in my image above, the right one) has NO problem. Maybe you can assemble a list of the really affected glyphs? I guess all Powerline glyphs that end with a full surface either right or left.

image

Finii commented 1 year ago

Aaron really added that overlap surface to all relevant glyphs

image

That is far better than the overlap. I think we should mimic that for 3.1

zeus86 commented 1 year ago

Aaron really added that overlap surface to all relevant glyphs

lol, awesome finding :)

Finii commented 1 year ago

But he did not even clean up the insane amount of points in waveform or flames, just copied them unchanged over from here (and adding the side surface) :grimacing:

Note to self: Clean that stuff up, opening the glyphs flame and waveform takes ages.

memchr commented 1 year ago

Maybe we should revive that. Also our glyph has no "overlap patch" but is a simple triangle which becomes more and more problematic when overlap is increased.

I think it's a good idea to do that because this problem also presents in SymbolsNerdFont-Regular.ttf. This means that any aliases in the 10-nerd-font-symbols.conf will be affected.

for example with Cascadia Code

default: image

Replace U+E0B2 of SymbolsNerdFont-Regular.ttf with glyphs copied from the original hack font: image

Finii commented 12 months ago

WTF, it has an outline?!!

image

Editing and simplifying.

Finii commented 12 months ago

Okay, I just changed the full left and right triangles. Lets see if this is good; then we can expand to the other powerline glyphs. Please report back after v3.1.0 (which will come out any day now).

zeus86 commented 12 months ago

Awesome! Will test it right away, as soon the release is out!

However, shouldn't this issue be kept open (because it affects most likely many symbols, that aren't patched yet?)?

Finii commented 12 months ago

And we need to check that it works for the one icon at all ;-)

Finii commented 7 months ago

Closing as release is near now, so that I can sort out what is still missing.

zeus86 commented 6 months ago

just to report back, because i didn*t yet explicitly: i recently updated my nerd-fonts via the oh-my-posh font-installer (oh-my-posh font install), and I'm happy tp report, that the nf-hack-font now looks as it should. crisp and clear on all zoom-levels inkonsole` under KDE on Arch.

Thanks for your effort.

github-actions[bot] commented 21 hours 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.