ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Print functions
  • Combining fonts
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
Selects the default font. This font will be used by iPrint, iPrintWord, iTextWidth, iTextHeight, etc.
Remarks:
  • This font must have been created by iCreateFont.
  • This font is active as long as iFont is not used again.
  • Linux Only TrueType fonts are managed.
Linux Caution: A specific configuration is required to use this function in Linux. For more details, see Print in Linux.
Example
iPrintWord(iFont(2) + CU.LastName + iXPos(200) + CU.Firstname)
iSkipLine
iPrint(iFont(1) + iXPos(100) + CU.Company)
iEndPrinting
Syntax

Using a dynamic font Hide the details

<Result> = iFont(<Font name> [, <Immediate calculation>])
<Result>: Character string
Control string describing the use of the specified font.
<Font name>: Font
Name of default font to use. This parameter corresponds to a Font variable. The font characteristics have been defined with FontCreate or via the font properties.
Linux Only TrueType fonts are managed.
<Immediate calculation>: Optional boolean
Specifies whether the fonts must be selected immediately (True by default) or only when printing (False, if fonts must be combined, for example). For more details, see remarks.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadJavaUser code (UMC)Ajax

Using a font created by iCreateFont (5.5-compatible syntax) Hide the details

<Result> = iFont(<Font number> [, <Immediate calculation>])
<Result>: Character string
Control string describing the use of the specified font.
<Font number>: Integer
Identifier of font used by default. This identifier was specified when the font was created by iCreateFont.
Linux Only TrueType fonts are managed.
<Immediate calculation>: Optional boolean
Specifies whether the fonts must be selected immediately (True by default) or only when printing (False, if fonts must be combined, for example). For more details, see remarks.
Remarks
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadJavaUser code (UMC)Ajax

Combining fonts

Unexpected results may occur when combining fonts. For example, the following code:
iFont(2)
iPrint("First Part" + iFont(1) + "Second Part")
is not equivalent to:
iPrint(iFont(2) + "First Part" + iFont(1) + "Second Part")
In the first case, the entire character string will be printed in font 1. Indeed, in this case, iFont(1) is run when building the string to print and therefore before the "First part" string is printed.
To get an identical result, all you have to do is use iFont with the False parameter (in the first syntax): iFont(2, False) will be actually run during the print.
Component: wd300prn.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/06/2023

Send a report | Local help