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 ?
Cheers~
Qiang
In 23.2, xft font support (and other pluggable back-ends, which may also apply
on your platform) are available to Emacs. By default, I suspect it is using
one of those.
If you look in the info section "25.7 Fonts", you can there read about the
configuration options available to you to make this work as expected.
Regards,
Daniel
--
✣ Daniel Pittman ✉ dan...@rimspace.net ☎ +61 401 155 707
♽ made with 100 percent post-consumer electrons
Daniel Pittman <dan...@rimspace.net> writes:
> Qiang Guo <mcknig...@gmail.com> 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 ?
>
> In 23.2, xft font support (and other pluggable back-ends, which may also apply
> on your platform) are available to Emacs. By default, I suspect it is using
> one of those.
>
> If you look in the info section "25.7 Fonts", you can there read about the
> configuration options available to you to make this work as expected.
If your Emacs uses Xft/fontconfig/Freetype/etc. for its fonts, then you can
get a list of available fonts this way:
fc-list
It gives very long output. Feel free to pipe it through grep, sort, uniq,
less etc. For example, if I want to know names of all fonts that belong to
DejaVu-family, I can do this:
% fc-list | grep -i dejavu | sort
DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold,Bold
DejaVu Sans,DejaVu Sans Condensed:style=Condensed Bold Oblique,Bold Oblique
DejaVu Sans,DejaVu Sans Condensed:style=Condensed,Book
DejaVu Sans,DejaVu Sans Condensed:style=Condensed Oblique,Oblique
DejaVu Sans,DejaVu Sans Light:style=ExtraLight
DejaVu Sans Mono:style=Bold
DejaVu Sans Mono:style=Bold Oblique
DejaVu Sans Mono:style=Book
DejaVu Sans Mono:style=Oblique
DejaVu Sans:style=Bold
DejaVu Sans:style=Bold Oblique
DejaVu Sans:style=Book
DejaVu Sans:style=Oblique
DejaVu Serif,DejaVu Serif Condensed:style=Condensed Bold,Bold
DejaVu Serif,DejaVu Serif Condensed:style=Condensed Bold Italic,Bold Italic
DejaVu Serif,DejaVu Serif Condensed:style=Condensed,Book
DejaVu Serif,DejaVu Serif Condensed:style=Condensed Italic,Italic
DejaVu Serif:style=Bold
DejaVu Serif:style=Bold Italic
DejaVu Serif:style=Book
DejaVu Serif:style=Italic
--
Juhapekka "naula" Tolvanen * http colon slash slash iki dot fi slash juhtolv
"Quidquid Latine dictum sit altum videtur."
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
Thanks for your reply, which is really helpful. But I still
don't solve the problem. I'm pretty sure that other X
application can find those xft fonts. So the problem i think
must lie in emacs. I thought emacs can recognize fonts
avaliable to X inherently, or can it ?
Cheers
Qiang
> I thought emacs can recognize fonts
> avaliable to X inherently, or can it ?
I am having the same problem.
This is a new laptop and I have switched from gentoo stable to gentoo
testing so I can't be sure it is emacs. But I can say that I was using
dejavu on 23.1 before the switch and now can't use dejavu on 23.2.
As with qiang, xlsfonts finds as does my X log file (excerpt below).
allan
[ 44.421] (**) FontPath set to:
/usr/share/fonts/dejavu/,
/usr/share/fonts/misc/,
/usr/share/fonts/TTF/,
/usr/share/fonts/OTF/,
/usr/share/fonts/Type1/,
/usr/share/fonts/100dpi/,
/usr/share/fonts/75dpi/
> FontPath set to:
I don't where, from which programme, this statement comes from, you
can determine the font path the X server uses by running
xset q
Besides this a user side font management exists: libfontconfig.
Commands like fc-list, fc-cache, or fc-match are related to this and
files like fonts.conf. The X resource (Emacs.)FontBackend, which can
have the values xft, ftx, or x, I think, sets the order by which GNU
Emacs will check if the fonts system supplies the specified font. The
font backends used can depend on the libraries found on the system.
--
Greetings
Pete
The day Microsoft makes something that doesn't suck is the day they
start selling vacuum cleaners.
– Ernest Jan Plugge
I have solved problem. It's rather stupid of me because I
built Emacs without libxft installed for X11. So, if you are
experiencing the same problem, try to check this out.
Good luck :-)
> I have solved problem. It's rather stupid of me because I
> built Emacs without libxft installed for X11. So, if you are
> experiencing the same problem, try to check this out.
I was just about to write that I solved it as well. I made a similar
silly error: I had the library installed but did not build emacs to use
xft.
Good news for both of us.
allan
> Am 08.07.2010 um 22:15 schrieb Allan Gottlieb:
>
>> FontPath set to:
>
> I don't where, from which programme, this statement comes from, you
> can determine the font path the X server uses by running
>
> xset q
>
> Besides this a user side font management exists:
> libfontconfig. Commands like fc-list, fc-cache, or fc-match are
> related to this and files like fonts.conf. The X resource
> (Emacs.)FontBackend, which can have the values xft, ftx, or x, I
> think, sets the order by which GNU Emacs will check if the fonts
> system supplies the specified font. The font backends used can depend
> on the libraries found on the system.
Thanks for this useful information. As I mentioned in another post my
error was simpler (emacs built w/o xft support).
I tried both "xset q" and fc-list. Both confirm the fonts.
thanks again,
allan
> I tried both "xset q" and fc-list. Both confirm the fonts.
just for other's reference, xlsfonts(1)
--
la lenza penzola
-- PMF, in IHC