[Font] Fix glyph bitmap alignment from SDF fonts #2380
Merged
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.
PR Details
Fix horizontal/vertical alignment of glyphs from generated SDF bitmaps.
According to the original author
-autoframe
more meant for previewing rather than actual usage due to it centering the glyph to fit exactly centered on the bitmap rather than how it should be fitted on the bitmap (ie. snapped to the top-right corner).Other change is debug build, dump the SDF bitmaps in into a sub-folder in the temp directory instead of straight into the temp directory so it's easier to delete. This does not affect the release build.
Related Issue
#2172 Only fixes the vertical alignment, not the kerning issue (which I have no clue about).
Merely an FYI, but this is the original logic for autoframe:
https://github.com/stride3d/msdfgen/blob/1af188c77822e447fe8e412420fe0fe05b782b38/main.cpp#L684-L709
Types of changes
Checklist