Newsgroups: comp.windows.ms.programmer
Path: funic!news.funet.fi!sunic!psinntp!psinntp!rpi!usc!howland.reston.ans.net!spool.mu.edu!caen!saimiri.primate.wisc.edu!nntp.msstate.edu!willis1.cis.uab.edu!yadav
From: yadav@willis.cis.uab.edu (Vijay Yadav)
Subject: Help on FontSize
Message-ID: <1993Jan11.043718.4814@cis.uab.edu>
Sender: yadav@cis.uab.edu (Vijay Yadav)
Organization: University of Alabama at Birmingham
Date: Mon, 11 Jan 1993 04:37:18 GMT
Lines: 23

From: yadav@willis.cis.uab.edu (Vijay Yadav)
Newsgroups: comp.windows.ms.programmer
Subject: Fonts on the printer
Distribution: world
Organization: University of Alabama at Birmingham

I am trying to learn windows and stuck with the following problem :
 
 I am selecting fonts from choosefont common dialog box function and want
 to display some text in the font chosen. Now the screen displays the right
 typeface and size chosen but when I print it the size of printed characters
 is much smaller. Since I am using the default MM_TEXT mode the logical unit
 is pixel and this is happening due to higher resolution on the printer. I am
 trying to pick up the size of the chosen font from the CHOOSEFONT's ipointsize
 field and multiply it by the number of pixels per logical inch for the printer
 and divide this by 720 and this is assigned to lfHeight field of a LOGFONT 
 structure. The intent is to use this to create another font using CreateFont
 Indirect. But the above expression is truncated to zero for size upto 12 and
 the resulting font can't match the real height.

     I would like whatever help I can get to fix up the above scheme or any 
 other alternative scheme to display the right font size on the printer, 
 preferrably using MM_TEXT since a large chunk of code depends on this mode.
