C H A P T E R 8
Text and Ink Input and Display
// 8 chars of one font, 3 chars of another, 5 chars
// of another
styles: [8, 18434, 3, 12290, 5, 1060865],
Paragraph views are normally lined to convey to the user that the view accepts text
input. To add the lined paper effect to paragraph views, see "Creating the Lined
Paper Effect in a Text View" (page 8-8).
Lightweight Paragraph Views
When you create a template using the
class, and that
template is instantiated into a view at run time, the system may create a specialized
kind of paragraph view object, called a lightweight paragraph view. Lightweight
paragraph views have the advantage of requiring much less memory than do
standard paragraph views.
The system automatically creates a lightweight paragraph view instead of a
standard paragraph view if your template meets the following conditions:
The view must be read-only, which means that its
slot contains the
The view must not include any tabs, which means that the template does not
The view must not include multiple font styles, which means that the template
does not contain the
slot; however, the view can contain a rich string in
slot. For information about rich strings, see "Rich Strings" (page 8-22).
slot of the view must not contain the following flags:
Lightweight paragraph views can contain ink.
Most paragraph views look the same after they are instantiated; that is, there is
not normally a way to tell whether a particular paragraph view is a standard or a
lightweight view. However, ink displayed in a lightweight paragraph view is
displayed in a fixed font size.
When laying out text in a lightweight paragraph view, the
viewLineSpacing value is ignored. This is not generally a
problem, since the line spacing dotted lines are normally used to
indicate that the text can be edited, and text in a lightweight
paragraph cannot be edited.