From: Robert M. <rob...@us...> - 2008-07-18 14:11:27
|
2008/7/18 Roode, Eric <er...@ba...>: > > On 17 July 2008, Sean Healy wrote: >> >> ($x, $y) = $Label->GetTextExtentPoint32($string); > > Upon further experimentation, there is something not quite right with > that. The width it returns is too wide. There seems to be some sort > of per-character skew -- short strings are very accurate; longer > strings get progressively worse. The Win32::GUI GetTextExtentPoint32(...) implementation uses the default system font sizing if you don't tell it what font to use. I think this is not as expected (or intended). Try this instead as a work around: my ($x, $y) = $Label->GetTextExtentPoint32( $string, $Label->GetFont() ); It would be much appreciated if you could raise a bug report for this, as if called as a method against a window without a font specified then I think the implementation should use the window's current font. Regards, Rob. |