Apple Newton Utilities User's Guide Page 317

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 316
CHAPTER 8
Text and Ink Input and Display
Using Text 8-25
Text and Styles 8
Within a paragraph view, text is represented in two slots: the 'text slot and the
'styles slot. The 'text slot contains the sequence of text characters in the
paragraph, including an instance of the
kParaInkChar placeholder character
(
0xF701) for each ink word.
The
'styles slot species how each text run is displayed in the paragraph. A
text run is a sequence of characters that are all displayed with the same font
specication. The
'styles slot consists of an array of alternating length and style
information: one length value and one style specication for each text run. For ink
words, the length value is always
1, and the style specication is a binary object
that contains the ink data.
For example, consider the paragraph text shown in Figure 8-5.
Figure 8-5 A paragraph view containing an ink word and text
In the paragraph view shown in Figure 8-5, the 'text slot contains the following
sequence of Unicode characters:
'T' 'r' 'y' ' ' 0xF701 'o' 'n' 'e'
The 'styles slot for this paragraph consists of the following array:
styles: [4, 12289, 1, <inkData, length 42>, 4, 12289]
The rst pair of values in the array, (4, 12289), covers the word “Try” and the
space that follows it. The length value,
4, species that the text run consists of four
characters. The packed integer font specication value
12289 species plain,
12-point, New York.
The second pair of values in the array, (
1, inkData), covers the ink word. The
length value is
1, which is always the case for ink words. The value inkData is a
binary object that contains the compressed data for the handwritten “this” that is
part of the text in the paragraph view. The data is automatically extracted from the
tablet data as part of a preliminary recognition process that precedes word recognition.
The third and nal pair of values in the 'styles slot array, (4, 12289), covers
the word “one” and the space that precedes it. This text run is 4 characters long and
is displayed 12 points high in the plain version of the New York font family.
Note
The packed integer font specication values
are shown in Table 8-6 (page 8-21).
Page view 316
1 2 ... 312 313 314 315 316 317 318 319 320 321 322 ... 941 942

Comments to this Manuals

No comments