All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

wrap-text-for-pane Function

Summary

Wraps text for a given pane.

Package

capi

Signature

wrap-text-for-pane pane text &key external-width visible-width font start end => strings

Arguments
pane
A displayed CAPI pane.
text
A string.
external-width
An integer or nil.
visible-width
An integer or nil.
font
A font object.
start
An integer.
end
An integer or nil.
Values
strings
A list of strings.
Description

The function wrap-text-for-pane takes a string text and returns a list of strings. Together the strings in strings contain all the non-whitespace characters of text and are suitable for displaying this text on pane. That is, each string has a display width no greater than the width of pane when drawn using the font of pane. The arguments start and end are used as bounding index designators for text and characters outside these bounds are ignored.

If visible-width is non-nil then text is wrapped to that width. Otherwise, if external-width is non-nil then text is wrapped as if the pane had that external width (that is, taking account of any borders in the pane). If both visible-width and external-width are nil, then the text is wrapped to the current visible width of the pane. The default value of both visible-width and external-width is nil.

font is used to perform the wrapping calculations. If it is nil (the default), then the graphics-state-font is used for panes such as output-pane that have a graphics-state and the simple-pane-font is used for other panes.

See also

wrap-text


CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:27