FindWord
void FindWord(textPtr, textLength, offset, leadingEdge, breaks, offsets );
Ptr textPtr ; address of a text string short textLength ; value for text length
short offset ; value for a position in the text string
Boolean leadingEdge ; use if pixel width falls within character's left side BreakTablePtr breaks ; list of word-division templates
FindWord takes a text string, and a position in the string, and returns offsets specifying the word's boundaries.
textPtr is a text string indicated by a pointer.
textLength is the length of the specified string.
offset is a position in the text string.
leftSide is a Boolean flag that is set if the pixel width falls within the left
side of a character. It can be used for word selection and for
positioning the cursor correctly at the end of lines.
breaks is a list of templates that help determine the boundaries of a word.
If breaks is Nil, the default word-selection break table for the
current script is used. If it is Ptr(-1L), the default word-wrapping
break table is used. If breaks has another value, it should point to a
valid break table that will become the default.
offsets indicates the boundaries (beginning and end) of the selected word.
Notes: Word-selection break tables give a words boundaries when you want to
select or drag them, or for such utilities as spell checking. Wrapping break
tables are used to distinguish words for finding the widths of lines for
wrapping.