![]() |
TEStyleRec |
Header: TextEdit.h |
struct TEStyleRec { SInt16 nRuns; SInt16 nStyles; STHandle styleTab; LHHandle lhTab; SInt32 teRefCon; NullStHandle nullStyle; StyleRun runs[8001]; }; typedef TEStyleRec TEStylePtr;
The number of style runs in the text.
The number of distinct sets of character attributes used in the text; this forms the size of the style table.
A handle to the style table.
A handle to the line height table.
A reference constant for use by applications. The application can use this 32-bit field to suit its needs.
A handle to the style scrap structure used to store the character attribute information for a null selection.
A table of style runs that is of indefinite length.
The style structure stores the character attribute information for the text of a multistyled edit structure. If an edit structure has associated character attribute information, its txFont and txFace fields combine to hold a style handle, of type TEStyleHandle, to its style structure. The text is divided into style runs, summarized in the style run table, of type StyleRun, which is part of the style structure. Each entry in the style run table gives the starting character position of a run and an index into the style table, of type TEStyleTable.
The style table element pointed to by the style run index describes the character attributes for that run.
To determine the length of a run, you subtract its start position from that of the next entry in the style run table. A dummy entry at the end of the style run table delimits the length of the last run; its start position is equal to the overall number of characters in the text, plus 1. The TEStyleRec data type defines the style structure.
The style run table, defined by the StyleRun data type, is an array that contains the boundaries of each style run and an index to its character attribute information in the style element array. The style table, defined by the TEStyleTable data type, contains one entry for each distinct set of character attributes used in the text of the edit structure.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)