Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: text rendering spacing, positioning, kerning
I had been using stb_truetype poorly. 1. Removed my metrics data structure and switched to stb_truetype's. 2. Renamed from "point size" to "pixel size". stb_truetype supports both and I am using pixel size. 3. Added bounds checking to avoid rendering characters that aren't in the texture. 4. Enabled stb_truetype's kerning. 5. Simplified the baseline calculation using stb_truetype's recommended approach.
- Loading branch information
1 parent
0b5bba3
commit ba7da2e
Showing
2 changed files
with
96 additions
and
74 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