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

font-patcher: Prevent excessively tall icons in mono fonts #1564

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

Finii
Copy link
Collaborator

@Finii Finii commented Mar 28, 2024

[why]
Very slender and tall icons will be scaled huge compared to their fatter neighbors. This happens for example to the chess pieces (E25F ff) or text style icons like italic (EB0D).

[how]
When a monospaced font is created use a slightly less tall cell height for all icons (except icons that have to match the actual line height).

This can be prevented by the new scale control character ^ that symbolizes maximized vertical size (height) within the real cell.

The smaller cell (now called icon cell) is less tall than the line height, but higher than the cap height of the font; to prevent people complaining that the icons shrunk too much.
It is about 1/3 higher than the cap height compared to the line height:

image

This is NOT applied to the other Nerd Fonts fonts variants (i.e. Regular and Propo) because all icons are generally a bit bigger than the cap height (no scaling down to fit into one advance width) and as the scaling is far less pronounced the slender-and-tall icons scale comparably and do not look out off place there.

Suggested-by: Aaron Bell @aaronbell

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)

Some examples, prior left, with this PR right; glyphs marked blue by Fontforge:

image

image

image

@Finii Finii added this to the v3.2.0 milestone Mar 28, 2024
[why]
Very slender and tall icons will be scaled huge compared to their fatter
neighbors. This happens for example to the chess pieces (E25F ff) or
text style icons like italic (EB0D).

[how]
When a monospaced font is created use a slightly less tall cell height
for all icons (except icons that have to match the actual line height).

This can be prevented by the new scale control character `^` that
symbolizes maximized vertical size (height) within the real cell.

The smaller cell (now called icon cell) is less tall than the line
height, but higher than the cap height of the font; to prevent people
complaining that the icons shrunk too much.
It is about 1/3 higher than the cap height compared to the line height.

This is NOT applied to the other Nerd Fonts fonts variants (i.e. Regular
and Propo) because all icons are generally a bit bigger than the cap
height (no scaling down to fit into one advance width) and as the
scaling is far less pronounced the slender-and-tall icons scale
comparably and do not look out off place there.

Suggested-by: Aaron Bell @aaronbell
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii Finii force-pushed the feature/prevent-beanpole-icons branch from 6298c13 to 5a958b3 Compare March 29, 2024 12:28
@Finii
Copy link
Collaborator Author

Finii commented Mar 29, 2024

Rebase on master, force push

SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo".

Which is hard(er) because the sequences are not interpreted unless they
are in the format string.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii Finii merged commit d311593 into master Mar 29, 2024
6 checks passed
@Finii Finii deleted the feature/prevent-beanpole-icons branch March 29, 2024 12:43
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