Font isssue from wxwindows to wxmac Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
joeman
Knows some wx things
Knows some wx things
Posts: 27
Joined: Sun Jul 31, 2005 5:11 pm
Location: France

Font isssue from wxwindows to wxmac

Post by joeman » Thu Aug 11, 2005 3:59 pm

Hello all
My GUI is clean on windows, when running the same application on Mac OSX, all texts become unaligned, the fonts on the Mac seems bigger than the fonts on the PC.

How can I declare a font that will be used for ALL controls (including texts, buttons, checkboxes, ...) so I can redefine a smaller font when compiling on Mac ?

something like :

#ifdef __WXMAC__
Myframe->SetFont(....)
#endif

the above doesnt change anything !
thnaks
J

KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock » Thu Aug 11, 2005 4:13 pm

That's an easy problem to fix! In your App classes's OnInit, or before you create any dialogs, insert the following:

Code: Select all

#ifdef __WXMAC__
wxSystemOptions::SetOption(wxWINDOW_DEFAULT_VARIANT, wxWINDOW_VARIANT_SMALL);
#endif
This will reduce the font size in all controls.

You may need to #include something like wx/sysopt.h too.

Hope that helps!

joeman
Knows some wx things
Knows some wx things
Posts: 27
Joined: Sun Jul 31, 2005 5:11 pm
Location: France

Post by joeman » Thu Aug 11, 2005 5:36 pm

yes it works fine !
Thanks
J

KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock » Fri Aug 12, 2005 5:58 am

Great! I'd really appreciate if you could indicate that I solved your issue using the wxAwards system. I think there's a link inside my message header somewhere. Thanks.

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Fri Aug 12, 2005 7:25 am

Took the freedom and marked it for the original poster.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

Post Reply