I found the measure text function provided in the example for the raylib renderer in the odin bindings to give wrong results. Here's how it looks like:

Luckily, raylib has its own function to measure text, and it works perfectly.
This is the revised function:
measureText :: proc "c" (text: StringSlice, config: ^TextElementConfig, userData: rawptr) -> Dimensions {
context = runtime.default_context()
cloned := strings.clone_to_cstring(string(text.chars[:text.length]), context.temp_allocator)
result := raylib.MeasureTextEx(
raylibFonts[config.fontId].font,
cloned,
f32(config.fontSize),
f32(config.letterSpacing))
return {
width = result.x,
height = result.y
}
}
And this is the result:

I found the measure text function provided in the example for the raylib renderer in the odin bindings to give wrong results. Here's how it looks like:
Luckily, raylib has its own function to measure text, and it works perfectly.
This is the revised function:
And this is the result: