Guigui220D / zig-sfml-wrapper

A zig wrapper for csfml
Other
49 stars 8 forks source link

non ascii characters are not diplayed correctly #54

Closed IbrahimOuhamou closed 2 months ago

IbrahimOuhamou commented 2 months ago

when I try to render ب or é I get squares instead of what I wanted

do you know if it is a csfml problem or a zig problem? can you please fix it if you know how?

thanks in advance, also thank you for making this wrapper

Guigui220D commented 2 months ago

Hello, thanks for making an issue, Indeed I think I havent implemented unicode yet! So only ascii works as of now.... I will try to do it in the following days, i dont know what capabilites SFML has in that regard but it does have unicode functions so it should be possible.

IbrahimOuhamou commented 2 months ago

thanks a lot, may God guide you and protect you

Guigui220D commented 2 months ago

image

You're able to use sf.toUnicodeAlloc and sf.toUnicodeComptime to get unicode from UTF-8 (SFML doesn't work directly with UTF-8 sadly...), and text.setStringUnicode and window.setTitleUnicode to use this unicode.

Don't forget to use a font that supports all the glyphs you need!

Tell me if you need anything else :)

IbrahimOuhamou commented 2 months ago

thanks a lot man