use wxGetDisplayPPI() instead of redoing it

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-09-22 16:30:17 +00:00
parent 622f7a49ef
commit 90815a4597

View File

@ -17,6 +17,7 @@
#endif
#ifndef WX_PRECOMP
#include "wx/gdicmn.h"
#include "wx/utils.h"
#include "wx/log.h"
#endif
@ -46,14 +47,10 @@ wxFontInstance::wxFontInstance(float ptSize, bool aa,
const wxString& filename)
: wxFontInstanceBase(ptSize, aa)
{
int scrSizePx, scrSizeMM;
wxDisplaySize(NULL, &scrSizePx);
wxDisplaySizeMM(NULL, &scrSizeMM);
double dpi = (scrSizePx / (scrSizeMM * mm2inches));
// NB: DFB's fract_height value is 32bit integer with the last 6 bit
// representing fractional value, hence the multiplication by 64;
// 1pt=1/72inch, hence "/ 72"
int pixSize = int(ptSize * dpi * 64 / 72);
int pixSize = int(ptSize * wxGetDisplayPPI().y * 64 / 72);
DFBFontDescription desc;
desc.flags = (DFBFontDescriptionFlags)(