TE Edit Control .NET Core / .NET Framework Help
Product page

GetFontInfo

Retrieve information about an editor font id.

bool GetFontInfo( FontId, out typeface, out PointSize, out styles)
bool GetFontInfo2( FontId, out typeface, out TwipsSize, out styles)
int FontId;

The editor font id to retrieve. A valid font id would a value between 0 and TotalFonts - 1.

You can also use this function to get the font information for a stylesheet item by specifying the style id as a negative value for this parameter. Also, use the following constant to specify normal or the current style item.

SID_NORMAL:Normal style item
SID_CUR:Style item being current edited
string typeface;This variable receives the typeface for the specified font id. The typeface string can be up to 32 characters.
int PointSize;This integer variable receives the point size for the specified font id. This argument is used by the GetFontInfo function only.
int TwipsSize;This integer variable receives the size of the specified font in the twips unit. This is useful when a font uses fractional point size (1 point equal 20 twips). This argument is used by the GetFontInfo2 function only.
int styles:This integer variable receives the styles flags for the specified font id. The style flag consists of the following bits:
BOLD:Bold
ULINE:Underline
ULINED:Double Underline
ITALIC:Italic
STRIKE:Strikethrough
DOUBLE_STRIKEDouble line strike
SUPSCR:Superscript
SUBSCR:Subscript
HIDDEN:Hidden Text
PROTECT:Protected Text
CAPSAll caps
SCAPSSmall Caps

Description: Use this function to retrieve information about an editor font id.

The script environment such as Java script do not support a pass-by-reference parameter. In such environment you would first call the GetFontInfo method. Then call the TerGetRefParamStr and TerGetRefParam to retrieve the string and numeric values of the parameters returned by the previous call to the GetFontInfo method.

Return Value: This function returns true if successful. The function returns false if an error is encountered or when the FontId specifies an invalid font id.