background image
C H A P T E R 8
Text and Ink Input and Display
Using Text
8-19
Note
Apple recommending using the normal, bold, and underline font
styles. The other styles do not necessarily display well on
Newton screens.
For pointSize, use an integer that specifies the point size value.
The Packed Integer Font Specification
8
You can specify a font in one 30-bit integer. A packed integer font specification
uses the lower 10 bits for the font family, the middle 10 bits for the font size, and
the upper 10 bits for the font style. Since only the ROM fonts have predefined font
family number constants, you can only specify ROM fonts in a packed value.
Using the Built-in Fonts
8
The system provides several constants you can use to specify one of the built-in fonts.
These constants are listed in Table 8-5. The fonts shown in the table can be specified
by the constant (usable at compile time only), by their font frame, or by an integer
value that packs all of the font information into an integer (sometimes this is what
you see at run time if you examine a
viewFont
slot in the NTK Inspector).
Table 8-5
Built-in font constants
Constant
Font frame
Integer value
ROM_fontsystem9
{family:'espy,
face:0, size:9}
9216
ROM_fontsystem9bold
{family:'espy,
face:1, size:9}
1057792
ROM_fontsystem9underline
{family:'espy,
face:4, size:9}
4203520
ROM_fontsystem10
{family:'espy,
face:0, size:10}
10240
ROM_fontsystem10bold
{family:'espy,
face:1, size:10}
1058816
ROM_fontsystem10underline
{family:'espy,
face:4, size:10}
4204544
ROM_fontsystem12
{family:'espy,
face:0, size:12}
12288
ROM_fontsystem12bold
{family:'espy,
face:1, size:12}
1060864
continued
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна