Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Setting Font.Height to match TppLabel.Height

edited July 2004 in General
Hi,

How can I set a TppLabel's Font.Height at runtime in inches?

(I want to set the font height so that is is the same height as it's label,
which
is calculated at runtime... But TFont.Height is in pixels, and
TppLabel.Height
is in inches.)

thanks,
Bill.

Comments

  • edited July 2004
    Thanks anyway but I figured it out:

    Font.Height := Trunc(Font.PixelsPerInch * NewHeightInInches);

    Bill.



  • edited July 2004
    Hi Bill,

    I believe you can use the TFont.PixelsPerInch to find your screen setting,
    then using this number (most likely 96 ppi) to convert the TppLabel.Height
    to Screen Pixels.

    liPixelsPerInch := TFont.PixelsPerInch;

    lFont.Height := Trunc(ppLabel1.Height * liPixelsPerInch);

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.