ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Print functions
  • Calculating the height of a text written with fonts of different sizes
  • Calculating the height of a text containing CR characters
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Calculates the height of the font for the text to print (in millimeters).
Example
x is int = iTextHeight(iFont(2) + CU.CUSTNAME)
iPrintWord("The height of customer name is equal to: ")
iPrint(x)
iEndPrinting()
Syntax
<Result> = iTextHeight([<Font identifier> + ] <Text to print>)
<Result>: Real
  • Height of specified text (in millimeters) if the print is performed,
  • -1 if the print job was canceled before the function was executed.
<Font identifier>: Optional character string
Identifier of the font used, returned by iFont. If this parameter is not specified, the last font used will be selected.
<Text to print>: Character string
Character string whose height is requested.
Caution: a height is returned even if the text to print corresponds to an empty string.
Remarks

Calculating the height of a text written with fonts of different sizes

You must call iTextHeight for each text that uses a different font.

Calculating the height of a text containing CR characters

iTextHeight ignores the CR characters found in the text. You must count the number of CR characters in order to add as many times the text height to get the total height.
Component: wd290prn.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help