Skip to content

Conversation

@rats159
Copy link
Contributor

@rats159 rats159 commented Oct 18, 2025

This PR changes the example Odin text measurement function to

  1. have proper UTF-8 support using odin's rune type and iterating the string by codepoint, rather than by byte
  2. support clay's letter spacing configuration
    The implementation was heavily inspired by raylib's own MeasureTextEx function

@nicbarker
Copy link
Owner

Hello, thanks for opening this! 🙂
For context, the reason I implemented the original measuretext function by hand is that the GetGlyphIndex function does a linear scan through a potentially large array which can be very slow, especially if you're only dealing with english. Could we split this UTF-8 supporting measuretext into a seperate function, and still default to the ASCII one?

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.

2 participants