Home RAP

Textwidth of TppDBText

edited September 2009 in RAP
Hi,

I created a label with report builder and now I have to change the fontsize
depending on the textwidth. The TppDBText object is set to autosized and if
the printed text is larger than the column width, the fontsize should
reduce. But I didn't find a way how I can read the textwidth or width of the
component. I like to solve it with RAP because there could be different
objects and rtmfiles. Does anybody have an idea?

Cheers
Ingo

Comments

  • edited September 2009
    Hi Ingo,

    RAP does not natively contain a TextWidth routine. The easiest way to work
    around this would be to create a pass-thru function that determines the text
    width of a value given a certain font. This could be done using the
    TCanvas.TextWidth routine in Delphi.

    For examples of how to create a RAP Pass-thru function, see the RAP demos
    located in the \Demos\0. RAP\... directory.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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