From: <ma...@us...> - 2003-11-30 23:20:02
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv28415 Modified Files: Images.cpp Log Message: Font fix for wxMac Index: Images.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- Images.cpp 30 Nov 2003 23:07:27 -0000 1.31 +++ Images.cpp 30 Nov 2003 23:19:59 -0000 1.32 @@ -308,8 +308,18 @@ tmp = wxBitmap(100, 100); mdc.SelectObject(tmp); + /** + * Set font to what it will be in final bitmaps and measre the lengths + * of all button labels to find out the final width of the image. + * wxMac seems to have problems with wxDECORATIVE and/or wxBOLD + * fonts, we fall back to wxDEFAULT/wxNORMAL. + */ mdc.SetTextForeground(wxColour(10, 10, 10)); - mdc.SetFont(wxFont(10, wxDECORATIVE, wxNORMAL, wxBOLD)); + #ifdef __WXMAC__ + mdc.SetFont(wxFont(10, wxDEFAULT, wxNORMAL, wxNORMAL)); + #else + mdc.SetFont(wxFont(10, wxDECORATIVE, wxNORMAL, wxBOLD)); + #endif for (unsigned int i=0;i<btntxt.GetCount();i++) { mdc.GetTextExtent(btntxt.Item(i), &x, &y); if (x > width) { |