PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Characteristics of a font
  • Font management properties
  • Functions that use Font variables
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
A Font variable is used to create a font through programming. The characteristics of this font can be defined and changed using different WLanguage properties.
A Font variable can be used:
  • in the drawings,
  • in the charts,
  • for the prints,
  • in the controls of a window (Font property),
  • in the controls of a page (Font property for the page controls),
  • in the controls of a report (Font property).
Remarks:
  • For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
  • WINDEV To modify the characteristics of a cell found in a Spreadsheet control, use SpreadsheetStyleSelection.
Example
// Declare the Font variables
MyFont is Font
MyFont1, MyFont2 are Fonts
// Variable initialized with the font created by FontCreate
MyFont = FontCreate("Arial", 12, iBold)
// Modify the characteristics of the font
MyFont.Name = "Arial"
MyFont.Size = 12
MyFont.Bold = True
// Use a font on a window control
EDT_LastName.Font = MyFont
 
// Retrieve the font of a control
MyFont1 = EDT_FirstName.Font
Remarks

Characteristics of a font

By default, a Font variable has the following characteristics:
  • "Arial",
  • size 12,
  • black,
  • no attribute.
To define the characteristics of a font through programming, use:
  • The FontCreate function.
  • The properties for font management (see below)
  • FontSelect, which opens the standard Windows font selection dialog.

Font management properties

The following properties can be used to handle a Font variable:
Property nameEffect
BoldChecks whether a Font variable is bold and changes the bold attribute of a Font variable.
New in version 27
CharacterSpacing
Gets and sets the spacing between characters of a Font variable.
CharsetReturns and changes the character set used by a Font variable.
ColorChecks and changes the color of a Font variable.
ItalicChecks whether a Font variable is italicized and changes the italic attribute of a Font variable.
New in version 27
Line spacing
Gets and sets the line spacing for a Font variable.
NameReturns and changes the name of a Font variable.
OrientationReturns and changes the angle (in degrees) of a Font variable.
SizeReturns and changes the size (in picas) of a Font variable.
New in version 27
SizeUnit
Gets and sets the size unit used for a Font variable.
StrikeOutChecks whether a Font variable is struck through and strikes through a Font variable.
UnderlineChecks whether a Font variable is underlined and underlines a Font variable.
These properties can be directly used on the Font variable. Example:
MyFont is Font
MyFont.Bold = True
MyFont.Color = LightRed
Universal Windows 10 App Only the following properties can be used with the Font type: Orientation, StrikeOut, Color, Bold, Italic, Name, Underline, Size.

Functions that use Font variables

The following functions can be used to handle a Font variable:
dFontDeclares the font that will be used by dText:
  • in an Image control,
  • in an Image variable,
  • in a WDPic variable (on the background layer),
  • in a picLayer variable.
grLabelFontModifies the font used for the category labels of a chart.
grLegendFontModifies the font used for the chart legend.
grTitleFontModifies the font used for the chart title.
iFontSelects the default font.
FontCreateCreates a font definition.
FontSelectOpens the standard window for font selection and selects the specified font.
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment