|
From: Wenzheng L. <wl...@in...> - 2004-08-30 19:16:04
|
Hey all,
Tried call aFont.getWidth(aChar), got error message
"TypeError: an integer is required.",when I used the following piece of to
draw glyph:
my_font = ming.SWFFont('Arial.fdb')
my_s = ming.SWFShape()
my_s.setRightFill(my_s.addFill(255,255,255))
my_s.setLine(2, 0,255,255)
for ch in str('This is a test!'):
my_s.drawGlyph(my_font, ch, 2)
my_s.movePen(my_font.getWidth(chr(ch)), 0)
glyph = self.add(my_s)
del my_s,my_font
glyph.moveTo(100,100)
BTW, if without chr() cast operation on ch, get error:p_unsigned_char
pointer exception.
Does anybody have ideas about what goes wrong?
Thanx
|