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

Fix incorrect glyph index in nk_font_bake #531

Merged
merged 1 commit into from
Aug 2, 2023
Merged

Fix incorrect glyph index in nk_font_bake #531

merged 1 commit into from
Aug 2, 2023

Conversation

dulingzhi
Copy link
Contributor

In stbtt_PackFontRangesGatherRects, it skips packing when glyphs are missing. Resulting in incorrect glyphs when nk_font_bake reading these ranges rects data. Referring to the way IMGUI handles it, we skip the rect data check.

ref #399

load font:
image

before:
image

after:
image

@dumblob
Copy link
Member

dumblob commented Dec 22, 2022

Thanks for looking into this. Did you test this with various example apps (and ideally also backends/demos)?

Also, could you please also update the source files and version?

@dulingzhi
Copy link
Contributor Author

source files and version updated.
I tried the opengl backends and it works fine. And I'm still trying to compile the example program on windows.

@dulingzhi
Copy link
Contributor Author

截屏2022-12-24 02 20 13

截屏2022-12-24 02 19 43

截屏2022-12-24 02 19 21

截屏2022-12-24 02 18 33

Works fine in all examples

@FrostKiwi
Copy link
Contributor

OMG Yes. Thx so much for finding the cause!
This has been plaguing me from time to time and I resorted to excluding the affected glyphs. Great to have a proper fix for this.

@dumblob dumblob requested a review from RobLoach March 9, 2023 19:50
@dumblob
Copy link
Member

dumblob commented Mar 9, 2023

I think we could land this. Anyone any objections?

Copy link
Contributor

@RobLoach RobLoach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@dulingzhi
Copy link
Contributor Author

dulingzhi commented Aug 2, 2023

🚀

Is it possible to merge this PR? @RobLoach

@RobLoach RobLoach merged commit 017f27b into Immediate-Mode-UI:master Aug 2, 2023
@dulingzhi dulingzhi deleted the fix/incorrect-font-bake branch August 2, 2023 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants