manpagez: man pages & more
info emacs
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

F.5 Specifying Fonts on Mac

It is rare that you need to specify a font name in Emacs; usually you specify face attributes instead. For example, you can use 14pt Courier by customizing the default face attributes for all frames:

 
(set-face-attribute 'default nil
                    :family "courier" :height 140)

Alternatively, an interactive one is also available (see section Customizing Faces).

But when you do need to specify a font name in Emacs on Mac, use a standard X font name:

 
-maker-family-weight-slant-widthtype-style…
…-pixels-height-horiz-vert-spacing-width-charset

See section Font Specification Options. Wildcards are supported as they are on X.

Emacs on Mac OS Classic uses QuickDraw Text routines for drawing texts by default. Emacs on Mac OS X uses ATSUI (Apple Type Services for Unicode Imaging) as well as QuickDraw Text, and most of the characters other than Chinese, Japanese, and Korean ones are drawn using the former by default.

ATSUI-compatible fonts have maker name apple and charset iso10646-1. For example, 12-point Monaco can be specified by the name:

 
-apple-monaco-medium-r-normal--12-*-*-*-*-*-iso10646-1

Note that these names must be specified using a format containing all 14 ‘-’s (not by ‘-apple-monaco-medium-r-normal--12-*-iso10646-1’, for instance), because every ATSUI-compatible font is a scalable one.

QuickDraw Text fonts have maker name apple and various charset names other than iso10646-1. Native Apple fonts in Mac Roman encoding has charset mac-roman. You can specify a mac-roman font for ASCII characters like

 
(add-to-list
 'default-frame-alist
 '(font . "-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman"))

but that does not extend to ISO-8859-1: specifying a mac-roman font for Latin-1 characters introduces wrong glyphs.

Native Apple Traditional Chinese, Simplified Chinese, Japanese, Korean, Central European, Cyrillic, Symbol, and Dingbats fonts have the charsets ‘big5-0’, ‘gb2312.1980-0’, ‘jisx0208.1983-sjis’ and ‘jisx0201.1976-0’, ‘ksc5601.1989-0’, ‘mac-centraleurroman’, ‘mac-cyrillic’, ‘mac-symbol’, and ‘mac-dingbats’, respectively.

The use of create-fontset-from-fontset-spec (see section Defining fontsets) for defining fontsets often results in wrong ones especially when using only OS-bundled QuickDraw Text fonts. The recommended way to use them is to create a fontset using create-fontset-from-mac-roman-font:

 
(create-fontset-from-mac-roman-font
 "-apple-courier-medium-r-normal--13-*-*-*-*-*-mac-roman"
 nil "foo")

and then optionally specifying Chinese, Japanese, or Korean font families using set-fontset-font:

 
(set-fontset-font "fontset-foo"
		  'chinese-gb2312 '("song" . "gb2312.1980-0"))

Single-byte fonts converted from GNU fonts in BDF format, which are not in the Mac Roman encoding, have foundry, family, and character sets encoded in the names of their font suitcases. E.g., the font suitcase ‘ETL-Fixed-ISO8859-1’ contains fonts which can be referred to by the name ‘-ETL-fixed-*-iso8859-1’.

Mac OS X 10.2 or later can use two types of text renderings: Quartz 2D (aka Core Graphics) and QuickDraw. By default, Emacs uses the former on such versions. It can be changed by setting mac-allow-anti-aliasing to t (Quartz 2D) or nil (QuickDraw). Both ATSUI and QuickDraw Text drawings are affected by the value of this variable.

Appearance of text in small sizes will also be affected by the “Turn off text smoothing for font sizes n and smaller” setting in the General pane (Mac OS X 10.1 or 10.2) or in the Appearance pane (10.3 or later) of the System Preferences. This threshold can alternatively be set just for Emacs (i.e., not as the system-wide setting) using the defaults command:

 
defaults write org.gnu.Emacs AppleAntiAliasingThreshold n

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.