-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ttf font bounding box calculations (#6109)
letterSpacing scales the default spacing between glyphs, as such it needs to default to 1.f. This means, letterSpacing of 1.0 means neutral letter spacing, glyph is placed in default position, respecting the glyph's advance value. If letterSpacing is 0.75, this means that spacing between letters is reduced by 0.25 * the whitespace width of the current font. *If letterSpacing is 1.25, this means that an additional space of 0.25 * the whitespace width is added between letters. Since proportional fonts have per-glyph advance values, we use a constant width as whitespace width. additionally, per spec, we scale the default whitespace width by the font's property spaceSize Also remove comments in docs specifying that we use p to calculate the size of the space character which is no longer true since some time ago Fixes #6106
- Loading branch information
Showing
2 changed files
with
26 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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