PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Special cases
  • Calculating the width of a text written with fonts of different sizes
  • Calculating the width of a text containing CR characters
  • Various
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Calculates the width (in millimeters) of the text to print, according to the specified font.
Versions 18 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 18
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Versions 19 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for Android applications.
New in version 19
Android Widget This function is now available in Android Widget mode.
Android This function is now available for Android applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for Android applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Example
x is int = iTextWidth(iFont(5) + CU.CUSTNAME)
iPrintWord("The width of customer name is equal to: ")
iPrint(x)
iEndPrinting()
Syntax
<Result> = iTextWidth([<Font identifier> + ] <Text to print>)
<Result>: Real
  • Width (in millimeters) of specified text if the print was performed,
  • -1 if the print was canceled before running the function.
<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 (with quotes)
Character string whose width is requested.
Remarks
WINDEVReports and QueriesAndroidAndroid Widget Windows MobileJavaUser code (UMC)

Special cases

Depending on the destination (printer, file, ...), the width returned by iTextWidth may differ (by a tenth of a millimeter) for the same text, displayed in the same font. This difference is caused by the display mechanism used by Windows.

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

You must call iTextWidth for each text that is using 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.

Various

A call to iParameter after iTextWidth will have no action because the print is initialized.
Component : wd240prn.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment