Hi list,
I have some problems with the font drawing subsystem.
first I couldn’t draw text using wx.GCDC.DrawText because it wouldn’t render the custom fonts that I was using…
I load the fonts like this:
from ctypes import *
import os
import os.path
gdi32= WinDLL(“gdi32.dll”)
fonts = [font for font in os.listdir(“fonts”) if font.endswith(“otf”) or font.endswith(“ttf”) ]
for font in fonts:
gdi32.AddFontResourceA(os.path.join(fontdir,font))
The font is “Fontin”
http://www.josbuivenga.demon.nl/fontin.html
so instead of using the wx.GCDC.DrawText I used the the MemoryDC.DrawText which rendered the font ok. (the mdc is the one used to create the gcdc)
All seamed to work good enough until I stumbled upon a crazy bug:
The font rendering shows an offset about the size of the frame’s title-bar, the font being drawn higher than it should have been.
When I show the first time the Frame everything is Ok… but upon some clicking… all the font rendering in the frame moves up and stays up.
Every other drawing (bitmaps, paths) remains where it should be.
And now for the fun part… I only see this bug on a Windows MCE laptop.
My main development machine, another laptop (XP SP2) and a Parallels virtual machine ALL show the rendered image right.
I’m completely in the dark here…
ANY idea is welcomed!
Thank you.
Peter.
···
–
There is NO FATE, we are the creators.