an appropriate name is generated automatically.
It returns a name of the created fontset."
- (let ((fontset
- (create-fontset-from-ascii-font font resolved-font fontset-name)))
- (fontset-add-mac-fonts fontset t)
- fontset))
+ (or resolved-font
+ (setq resolved-font (x-resolve-font-name font)))
+ (let ((base-family (aref (x-decompose-font-name resolved-font)
+ xlfd-regexp-family-subnum)))
+ (if (string= base-family "*")
+ (setq base-family nil))
+ (new-fontset fontset-name (list (cons 'ascii resolved-font)))
+ (fontset-add-mac-fonts fontset-name base-family)))
+ ;; Adjust Courier font specifications in x-fixed-font-alist.
+ (let ((courier-fonts (assoc "Courier" x-fixed-font-alist)))
+ (if courier-fonts
+ (dolist (label-fonts (cdr courier-fonts))
+ (setcdr label-fonts
+ (mapcar
+ (lambda (font)
+ (if (string-match "\\`-adobe-courier-\\([^-]*\\)-\\(.\\)-\\(.*\\)-iso8859-1\\'" font)
+ (replace-match
+ (if (string= (match-string 2 font) "o")
+ "-*-courier-\\1-i-\\3-*-*"
+ "-*-courier-\\1-\\2-\\3-*-*")
+ t nil font)
+ font))
+ (cdr label-fonts))))))
+
;; Setup the default fontset.
(setup-default-fontset)
-(cond ((x-list-fonts "*-iso10646-1")
- ;; Use ATSUI (if available) for the following charsets.
- (dolist
- (charset '(latin-iso8859-1
- latin-iso8859-2 latin-iso8859-3 latin-iso8859-4
- thai-tis620 greek-iso8859-7 arabic-iso8859-6
- hebrew-iso8859-8 cyrillic-iso8859-5
- latin-iso8859-9 latin-iso8859-15 latin-iso8859-14
- japanese-jisx0212 chinese-sisheng ipa
- vietnamese-viscii-lower vietnamese-viscii-upper
- lao ethiopic tibetan))
- (set-fontset-font nil charset '(nil . "iso10646-1"))))
- ((null (x-list-fonts "*-iso8859-1"))
- ;; Add Mac-encoding fonts unless ETL fonts are installed.
- (fontset-add-mac-fonts "fontset-default")))
;; Create a fontset that uses mac-roman font. With this fontset,
-;; characters decoded from mac-roman encoding (ascii, latin-iso8859-1,
-;; and mule-unicode-xxxx-yyyy) are displayed by a mac-roman font.
-(create-fontset-from-fontset-spec
- "-etl-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard,
-ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman")
-(fontset-add-mac-fonts "fontset-standard" t)
+;; characters belonging to mac-roman charset (that contains ASCII and
+;; more Latin characters) are displayed by a mac-roman font.
+(create-fontset-from-mac-roman-font
+ "-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman" nil
+ "-apple-Monaco-normal-r-*-*-12-*-*-*-*-*-fontset-standard")
;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...).
(create-fontset-from-x-resource)