unicode and drawtext

Edward Abraham wrote:

hiya ...
I would like to draw unicode characters onto a wxDC, but the simple solution

dc.DrawText(u'\u0161', 100, 100)

produces a black bar rather than an s with a little hat on it. This character shows up nicely in the Lithuanian expression for "I like chocolate" in the wxPython unicode demo, where it is displayed in a panel using the AddText method. Should dc.DrawText handle unicode?

Yes.

Is it a matter of setting a correct font encoding or family?

Probably. Or a font that has glyphs for the required unicode characters. See http://www.slovo.info/unifonts.htm for a few of them.

I am a newbie to all this encoding-stuff (clearly!)

Me too, other than the trial and error learning that I've done. :frowning:

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks for the pointers to the unicode pages.

The problem was that the default dc font is bold, and the default frame font has normal weight. The font used ('MS Shell Dlg') only has unicode characters in normal weight...

Cheers,

Ed

Robin Dunn wrote:

···

Robin Dunn wrote:

Probably. Or a font that has glyphs for the required unicode characters. See http://www.slovo.info/unifonts.htm for a few of them.

Here is another site I've found useful in the past:

Large, multi-script Unicode fonts for Windows computers