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: Fix scaleGlyph related rounding error #921

Merged
merged 1 commit into from
Sep 8, 2022

Conversation

Finii
Copy link
Collaborator

@Finii Finii commented Sep 8, 2022

[why]
Sometimes the patched-in symbols are slightly too big, which shows up in Nerd Font Mono fonts where the destination size is specified exactly.

That issues a warning like:

  Warning: Scaled glyph U+F077 wider than one monospace width

[how]
For the scaleGlyph groups we need to combine the bounding boxes of several symbol glyphs to determine the 'combined' scale we need. Unfortunately when the concrete glyph is finally copied over its size can change minimally.

So we need to measure the glyphs in the scaleGroup after they have been copied to the to-be-patched font. This is a bit complicated, because we need to know some glyph slot we can use for that.

[note]
See also commit
e805b87 font-patcher: Resolve rounding error when rescaling

Fixes: #917

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)

[why]
Sometimes the patched-in symbols are slightly too big, which shows up in
Nerd Font Mono fonts where the destination size is specified exactly.

That issues a warning like:
  Warning: Scaled glyph U+F077 wider than one monospace width

[how]
For the scaleGlyph groups we need to combine the bounding boxes of
several symbol glyphs to determine the 'combined' scale we need.
Unfortunately when the concrete glyph is finally copied over its size
can change minimally.

So we need to measure the glyphs in the scaleGroup _after_ they have
been copied to the to-be-patched font. This is a bit complicated,
because we need to know some glyph slot we can use for that.

[note]
See also commit
  e805b87  font-patcher: Resolve rounding error when rescaling

Fixes: #917

Signed-off-by: Fini Jastrow <[email protected]>
@Finii Finii merged commit 983226a into master Sep 8, 2022
@Finii Finii deleted the bugfix/scaleGlyph-rounding branch September 8, 2022 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nerd Font Mono font with too-wide glyphs
1 participant