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

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

Closed
3 tasks done
zeus86 opened this issue May 16, 2023 · 18 comments · Fixed by #1419
Closed
3 tasks done

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

zeus86 opened this issue May 16, 2023 · 18 comments · Fixed by #1419

Comments

@zeus86
Copy link

zeus86 commented May 16, 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:
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:

  • nf-pl-left_hard_divider
  • nf-pl-right_hard_divider
  • ...and many more (at least basically all useable dividers)

🔧 Your Setup

  • Which font are you using (e.g. Anonymice Powerline Nerd Font Complete.ttf)?
    • HackNerdFont-Regular.ttf (but applies to mono-variants as well as other nf-fonts as well)
  • Where did you get the file from (download link, self patched, source downloaded from link...)
  • Which terminal emulator are you using (e.g. iterm2, urxvt, gnome, konsole)?
    • konsole 23.04.1
  • Are you using OS X, Linux or Windows? And which specific version or distribution?
    • Arch Linux

★ Screenshots (Optional)

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

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

@Finii
Copy link
Collaborator

Finii commented May 17, 2023

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
Copy link
Author

zeus86 commented May 20, 2023

@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
Copy link
Author

zeus86 commented May 20, 2023

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
Copy link
Collaborator

Finii commented Jun 2, 2023

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
Copy link
Collaborator

Finii commented Jun 2, 2023

Somehow the cell height is higher than intended here:

image

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

@zeus86
Copy link
Author

zeus86 commented Jun 2, 2023

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

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

@Finii
Copy link
Collaborator

Finii commented Jun 2, 2023

...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
Copy link
Collaborator

Finii commented Jun 2, 2023

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

@Finii Finii added this to the v3.1.0 milestone Jun 2, 2023
@zeus86
Copy link
Author

zeus86 commented Jun 2, 2023

Aaron really added that overlap surface to all relevant glyphs

lol, awesome finding :)

@Finii
Copy link
Collaborator

Finii commented Jun 2, 2023

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) 😬

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

@memchr
Copy link

memchr commented Jun 7, 2023

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
Copy link
Collaborator

Finii commented Nov 16, 2023

WTF, it has an outline?!!

image

Editing and simplifying.

Finii added a commit that referenced this issue Nov 16, 2023
[why]
The waveform glyphs E0C8 and E0CA have an incredable amount of points
and rendering is rather expensive.

It turned out that it has a hairline ourline, that will be invisible
anyhow.

[how]
Remove the Hairline, reducing the number of points to 1/3.

[note]
See #1245

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Finii added a commit that referenced this issue Nov 16, 2023
[why]
We still fight with the faint lines on the big side of the powerline
glyphs. They come from the LCD antialiasing mode that has problems with
the borders.

Other fonts use far more overlap. We use only a modest amount of overlap
(2% of the width).

[how]
As the other fonts do, increase the overlap (to 7% now). We could not do
that before, because we had no full-hight 'landing platforms' on the
outsides and so the triangle would look cut off at not 100% hight.

Now with the landing platforms we can increase the overlap and still
have nice looking triangles that visibly reach the top and bottom of the
line.

Implement this only for the filled triangles to see how it goes.

Related: #1245

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

Finii commented Nov 16, 2023

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
Copy link
Author

zeus86 commented Nov 16, 2023

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
Copy link
Collaborator

Finii commented Nov 16, 2023

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

@Finii Finii reopened this Nov 16, 2023
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this issue Nov 24, 2023
[why]
The waveform glyphs E0C8 and E0CA have an incredable amount of points
and rendering is rather expensive.

It turned out that it has a hairline ourline, that will be invisible
anyhow.

[how]
Remove the Hairline, reducing the number of points to 1/3.

[note]
See ryanoasis#1245

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this issue Nov 24, 2023
[why]
We still fight with the faint lines on the big side of the powerline
glyphs. They come from the LCD antialiasing mode that has problems with
the borders.

Other fonts use far more overlap. We use only a modest amount of overlap
(2% of the width).

[how]
As the other fonts do, increase the overlap (to 7% now). We could not do
that before, because we had no full-hight 'landing platforms' on the
outsides and so the triangle would look cut off at not 100% hight.

Now with the landing platforms we can increase the overlap and still
have nice looking triangles that visibly reach the top and bottom of the
line.

Implement this only for the filled triangles to see how it goes.

Related: ryanoasis#1245

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Finii added a commit that referenced this issue Mar 20, 2024
[why]
We still fight with the faint lines on the big side of the powerline
glyphs. They come from the LCD antialiasing mode that has problems with
the borders.

Other fonts use far more overlap. We use only a modest amount of overlap
(1% of the width).

[how]
As the other fonts do, increase the overlap (to 6% now).

Add full-hight 'landing platforms' on the outsides of the glyphs,
which are 7% wide.

Related: a8b9e1d
Related: #1245

Fixes: #1547

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

Finii commented Mar 30, 2024

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

@Finii Finii closed this as completed Mar 30, 2024
hasecilu pushed a commit to hasecilu/nerd-fonts that referenced this issue Apr 3, 2024
[why]
We still fight with the faint lines on the big side of the powerline
glyphs. They come from the LCD antialiasing mode that has problems with
the borders.

Other fonts use far more overlap. We use only a modest amount of overlap
(1% of the width).

[how]
As the other fonts do, increase the overlap (to 6% now).

Add full-hight 'landing platforms' on the outsides of the glyphs,
which are 7% wide.

Related: a8b9e1d
Related: ryanoasis#1245

Fixes: ryanoasis#1547

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

zeus86 commented May 11, 2024

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 in konsole` under KDE on Arch.

Thanks for your effort.

Copy link
Contributor

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 Nov 11, 2024
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.

3 participants