Use unrounded glyphs as source - #1849
Merged
Merged
Conversation
[why] We construct the octicons font file from the original svgs. To put them into the font file the svg is interpreted and transformed into the font coordinate system, and then again scaled. The resulting font file is then saved as `ttf`, thereby rounding all coordinates. That font is then used as source for the real patching process - and will be rounded again (possibly). The rounding errors accumulate and we should only round once. That means intermediate fonts need to be `otf`. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
See previous commit for explanation. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Collaborator
Author
|
@allcontributors please add @duytrung for bug |
Contributor
|
I've put up a pull request to add @duytrung! 🎉 |
Collaborator
Author
|
Example of what this fixes: This is Lilex NFM, left side before the PR, right side after. This needs to be looked at big. Note for example the lower-right stem of the Some new small scale issues turn up after the PR, but these are even more minuscule. |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
We take svgs and produce intermediate font files; these font files will be used to patch in the glyphs.
When a
ttffont is created the coordinates will be rounded to integers, and doing this twice (with scaling in between) adds more rounding errors than would be needed.Detail of
2665inocticons.ttf(left) andocticons.otf(right)The imperfections of the left glyph will be exaggerated when it is scaled and again coordinate-rouneded, like for example:
Patched Hermit with floating point node coordinates (left) and with integer rounding of coordinates (right)
Requirements / Checklist
Issue number where discussion took place: #xxx
What does this Pull Request (PR) do?
Minimize rounding errors introduced by the intermediate glyph fonts that we use to patch in lots and lots of svgs.
How should this be manually tested?
Any background context you can provide?
What are the relevant tickets (if any)?
Screenshots (if appropriate or helpful)