GetFontInfo
Retrieve information about an editor font id.
BOOL GetFontInfo(hWnd, FontId, typeface, PointSize, styles)
BOOL GetFontInfo2(hWnd, FontId, typeface, TwipsSize, styles)
HWND hWnd; | Handle of the window to be accessed |
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 |
LPBYTE typeface; | This character pointer receives the typeface for the specified font id. The typeface string can be up to 32 characters. |
LPINT PointSize; | This integer pointer receives the point size for the specified font id. This argument is used by the GetFontInfo function only. |
LPINT TwipsSize; | This integer pointer 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. |
LPUINT styles: | This integer pointer 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_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.
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.