From: Peter Dyballa <Peter_Dyballa@Web.DE>
To: "help-gnu-emacs@gnu.org list" <help-gnu-emacs@gnu.org>
Subject: Re: Why can't emacs recognize X fonts?
Date: Sun, 20 Jun 2010 10:46:46 +0200 [thread overview]
Message-ID: <424C6A04-3435-487C-9985-CAE28C3079E8@Web.DE> (raw)
In-Reply-To: <87aaqq1kyz.fsf@rimspace.net>
> Qiang Guo writes:
>
>> I'm using a emacs 23.2 I built on Mac OSX under X11. However, it
>> can't not
>> recognize fonts like Monaco which are available in X11. For
>> example, I can
>> see fonts by xlsfonts command. Is there any compiling parameter
>> missing ?
You should configure libfontconfig (start with M-x manual-entry RET fc-
list RET and check also /usr/X11/lib/X11/fontconfig/conf.d/05-osx-
fonts.conf) so that this user-side font service finds the fonts. Then
create the cache files with (sudo) fc-cache.
Another option is to make sure that in /Library/Fonts etc. the files
fonts.dir and fonts.scale exist.
In GNU Emacs you can also check which fonts are actually available:
M-x set-frame-font RET TAB TAB C-g
A volatile buffer *Completions* has been created containing the list
of fonts. Or use this function from Miles Bader:
;;; list-fonts-display via font-config
(defun list-fonts-display (&optional matching)
"Display a list of font-families available via font-config, in a
new buffer.
If the optional argument MATCHING is non-nil, only font families
matching that regexp are displayed; interactively, a prefix
argument will prompt for the regexp.
The name of each font family is displayed using that family, as
well as in the default font (to handle the case where a font
cannot be used to display its own name)."
(interactive
(list
(and current-prefix-arg
(read-string "Display font families matching regexp: "))))
(let (families)
(with-temp-buffer
(shell-command "fc-list : family" t)
(goto-char (point-min))
(while (not (eobp))
(let ((fam (buffer-substring (line-beginning-position)
(line-end-position))))
(when (or (null matching) (string-match matching fam))
(push fam families)))
(forward-line)))
(setq families
(sort families
(lambda (x y) (string-lessp (downcase x) (downcase y)))))
(let ((buf (get-buffer-create "*Font Families*")))
(with-current-buffer buf
(erase-buffer)
(dolist (family families)
;; We need to pick one of the comma-separated names to
;; actually use the font; choose the longest one because some
;; fonts have ambiguous general names as well as specific
;; ones.
(let ((family-name
(car (sort (split-string family ",")
(lambda (x y) (> (length x) (length y))))))
(nice-family (replace-regexp-in-string "," ", " family)))
(insert (concat (propertize nice-family
'face (list :family family-name))
" (" nice-family ")"))
(newline)))
(goto-char (point-min)))
(display-buffer buf))))
--
Greetings
Pete
Perl—the only language that looks the same before and after RSA
encryption.
- Keith Bostic
next prev parent reply other threads:[~2010-06-20 8:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-18 4:26 Why can't emacs recognize X fonts? Qiang Guo
2010-06-20 2:44 ` Daniel Pittman
2010-06-20 8:46 ` Peter Dyballa [this message]
2010-06-21 21:38 ` Qiang Guo
2010-07-08 20:15 ` Allan Gottlieb
2010-07-08 20:53 ` Peter Dyballa
2010-07-08 22:21 ` Allan Gottlieb
[not found] ` <mailman.7.1278627686.10601.help-gnu-emacs@gnu.org>
2010-07-12 19:05 ` Giacomo Boffi
2010-07-08 21:03 ` Qiang Guo
2010-07-08 22:08 ` Allan Gottlieb
[not found] ` <mailman.4.1277002332.647.help-gnu-emacs@gnu.org>
2010-06-20 3:44 ` Juhapekka Tolvanen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=424C6A04-3435-487C-9985-CAE28C3079E8@Web.DE \
--to=peter_dyballa@web.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.