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

Power Line half cirles streched #658

Closed
JanzenJohn opened this issue Aug 21, 2021 · 8 comments · Fixed by #916
Closed

Power Line half cirles streched #658

JanzenJohn opened this issue Aug 21, 2021 · 8 comments · Fixed by #916

Comments

@JanzenJohn
Copy link

JanzenJohn commented Aug 21, 2021

Powerline symbols are Streched (horizontally)

Im trying to use the powerline symbols U+E0B6 and U+E0B4

  • Which font are you using "Symbols-2048-em Nerd Font Complete.ttf" (in the arch repo)
  • Which terminal emulator are you using None I'm trying to use them in polybar
  • Are you using OS X, Linux or Windows? And which specific version or distribution? Im using Linux (artix, kernel 5.13)

★ Optional

image
two "half circles" should create a cirle ? (the "blob" on the right are the two half circles)

@Finii
Copy link
Collaborator

Finii commented Sep 30, 2022

Hmm, your symbols look more distorted than encoded:

image

These round Powerline Things were never half-circles, half-circles would look to small, that is the reason why they were designed to be more elliptic than round.

@Finii
Copy link
Collaborator

Finii commented Sep 30, 2022

Ah, I see the problem, it is in the Mono variant...

image

@Finii
Copy link
Collaborator

Finii commented Sep 30, 2022

I'm not really sure the Symbols Only Mono font does make any sense. What do you use it for? And why (not the non Mono one)?

@Finii
Copy link
Collaborator

Finii commented Dec 22, 2022

Working on this right now....

By the side: How bad is that, the source of the rounded things already has them ... strangely placed:

image

The 'full' blob is a bit higher than the 'line'. Pink rectangulars added with my screenshot tool.

@Finii
Copy link
Collaborator

Finii commented Dec 22, 2022

😭

WTF

image

Not only are the 'line' things further down then the 'full' things (but at least both pairs are equal!),
no, the round-on-right LINE is as if it is about the same position as the FULL

but the round-on-left LINE is right aligned as the FULL, making it considerably more rightish that expected.
It should be in the middle, like the other LINE thing

@Finii Finii mentioned this issue Dec 29, 2022
2 tasks
Finii added a commit that referenced this issue Jan 4, 2023
[why]
The powerline glyphs (and only them) undergo a xy scaling, where both
dimensions are maximized into the 'cell'.

Normally cells are taller than wide, and everyting looks fine. But we
have square cells (e.g. 2048 * 2048) with the SymbolsOnly font, and
there might be some self patched font that has similar very-wide (in
comparison to hight) cells.

In these fonts some powerline glyphs look rather ugly. For example the
'half cicles' become very wide and un-round, the triangulars become very
pointy.

[how]
Add a new patch-set attribute 'xy-ratio'. When that is set the vertical
(y) scaling is done as usual but the horizontal (x) scaling is limited
such that the width/height ratio is maximally the attributes value.

For example setting it to 0.75 the height is maximized (as usual) but
the width is maximized to be less then 0.75 times the hight (or as wide
as the cell is, whatever is smaller).

It will work with both, 'xy' and 'pa' scaling, at least theoretically.
It has been only checked where it is used now, i.e. with 'xy'.

A possible overlap is not taken into account.

[note]
The values are taken for this reasons:
- 0.59: This is the original half-circle ratio, higher values make them
        loose the (half) circular appearance
- 0.5:  The half circle lines are more shallow
- 0.7:  The triangulars should not be too pointy (random number)

Fixes: #658

Signed-off-by: Fini Jastrow <[email protected]>
@Finii
Copy link
Collaborator

Finii commented Jan 4, 2023

This was a tough one, but I think the solution is rather nice. It was about the 4th or 5th different approach. I guess the new code describes best what we want to achieve here.

Thanks for reporting!

@Finii Finii closed this as completed in #916 Jan 5, 2023
@JanzenJohn
Copy link
Author

Sorry for the late reply, the only email message from GitHub that I got was from the closing of the issue. Thanks for fixing it though. Your work is much appreciated

@github-actions
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 Jul 10, 2023
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this issue Nov 24, 2023
[why]
The powerline glyphs (and only them) undergo a xy scaling, where both
dimensions are maximized into the 'cell'.

Normally cells are taller than wide, and everyting looks fine. But we
have square cells (e.g. 2048 * 2048) with the SymbolsOnly font, and
there might be some self patched font that has similar very-wide (in
comparison to hight) cells.

In these fonts some powerline glyphs look rather ugly. For example the
'half cicles' become very wide and un-round, the triangulars become very
pointy.

[how]
Add a new patch-set attribute 'xy-ratio'. When that is set the vertical
(y) scaling is done as usual but the horizontal (x) scaling is limited
such that the width/height ratio is maximally the attributes value.

For example setting it to 0.75 the height is maximized (as usual) but
the width is maximized to be less then 0.75 times the hight (or as wide
as the cell is, whatever is smaller).

It will work with both, 'xy' and 'pa' scaling, at least theoretically.
It has been only checked where it is used now, i.e. with 'xy'.

A possible overlap is not taken into account.

[note]
The values are taken for this reasons:
- 0.59: This is the original half-circle ratio, higher values make them
        loose the (half) circular appearance
- 0.5:  The half circle lines are more shallow
- 0.7:  The triangulars should not be too pointy (random number)

Fixes: ryanoasis#658

Signed-off-by: Fini Jastrow <[email protected]>
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.

2 participants