String length in twips

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Is there a function that will calculate the twip length
of a string, given its font, weight and point size?
Like the length of the current string in a text box
control.
Thanks,
Bill
 
I did find what appears to be the functionality I'm
looking for at "Lebans".... "TextHeightWidth". If
there's something else, though I don't know what
it would be given Steven's usual supreme efforts,
please let me know.
Thanks,
Bill
 
Bill said:
Is there a function that will calculate the twip length
of a string, given its font, weight and point size?
Like the length of the current string in a text box
control.


AFAIK, there are only two possible ways to do that.

If you are certain that the text will always display on one
line in the text box, then the report TextWidth method can
be used. You must first set the report's FontName,
FontSize, FontBold, etc. properties.

Stephen's TextHeightWidth function is way more flexible and
easier to use.
 
Back
Top