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 glyph range size #196

Merged
merged 4 commits into from
Aug 28, 2023
Merged

Fix glyph range size #196

merged 4 commits into from
Aug 28, 2023

Conversation

kusaanko
Copy link
Contributor

@kusaanko kusaanko commented Aug 27, 2023

Description

ImFontAtlas#getGlyphRanges*** returns invalid length of short array. This causes an problem that by using this method we can't render Japanese, Chinese and so on. This bug comes from the bug of RETURN_GLYPH_2_SHORT. The size comes from sizeof(glyphs), but glyphs is ImWchar*, which is pointer, so it returns the size of pointer not array length.

Fixes #131
Fixes #70

Type of change

  • Minor changes or tweaks (quality of life stuff)
  • 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 not work as expected)
  • This change requires a documentation update

@SpaiR SpaiR added api Connected with imgui-java API fix Fixes problems labels Aug 28, 2023
@SpaiR
Copy link
Owner

SpaiR commented Aug 28, 2023

Thanks for the contribution! I'll make the release with it in the near future.

@SpaiR SpaiR merged commit 64416f1 into SpaiR:main Aug 28, 2023
9 checks passed
@kusaanko kusaanko deleted the fix-glyph-range-size branch August 29, 2023 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Connected with imgui-java API fix Fixes problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Japanese characters won't render correctly Results of getGlyphRangesChinese*() are cut-off
2 participants