Previous Document Next Document

Object Model Reference : Classes : C : CorelScriptTools : Methods : CorelScriptTools.GetFont


CorelScriptTools.GetFont

Function GetFont(FaceName As String, PointSize As Long, Weight As Long, Italic As Boolean, Underline As Boolean, StrikeOut As Boolean, Red As Long, Green As Long, Blue As Long) As Boolean

Description

Member of CorelScriptTools

The GetFont method displays a standard Windows Font dialog box and returns the selected font settings.

Parameter
Definition
FaceName
Specifies the string variable that is passed the name of the selected font. You can also use this variable to set an initial value.
PointSize
Specifies the numeric variable that is passed the font size in points. You can also use this variable to set an initial value. This parameter uses non-fractional values
Weight
Specifies the numeric variable that is passed the font’s weight setting (number of inked pixels per 1000 pixels). Common values and their corresponding names include the following:
100 = Thin
200 = Extra Light, Ultra Light
300 = Light
400 = Normal, Regular
500 = Medium
600 = Semi Bold, Demi Bold
700 = Bold
800 = Extra Bold, Ultra Bold
900 = Black, Heavy
Most Windows fonts only use two weight settings: 400 (Normal) and 700 (Bold).
Italic
Specifies the numeric variable that is passed the font’s italic setting:
Set to True (-1), enables italics
Set to False (0), disables italics
Underline
Specifies the numeric variable that is passed the font’s underline setting:
Set to True (-1), enables underlining
Set to False (0), disables underlining
StrikeOut
Specifies the numeric variable that is passed the font’s strike-out setting
Set to True (-1), enables strike out
Set to False (0), disables strike out
Red
Specifies the numeric variable that is passed the Red (RGB color model) setting of the selected font’s color (0 to 255). You can also use this variable to set an initial value.
Green
Specifies the numeric variable that is passed the Green (RGB color model) setting of the selected font’s color (0 to 255). You can also use this variable to set an initial value.
Blue
Specifies the numeric variable that is passed the Blue (RGB color model) setting of the selected font’s color (0 to 255). You can also use this variable to set an initial value.

The GetFont function returns one of the following values:

 
True (-1) = The Cancel button was not clicked
 
False (0) = The Cancel button was clicked
Example

Here is a code example:

GETFONT FN, PS, Wt, Italic, UL, SO, R, G, B

The preceding example displays the following dialog box and returns the font settings the variables specified.

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.