Walnut icon indicating copy to clipboard operation
Walnut copied to clipboard

Danish Characters are not supported

Open KnutssonDevelopment opened this issue 1 year ago • 3 comments

If I put any danish characters in the title or in text somewhere is does not work. I will show either "?" or some weird characters.

Characters testes are: "æøå"

KnutssonDevelopment avatar Feb 17 '23 22:02 KnutssonDevelopment

That's just a C++ thing. You have to input stings and specify UTF-8.

"æøå"

will not work, but

u8"æøå"

will.

DownLoude avatar Mar 31 '23 14:03 DownLoude

@DownLoude no you don't, std::string supports UTF-8 in C++, so you can just write std::string str = "æøå"; In the case of ImGui, it also supports UTF-8 with just a normal const char* so it will attempt to render the correct glyphs.

@KnutssonDevelopment the reason why those characters are show up as ? is because the glyphs aren't loaded from the font, or the font doesn't have those glyphs and thus they also weren't loaded.

I haven't thought about how to handle this yet in Walnut; as in, how should we specify which glyphs/character sets/languages we want to load from the font, but I'm open to suggestions.

TheCherno avatar Jul 16 '23 10:07 TheCherno

@TheCherno

or the font doesn't have those glyphs

It does - I installed the Roboto font from Walnut as system font, also in font preview it does seem to have these glyps. Could they be dynamically loaded depending on characters in provided string? If not I would leave it as a setting up to the developer. Symfony is PHP framework but they have nice ecosystem where by default you generate very minimal app and everything else is up to the developer - modules you want to be included. I think it's a nice solution. In fact Walnut .lua scripts remind mea bit of https://github.com/symfony/recipes

Zydnar avatar Dec 30 '23 11:12 Zydnar