Board index » delphi » Printing and fonts in TPW

Printing and fonts in TPW

Hi,
   I'm trying to print in TPW, and am having problems with selecting the
font sizes. I tried setting the mapping mode so that logical units are
points (1/72 inches) and selecting fonts the usual way. However, I get
fonts which are much too big. How does one select e.g. 12 pt fonts that
really print out as 12 pt fonts? What logical units should be used?

Thanks,
     Eyal Doron

 

Re:Printing and fonts in TPW


In article <4kdqc4$...@sun0.urz.uni-heidelberg.de>,
do...@goofy.mpi-hd.mpg.de (Eyal Doron) says:

Quote
>Hi,

Hi Eyal.

Quote
>   I'm trying to print in TPW, and am having problems with selecting the
>font sizes. I tried setting the mapping mode so that logical units are
>points (1/72 inches) and selecting fonts the usual way. However, I get
>fonts which are much too big. How does one select e.g. 12 pt fonts that
>really print out as 12 pt fonts? What logical units should be used?

You need to create a new font and select this in your printer DC.
The height of this font is the critical issue, and is calculated
this way:

FontHeight := MulDiv(PointSize, GetDeviceCaps(PrinterDC, LOGPIXELSY), 72)

This formula is based on the fact that a font with a pointsize of
72 is exactly 1 inch high.

Bye,
Zweitze.

-----------------------------------------------------------------------
  Zweitze de Vries                           zwei...@cyco.nl
  Cyco Software Development
  Handelskade 49
  Rijswijk, Netherlands                      (+31) 70 3954179

Other Threads