TerCreateFont
Create a font id.
int TerCreateFont(hWnd, ReuseId, shared, typeface, pointsize, style, color, BkColor, FieldId, AuxId)
int TerCreateFont2(hWnd, ReuseId, shared, typeface, pointsize, style, color, BkColor, FieldId, AuxId, CharStyId, ParaStyId, expand)
int TerCreateFont3(hWnd, ReuseId, shared, typeface, pointsize, style, color, BkColor, FieldId, AuxId, CharStyId, ParaStyId, expand, CharSet)
HWND hWnd; | The handle of the window to be accessed |
int ReuseId; | Existing font id to modify with new information. Use -1 to create a new font id. |
BOOL shared; | When TRUE, the editor matches the requested specification against the existing font ids. If a matching font id is found, it returns that id. Otherwise it creates a new id. A TRUE value for this field is mutually exclusive with a zero or positive value for the ReuseId field. |
LPBYTE typeface; | Typeface of the new font |
int PointSize; | Point size of the new font. You can also specify the font size in twips unit by using a negative value (1 point equal 20 twips). |
WORD style; | Style bits for the new font. Refer to the function SetTerCharStyle for a list of style ids. Use 0 for the default value. |
COLORREF color; | Text foreground color. use 0 for default. |
COLORREF BkColor; | Text background color. use 0xFFFFFF for default. |
int FieldId; | Text field id. Use 0 for the default value. |
int AuxId; | An application specified id. The editor does not use this id internally. Use 0 for default. |
int CharStyId; | Character style id. Set to 1 to use the default. |
int ParaStyId; | Paragraph style id. Set to 0 to use the default. |
int exapnd; | Character width expansion in twips unit. Use 0 for default. |
UINT CharSet | Character set for the font |
Description: This function is used to create a new font id or to modify an exiting id with new font information. To modify an existing id, specify the old font id using the 'ReuseId' argument, otherwise set the 'ReuseId' parameter to -1. When an existing id is modified, this function automatically updates the text which uses this id with new information.
Return Value: When successful, this function returns the id of the new font. Otherwise it returns -1.