macos:Text-fonts

出自UXGuide.net

跳转到: 导航, 搜索

Fonts

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

The system font (Lucida Grande Regular 13 point) is used for text in menus, dialogs, and full-size controls.

Use the emphasized system font (Lucida Grande Bold 13 point) sparingly. It is used for the message text in alerts (see “Alerts”).

The small system font (Lucida Grande Regular 11 point) is used for informative text in alerts (see “Alerts”). It is also the default font for column headings in lists, for help tags, and for small controls. You can also use it to provide additional information about settings in various windows, such as in the QuickTime preferences.

Use the emphasized small system font (Lucida Grande Bold 11 point) sparingly. You might use it to title a group of settings that appear without a group box, or for brief informative text below a text field.

The mini system font (Lucida Grande Regular 9 point) is used for mini controls. It can also be used for panel labels and text.

An emphasized mini system font (Lucida Grande Bold 9 point) is available for cases in which the emphasized small system font is too large.

If your application creates text documents, use the application font (Lucida Grande Regular 13 point) as the default font for user-created content.

The label font (Lucida Grande Regular 10 point) is used for the labels on toolbar buttons and to label tick marks on full-size sliders. You should rarely need to use this font. For an example of this font used to label a slider control, see the Dock size slider in Dock preferences.

Use the view font (Lucida Grande Regular 12 point) as the default font of text in lists and tables.

Note that the Lucida Grande font family includes mono-spaced numeric characters and variably-spaced alphabetics.

All user-visible text in your application should be anti-aliased, which is automatic if you use one of the standard system fonts.

Table 10-1 shows the constants to use in Carbon functions and the NSFont methods to use in Cocoa.

Table 10-1 Carbon constants and Cocoa methods for system fonts

Font Carbon constants Cocoa methods
System font kThemeSystemFont [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize: NSRegularControlSize]]
Emphasized system font kThemeEmphasizedSystemFont [NSFont boldSystemFontOfSize:[NSFont systemFontSizeForControlSize: NSRegularControlSize]]
Small system font kThemeSmallSystemFont [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize: NSSmallControlSize]]
Emphasized small system font kThemeSmallEmphasizedSystemFont [NSFont boldSystemFontOfSize:[NSFont systemFontSizeForControlSize: NSSmallControlSize]]
Mini system font kThemeMiniSystemFont [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize: NSMiniControlSize]]
Emphasized mini system font Not Available [NSFont boldSystemFontOfSize:[NSFont systemFontSizeForControlSize: NSMiniControlSize]]
Application font kThemeApplicationFont [NSFont userFontOfSize:0.0]
Label font kThemeLabelFont [NSFont labelFontOfSize:[NSFont labelFontSize]]
个人工具
名字空间
变换
动作
导航
工具箱