Colin R Dillicar asked us:


> I'm having trouble setting my printer font from a font dialog component.
> I've selected Arial 12 point regular and device type as printer from the
> object inspector as the default font and device. The printer prints in a
> very tiny font so that a page of text appears within about a 80 * 50  cm
> rectangle in the top left hand corner of the page.

When you are dealing with fonts on devices other than the screen you must
do some careful calculations to take into account the resolution of the
device you are working with.

Have a look at the Windows API documentation for CreateFont and
specifically the parameter nHeight. Depending on what you pass this value
can either be mapped into device units for you, or you can do your own
mapping into device units taking into account the vertical DPI of the
target device.

If you have access to the third party reporting tools have a look at how
they handle the situation. In fact I would recommend getting you hands on
one of the available third part tools and letting them lake care of all of
hassles of mapping into printer device contexts, as getting it all right
your self can be a long winded process.

Cheers, Max.


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to