How do I properly display Korean text with TextOut?

362 Views Asked by At

I am compiling with the UNICODE directive, so all CStrings are in Unicode. If I place "봉재" into a CString, select a font with "Arial", then use TextOut or TextOutW to display this text, two boxes are displayed.

If I add Latin characters to the text, e.g. "봉재 ABC", then the display becomes two boxes followed by " ABC".

However if I add certain other CJKV characters to the text, e.g. "봉재 /元", the then display shows the text of my CString.

I am guessing that TextOut examines the text, and if certain characters are found, it substitutes fonts for the best display. If my theory is correct, then by adding certain oriental characters to a string, I can force TextOut to substitute a Unicode font, but if I add other oriental characters, TextOut does not substitute the correct font, and the display is inadequate.

How can I get TextOut to always substitute the correct font, or to otherwise display text consistently?

1

There are 1 best solutions below

0
On

Note that "Arial" doesn't support CJKV at all, it's just a Latin font. If you want wider Unicode support while maintaining the look of the Arial typeface, use "Arial Unicode". Otherwise, use another font for which you first check that it contains all the glyphs you need rendered.