Question

I am working with allegro 4.4 library.

When I print a Korean character, the character is broken.

English character isn't in Allegro Manual.

Allegro says "Allegro uses UTF8 encoding by default."

I have no idea of what was wrong with the following code, and what to fix.

textout_ex(screen,font,"한글(korean)", 24, 2,
             makecol(255, 255, 255), -1);

Any idea of how to print Korean characters properly?

Thanks in advance.

Was it helpful?

Solution

It sounds like you did not load a font that has Korean glyphs. Alternatively, the Allegro loading functions simply didn't load the Korean glyphs from the font file. So first check the font to see if it has the glyphs you need, then check Allegro's documentation to see how to make it load them.

Note: just because a library says that it supports strings of UTF-8 or 16 encoding does not mean that they actually support all of those glyphs. And it certainly doesn't mean that they support complex text layout. I don't know if Korean requires complex text layout, but Allegro certainly doesn't support it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top