Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Font Size Algorithm
Message
From
30/11/2004 18:17:26
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00965827
Message ID:
00965907
Views:
10
This message has been marked as a message which has helped to the initial question of the thread.
>>Hugo,
>>
>>Each fontface is going to behave differently. I don't understand the hangup about not wanting to loop through the possible font sizes calling fontmetric() till you find the best fit. It's not like fontmetric() takes a ton of time to execute.
>
>I know David it is not important, I will probably do an iteration, I just wanted to be sure there is no non-iterative way.

>I know David it is not important, I will probably do an iteration, I just wanted to be sure there is no non-iterative way.

Hugo,

I'm not quite sure there is a non-iterative way EXACTLY, because I didn't do any research on this.
But, if I looked from the formula at MSDN.

get the CellHeight:
CellHeight = (PointSize * VerticalResolution) / 72 + InternalLeading

and to get the PointSize:
PointSize = ((CellHeight - InternalLeading) * 72) / VerticalResolution

The things that missing is InternalLeading. You can't get the exact value until the font is exist and selected into DC. So you can only use a rough value or predefined value.

I believe you can learn it yourself :)
Here is the link:

Windows Font Mapping
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngdi/html/msdn_fontmap.asp

Regards
Herman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform