wxFonts

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
wxNewbi
Knows some wx things
Knows some wx things
Posts: 26
Joined: Mon Nov 15, 2004 11:27 pm
Location: London UK
Contact:

wxFonts

Post by wxNewbi »

Hello I was wondering how you convert a font point size to pixels.
thanks
Keep it real, Keep it free, Keep it GPL
eco
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 203
Joined: Tue Aug 31, 2004 7:06 pm
Location: Behind a can of Mountain Dew
Contact:

Post by eco »

A point is 1 / 72.27 of an inch so you could get the physical dimensions of the screen and the resolution and figure it out...or you could just call wxDC::GetTextExtent() ;).
User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Post by ABX »

eco wrote:A point is 1 / 72.27 of an inch ...
In case anyone would want to use it, wxWidgets should enable it through constants, see METRIC_CONVERSION_CONSTANT, mm2inches, inches2mm, mm2twips, twips2mm, mm2pt and pt2mm.

ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2
Post Reply