Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Примеры брендбуков / apple_osx-aqua-human-interface.pdf
Скачиваний:
17
Добавлен:
16.02.2016
Размер:
8.01 Mб
Скачать

C H A P T E R 1 0

Fonts

Mac OS X supports seven standard fonts for interface elements (in Roman systems). Whenever your application specifies a font, use the system-defined constants shown in Table 10-1 (page 199); avoid naming a specific font and point size. Using the system constants ensures that your application always displays the appropriate fonts, regardless of changes to the OS.

Figure 10-1 Mac OS X standard fonts

Use

Font and size

System font

System font (emphasized)

Small system font

Small system font (emphasized)

Application font

Label font

Mini system font

The system font is used for text in menus, modeless dialogs, and titles of document windows. For an example of this font, open a Finder menu.

Note: For text in lists and tables, you can use 12-point Lucida Grande Regular instead of the system font.

197

Apple Computer, Inc. June 2002

C H A P T E R 1 0

Fonts

The small system font is used for informative text in alerts (see Figure 6-2

(page 99)). It is also the default font for headings in lists, for help tags, and for text in the small versions of many controls. You can also use it to provide additional information about settings in various windows, such as the QuickTime pane in System Preferences.

If your application creates text documents, use the application font as the default for user-created content.

The label font is used for labels with controls such as sliders and icon bevel buttons. You should rarely need to use this font in dialogs, but may find it useful in utility windows when space is at a premium. For an example of this font used to label a slider control, click the Text-to-Speech tab in Speech preferences.

If necessary, the mini system font can be used for utility window labels and text. (Use it wherever you used 9-point Geneva in Mac OS 9.)

Use emphasized system fonts sparingly. Emphasized (bold) system font is used in only two places in the interface: the application name in an About window (see “The About Window” (page 92)) and the message text in an alert (see Figure 6-2 (page 99)). You might use emphasized small system font to title a group of settings that appear without a group box, or for brief informative text below a text field. For an example of the emphasized small system font, click the Date or Numbers tab in International preferences.

To have the Aqua look and feel, all user-visible text in your application should be anti-aliased. this can be achieved by using one of the system fonts listed. Carbon developers creating nonstandard interface elements with text or displaying any user-visible text are responsible for drawing their own anti-aliased text via the Appearance Manager DrawThemeTextBox functions or the Control Manager static text control. In Cocoa, all text is anti-aliased by default.

198

Apple Computer, Inc. June 2002

C H A P T E R 1 0

Fonts

For user-created text, Carbon developers should use the Multilingual Text Engine (MLTE) functions and Apple Type Services for Unicode Imaging (ATSUI) to provide text-editing support. Carbon developers can use the NSTextField or NSTextView classes. Table 10-1 shows the constants to use in Carbon functions and the NSFont methods to use in Cocoa.

Table 10-1 Font constants and methods in Carbon and Cocoa

Font

Appearance Manager constants

Application Kit methods

System font

kThemeSystemFont

[NSFont systemFontOfSize:[NSFont

 

 

systemFontSize]]

 

 

 

Emphasized system

kThemeEmphasizedSystemFont

[NSFont

font

 

boldsystemFontOfSize:[NSFont

 

 

systemFontSize]]

 

 

 

Small system font

kThemeSmallSystemFont

[NSFont systemFontOfSize:[NSFont

 

 

smallSystemFontSize]]

 

 

 

Emphasized small

kThemeSmallEmphazisedSystemFont

[NSFont

system font

 

boldSystemFontOfSize:[NSFont

 

 

smallSystemFontSize]]

 

 

 

Label font

kThemeLabelFont

[NSFont labelFontOfSize:[NSFont

 

 

labelFontSize]]

 

 

 

Mini system font

kThemeUtilityWindowTitleFont

[NSFont paletteFontOfSize:0]

 

 

 

199

Apple Computer, Inc. June 2002

C H A P T E R 1 0

Fonts

200

Apple Computer, Inc. June 2002

Соседние файлы в папке Примеры брендбуков