FontFromFontDescriptor method (WinStudio scripts)
Applies To
IWSApplication interface
Definition
Takes a font descriptor string as input and returns the value as a Font data type.
A "font descriptor" is a string consisting of a list of fourteen comma-separated values.
Syntax
Application.FontFromFontDescriptor( string )
Part | Description |
string | Required.
Consists of fourteen comma-separated values:
Size,0,0,0,Weight,Italic,Underline,Strikethrough,0,0,0,0,0,FontFamily For more information about these values, see "Settings" below. |
Settings
Setting | Description |
Size | A decimal value representing the point size. |
Weight | Range from 0 (non-bold) to 700 (bold). |
Italic | 0 = Normal text.
1 = Italicized text. |
Underline | 0 = Text not
underlined.
1 = Text underlined. |
Strikethrough | 0 = Normal text.
1 = Text struck through. |
FontFamily | Name of the font (family) to be used. |
Remarks
The return value is a Font data type matching the font descriptor string.
This method must be used in conjunction with another method that requires a Font data type as input. It allows you to construct the Font data type from a font descriptor string.
When using this method, you must include the following comment above the Imports section in any global or form script:
'//<Ref>System.Drawing.dll</Ref>
Example
Dim FontDesc As String Dim newFont As Font FontDesc = Application.GetBaseFontDescriptor() newFont = Application.FontFromFontDescriptor( FontDesc ) If not IDONull.IsNull(newFont) Then newFont = new Font( newFont, FontStyle.Bold ) FontDesc = Application.FontDescriptorFromFont( newFont ) End If ThisForm.Components("FormCollectionGrid").SetGridRowColFont( 3, 2, FontDesc, True )