GetFontInfo
Retrieve information about an editor font id.
boolean GetFontInfo( FontId)
boolean GetFontInfo2( FontId)
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 |
The following information can be retrieved by using the TerGetOutInt and TerGetOutStr methods upon a successful return from this method.
String typeface; | This variable receives the typeface for the specified font id. The typeface String can be up to 32 characters. Retrieve as following: if (GetFontInfo(FontId)) {
typeface = TerGetOutStr("typeface");} |
int PointSize; | This integer variable receives the point size for the specified font id. This argument is used by the GetFontInfo function only. Retrieve as following: if (GetFontInfo(FontId)) {
PointSize = TerGetOutInt("PointSize");} |
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. Retrieve as following: if (GetFontInfo2(FontId)) {
TwipsSize = TerGetOutInt("TwipsSize");} |
| int style: | This integer variable receives the styles flags for the specified font id. Retrieve as following: if (GetFontInfo(FontId)) {
style = TerGetOutInt("style");} The style flag consists of the following bits: |
| BOLD: | Bold |
| ULINE: | Underline |
| ULINED: | Double Underline |
| ITALIC: | Italic |
| STRIKE: | Strikethrough |
| DOUBLE_STRIKE | Double line strike |
| SUPSCR: | Superscript |
| SUBSCR: | Subscript |
| HIDDEN: | Hidden Text |
| PROTECT: | Protected Text |
| CAPS | All caps |
| SCAPS | Small Caps |
Description: Use this function to retrieve information about an editor font id.
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.