Skip to content

Fix font out of bounds exception for non ascii chars#24

Merged
modawan merged 1 commit intomasterfrom
font-fix
Aug 26, 2025
Merged

Fix font out of bounds exception for non ascii chars#24
modawan merged 1 commit intomasterfrom
font-fix

Conversation

@modawan
Copy link
Copy Markdown
Owner

@modawan modawan commented Aug 25, 2025

Glyphs library has 256 glyphs in total. Lower 128 glyphs are ASCII, higher values are for non-ASCII characters. Char type is 8-bit signed, so we need to bitcast it to unsigned to avoid negative indices.

The problem was reported and fixed in seedhartha#61.

Gliphs library has 256 glyphs in total. Lower 128 glyphs are ASCII,
higher values are for non-ASCII characters. Char type is 8-bit signed,
so we need to bitcast it to unsigned to avoid negative indices.

The problem was reported and fixed in
seedhartha#61.
@modawan modawan added this to the Endar Spire milestone Aug 25, 2025
@modawan
Copy link
Copy Markdown
Owner Author

modawan commented Aug 25, 2025

Hats off to @Lyuu17 for finding the problem and preparing the patch.
I've verified that it works well and fixes the issue with a Russian version of the game. Changed the patch slightly to keep using a foreach loop, and made types explicit.

@modawan
Copy link
Copy Markdown
Owner Author

modawan commented Aug 25, 2025

The issue with vertical lines is tracked separately in #25. It is present in English version of the game too.

@modawan modawan merged commit 924cbaa into master Aug 26, 2025
2 checks passed
@modawan modawan deleted the font-fix branch August 26, 2025 07:09
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.

1 participant