Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Font] Fix glyph bitmap alignment from SDF fonts #2380

Merged
merged 1 commit into from
Jul 13, 2024

Conversation

Basewq
Copy link
Contributor

@Basewq Basewq commented Jul 9, 2024

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

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

…bitmaps in debug build into its own folder in the temp directory instead of straight into the temp directory
@Eideren Eideren merged commit bc6965c into stride3d:master Jul 13, 2024
3 checks passed
@Eideren
Copy link
Collaborator

Eideren commented Jul 13, 2024

Thanks !

@Basewq Basewq deleted the sdf_font_fix branch July 16, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants