Print Page | Close Window

Beware of font sizes!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=9751
Printed Date: 14 November 2025 at 2:41pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Beware of font sizes!
Posted By: znakeeye
Subject: Beware of font sizes!
Date Posted: 01 March 2008 at 6:57am
XTPDockingPanePaintManager.cpp (416):
 
pLogFont->lfHeight = pLogFont->lfHeight < 0 ? __min(-11, pLogFont->lfHeight) : pLogFont->lfHeight;
 
I believe -11 is dependent on logical units etc. A more safe method is:
int height = -
MulDiv(lf.lfHeight, GetDeviceCaps(hDC, LOGPIXELSY), 72);
 
I'm not 100% sure this is needed, but just to make sure...
The logic above is probably present in other files too.



Replies:
Posted By: Oleg
Date Posted: 01 March 2008 at 7:39am
Its dessigned to be dependent on logical units and etc :)

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: znakeeye
Date Posted: 01 March 2008 at 8:32am
Then why -11?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net