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

Draft: Scale powerline glyphs always #967

Closed
wants to merge 3 commits into from

Conversation

Finii
Copy link
Collaborator

@Finii Finii commented Oct 14, 2022

Description

After this PR the powerline glyphs (well, some of them) will always be scaled down to one cell, as if -s (--mono) has been supplied. This is only relevant for the non-Mono font variants of course.

Requirements / Checklist

What does this Pull Request (PR) do?

How should this be manually tested?

Any background context you can provide?

What are the relevant tickets (if any)?

Screenshots (if appropriate or helpful)

Finii added 3 commits October 14, 2022 11:08
[why]
When a non-Mono font (i.e. `Nerd Font` not `Nerd Font Mono`) is created
the goal is to have big (up to 2 cell wide) symbols. But usually you
still want to have only one cell wide powerline glyphs, to have them
handable.

[how]
Introduce a new attribute parameter 'single' that means that the (xy in
the changed cases) scaling to one cell shall take place even if `-s` is
not given.

It is ignored if the sourcefont is not monospaced, because we could not
scale in that case anyhow (to which cell-size should we scale?).

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The overlap into the previous/next character is used to prevent small
gaps in colored powerlines. These show up as small colored line and can
usually be suppressed by changing the antialiasing method. But for
people who can no change the antialiasing the overlap 'covers up' the
gap.

But this is not relevant if the glyph is just a 'line'. There just isn't
any gap that needs covering-up.

[note]
Also: Add missing RHS-waveform instructions.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
The vertical overlap has never been a problem (as far as I know). It is
maybe good to have some overlap for the terminal emulators that support
vertical overlap.
On terminals that truncate at the nominal cell border too much overlap
looks bad, i.e. the glyphs 'distorted'.

If we ever increase the overlap it is most likely be meant to be the
left-right overlap.

[note]
Originally this has been part of commit fecda6a of #780.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii Finii added this to the v2.3.0 milestone Oct 14, 2022
@Finii Finii self-assigned this Oct 14, 2022
@Finii
Copy link
Collaborator Author

Finii commented Oct 14, 2022

This shows the current state for Nerd Font (i.e. non-Mono), Inconsolata shown:

Peek 2022-10-14 17-25

The 'cell' is the rectangle in the middle. The glyphs are either right or left aligned to the cell border, with some small overlap.
The glyphs are scaled vertically to match the font's line spacing.

Horizontal spacing is untouched. That means that

  • a) The glyphs get distorted (aspect ratio changed) (which might only interest for 'Lego' or 'Squares' glyphs)
  • b) The length in the non-aligned direction is not controlled

Some of the right aligned glyphs, like flames, extend rather far into previous 'territory'.
Already the inverse-D-shape extends into the previous char. This of course depends on the concrete patched font.

@Finii
Copy link
Collaborator Author

Finii commented Oct 14, 2022

@Finii
Copy link
Collaborator Author

Finii commented Oct 27, 2022

How does this relate to

@Finii
Copy link
Collaborator Author

Finii commented Jan 12, 2023

This is obsoloete / is now part of

Finii added a commit that referenced this pull request Jan 12, 2023
[why]
The vertical overlap has never been a problem (as far as I know). It is
maybe good to have some overlap for the terminal emulators that support
vertical overlap.
On terminals that truncate at the nominal cell border too much overlap
looks bad, i.e. the glyphs 'distorted'.

If we ever increase the overlap it is most likely be meant to be the
left-right overlap.

[note]
Originally this has been part of commit fecda6a of #780.

[note2]
Originally this has been part of PR #967.
Although that had a bug 😬
It used max() instead of min() (T_T)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii Finii closed this Jan 12, 2023
Finii added a commit that referenced this pull request Jan 12, 2023
[why]
The vertical overlap has never been a problem (as far as I know). It is
maybe good to have some overlap for the terminal emulators that support
vertical overlap.
On terminals that truncate at the nominal cell border too much overlap
looks bad, i.e. the glyphs 'distorted'.

If we ever increase the overlap it is most likely be meant to be the
left-right overlap.

[note]
Originally this has been part of commit fecda6a of #780.

[note2]
Originally this has been part of PR #967.
Although that had a bug 😬
It used max() instead of min() (T_T)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Finii added a commit that referenced this pull request Jan 12, 2023
[why]
The vertical overlap has never been a problem (as far as I know). It is
maybe good to have some overlap for the terminal emulators that support
vertical overlap.
On terminals that truncate at the nominal cell border too much overlap
looks bad, i.e. the glyphs 'distorted'.

If we ever increase the overlap it is most likely be meant to be the
left-right overlap.

Note that the glyphs are usually valign='c' and the overlap is
distributed half top and half bottom. There are no other valign values
implemented (just 'not align' which is ... most likely bad).

[note]
Originally this has been part of commit fecda6a of #780.

[note2]
Originally this has been part of PR #967.
Although that had a bug 😬
It used max() instead of min() (T_T)

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

f
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this pull request Nov 24, 2023
[why]
The vertical overlap has never been a problem (as far as I know). It is
maybe good to have some overlap for the terminal emulators that support
vertical overlap.
On terminals that truncate at the nominal cell border too much overlap
looks bad, i.e. the glyphs 'distorted'.

If we ever increase the overlap it is most likely be meant to be the
left-right overlap.

Note that the glyphs are usually valign='c' and the overlap is
distributed half top and half bottom. There are no other valign values
implemented (just 'not align' which is ... most likely bad).

[note]
Originally this has been part of commit fecda6a of ryanoasis#780.

[note2]
Originally this has been part of PR ryanoasis#967.
Although that had a bug 😬
It used max() instead of min() (T_T)

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

f
@Finii Finii deleted the feature/powerline-always-mono branch March 16, 2024 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant