[wxPython-users] [ANN] PlateButton Control for wxPython

Kevin Ollivier kevino at theolliviers.com
Tue Dec 18 14:32:01 PST 2007


Hi Cody,

On Dec 14, 2007, at 9:28 AM, Cody Precord wrote:

> Hello,
>
> On Dec 13, 2007, at 9:26 AM, Jorgen Bodde wrote:
>
>> Nice work cody!
>>
>> It really looks useful to me .. one thing I noticed is that some of
>> the text in the buttons is truncated a bit too early, for example the
>> second "Normal w/Bitmap" is missing part of the p at the end.
>>
>> Anyway, good work!
>> - Jorgen
>>
>
> The only way that I could see the text being able to get truncated  
> is if wx is returning the wrong values for the font metrics, as the  
> size of the button is based off of size of the bitmap+text width 
> +padding on both ends and inbetween. I tried with a few different  
> fonts on my machine and couldn't reproduce this problem. I have  
> noticed a problem in the past with the text extents returning an  
> incorrect width for double width characters such as Japanese/Chinese/ 
> ect.. Anyone else have experience with font measuring issues like  
> this?

BTW, I'm not really sure this is related, but we actually have been  
investigating font measurement for wxWebKit recently, and I noticed  
that on GTK w/wxDC, GetTextExtent returns the actual string size, not  
the "bounding box" needed to render the string. This is not the case  
with Mac and Win (w/wxDC or wxGraphicsContext), which do include the  
"bounding box".

Regards,

Kevin

>
> Do you know what font is being used, or add 'print  
> tbtn.GetFont().GetFaceName()' to the demo script after the button is  
> made and see what it says.
>
> What platform are you running under (mac/gtk/msw)?
>
>
> Thanks,
>
> Cody Precord
> http://editra.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>




More information about the wxpython-users mailing list