NFindWord
void NFindWord( textPtr, textLength, offset, leadingEdge, n 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 NBreakTablePtr n breaks ; pointer to a break table
NFindWord takes a text string, and a position in the string, and returns offsets specifying the word's boundaries.
textPtr is a pointer to a text string.
textLength is the length of the specified string.
offset is a position in the text string.
leadingEdge 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.
n breaks is an explicit pointer to a new-format break table; the values 0 and
-1 may not be used to indicate default break tables.
offsets receives infromation about word boundaries
except that the n breaks parameter must be an explicit pointer to a
new-format break table; the values 0 and -1 may not be used to indicate
default break tables.
To specify the text block, you pass two parameters: the textPtr parameter,
a pointer to the beginning of the text to be examined, and the textLength
parameter, the length of the text to be examined. Since the offset parameter
specifies a position between two characters, additional information is
required to determine which character should be used as a basis for finding
the word boundaries. This is supplied by the leadingEdge parameter. If
leadingEdge is TRUE, the offset corresponds to the character whose leading
edge b orders the offset. (The leadingEdge parameter corresponds to the left
side in a left-to-right script such as Roman.) If leadingEdge is FALSE, the
offset is on the trailing edge of the specified character. To specify word
definitions, you pass the n breaks parameter, which is a pointer to a word
break table, a table that determines where word breaks occur.
NFindWord returns information about word boundaries in the offsets array. This is an array of three offset pairs. The first integer in the first
pair contains the offset before the leading edge of the first character of the
word; the second integer in the first pair contains the offset after the
trailing edge of the last character of the word. The remaining values in the
offsets array are set to 0.
and NFindWord have been designed for smooth integration with these routines.