Calculates the width (in millimeters) of the text to print, according to the specified font.
x is int = iTextWidth(iFont(5) + CU.CUSTNAME)
iPrintWord("The width of customer name is equal to: ")
<Result> = iTextWidth([<Font identifier> + ] <Text to print>)
- Width (in millimeters) of the specified text if the print job was 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 width is requested.
Calculating the width of a text written with fonts of different sizes
You must call iTextWidth for each text that uses a different font.
Calculating the width of a text containing CR characters
iTextWidth ignores the CR characters found in the text. You must call iTextWidth for each line found in the string.
A call to iParameter
will have no action because the print job is initialized.