background image
C H A P T E R 8
Text and Ink Input and Display
Using Text
8-21
The integers in Table 8-5 are derived by packing font family, face, and size
information into a single integer value. Each NewtonScript integer is 30 bits in
length. In packed font specifications, the lower 10 bits hold the font family, the
middle 10 bits hold the font size, and the upper 10 bits hold the font style.
These three parts added together specify a single font in one integer value. You can
use the constants listed in Table 8-6 at compile time to specify all of the needed infor-
mation. To do this, add one constant from each category together to yield a complete
font specification. At run time, of course, you'll need to use the integer values.
editFont10
{family:'handwriting,
face:0, size:10}
10243
editFont12
{family:'handwriting,
face:0, size:12}
12291
editFont18
{family:'handwriting,
face:0, size:18}
18435
Table 8-6
Font packing constants
Constant
Value
Description
Font Family
(none defined)
0
Identifies the System font (Espy)
tsFancy
1
Identifies the New York font
tsSimple
2
Identifies the Geneva font
tsHWFont
3
Identifies the Casual (Handwriting)
font
Font Size
tsSize(
pointSize
)
pointSize
<< 10
Specify the point size of the font in
pointSize
Font Face
tsPlain
0
Normal font
tsBold
1048576
Bold font
continued
Table 8-5
Built-in font constants (continued)
Constant
Font frame
Integer value
© 2007-2017, o7 studio » при воспроизведении материала сайта ссылка обязательна