This function formats (styles) text.
Parameter | Description |
---|---|
text_doc |
Handle of the associated text document instance. |
first_char |
Start position of the character range to apply format (style) to. |
last_char |
End position of the character range to apply format (style) to. |
text_attribs |
A pointer to an array of DT_TX_ATTRIBS structures that supply text styling/formatting attributes to apply. For convenience, several commonly used styles and formats are predefined in the library's header file (dtype.h). See Appendix — Predefined Styles/Formats for a complete list. |
reserved |
Reserved for future use. Must be set to 0. |
If the function was successful, the return value is 1. Otherwise, the function returns 0.
If first_char and last_char are both set to -1, the function will format (style) the characters covered by the active text selection(s). This works even for multiple (non-contiguous) and block (rectangular) text selections.
This is an optional function because not all types of applications need to format (style) text. For example, applications that only display plain text (e.g. terminal programs or database applications) will not need to call this function. However, applications that render rich text will call this function often.