Index

C/C++ Functions

txTextSetAttribs

DT_SWORD txTextSetAttribs(DT_TXDOC text_doc, DT_SLONG first_char, DT_SLONG last_char, const DT_TX_ATTRIBS text_attribs[], DT_SWORD reserved)

Short Description: Format (i.e. style) text document

This function formats (styles) text.

Parameters

ParameterDescription

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.

Return Value

If the function was successful, the return value is 1. Otherwise, the function returns 0.

Note

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.

Comments

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.

 

Index