Open
Conversation
Contributor
|
Does this apply to regular skewed glyphs? I imagine skewed COLR glyphs are pretty uncommon. But skewed regular glyphs for "fake italic" would be significantly more common. |
Collaborator
Author
|
Nope, it only applies for cached glyphs. And caching i never applied if a glyph is skewed. |
Collaborator
Author
|
Sorry, that was an accident 😅 |
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.
Initially, in Vello CPU, any COLR glyph would first be rendered into an intermediate pixmap and that pixmap would then be rendered into the surface. Because of this, in case there was a skewing factor in the glyph, instead of just rasterizing the glyph at its normal font size, we would apply an additional scaling factor such that it would be rasterized at a higher solution, avoiding aliasing artifacts that arise from the skewing.
However, since the most recent changes, things are different: By default, glyphs are always directly rendered into a surface. Glyphs are only cached if they don't have any skewing factor (if in the future we decide that we also want glyph caching for rotated glyphs, we can easily just fold this into the font size again). Therefore, this additional scaling procedure becomes unnecessary. By doing so, the code becomes a easier to understand (in my opinion).
As a nice side effect, this PR also fixes a discrepancy between cached and non-cached rendering that existed previously:
rec.mp4
As you can see, previously (on the left) cached and non-cached glyphs would have slightly different positions. Now, they seem to have the same position. I must confess I don't fully understand why this was the case, but the tests don't lie! 😄