[python-win32] GDI+ text rendering screwed up
Tim Roberts
timr at probo.com
Fri Mar 20 02:55:35 CET 2009
Greg Ewing wrote:
> I'm trying to use GDI+ (via ctypes) to draw text.
> It works for some fonts but messes up with others.
> Using Times, for example, it seems to be using the
> glyphs for one character earlier in the code sequence,
> so that "Times" comes out as "Shldr" -- except that it
> uses the widths of the original characters for positioning.
>
> Can someone please run the attached code and tell me
> whether it works for them or not? And any ideas on what
> I could be doing wrong to cause this?
Sadly, I see "Times Italic 48" in black-on-yellow.
Do you really have a font called "Times"? The TrueType font is actually
called "Times New Roman". There is a "substitution" list for common
font names, but I'm not sure I'd want to rely on it.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list