all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Why can't emacs recognize X fonts?
@ 2010-06-18  4:26 Qiang Guo
  2010-06-20  2:44 ` Daniel Pittman
       [not found] ` <mailman.4.1277002332.647.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 11+ messages in thread
From: Qiang Guo @ 2010-06-18  4:26 UTC (permalink / raw
  To: Emacs mailing list

Hi, community

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
  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
       [not found] ` <mailman.4.1277002332.647.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel Pittman @ 2010-06-20  2:44 UTC (permalink / raw
  To: help-gnu-emacs

Qiang Guo <mcknight0219@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.

Regards,
        Daniel

-- 
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
       [not found] ` <mailman.4.1277002332.647.help-gnu-emacs@gnu.org>
@ 2010-06-20  3:44   ` Juhapekka Tolvanen
  0 siblings, 0 replies; 11+ messages in thread
From: Juhapekka Tolvanen @ 2010-06-20  3:44 UTC (permalink / raw
  To: help-gnu-emacs



Daniel Pittman <daniel@rimspace.net> writes:

> Qiang Guo <mcknight0219@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."


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
  2010-06-20  2:44 ` Daniel Pittman
@ 2010-06-20  8:46   ` Peter Dyballa
  2010-06-21 21:38     ` Qiang Guo
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Dyballa @ 2010-06-20  8:46 UTC (permalink / raw
  To: help-gnu-emacs@gnu.org list


> 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




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
  2010-06-20  8:46   ` Peter Dyballa
@ 2010-06-21 21:38     ` Qiang Guo
  2010-07-08 20:15       ` Allan Gottlieb
  0 siblings, 1 reply; 11+ messages in thread
From: Qiang Guo @ 2010-06-21 21:38 UTC (permalink / raw
  To: Peter Dyballa; +Cc: help-gnu-emacs@gnu.org list

Hi, Peter

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
  2010-06-21 21:38     ` Qiang Guo
@ 2010-07-08 20:15       ` Allan Gottlieb
  2010-07-08 20:53         ` Peter Dyballa
  2010-07-08 21:03         ` Qiang Guo
  0 siblings, 2 replies; 11+ messages in thread
From: Allan Gottlieb @ 2010-07-08 20:15 UTC (permalink / raw
  To: help-gnu-emacs

Qiang Guo <mcknight0219@gmail.com> writes:

> 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/



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
  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-08 21:03         ` Qiang Guo
  1 sibling, 2 replies; 11+ messages in thread
From: Peter Dyballa @ 2010-07-08 20:53 UTC (permalink / raw
  To: Allan Gottlieb; +Cc: help-gnu-emacs


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.

--
Greetings

   Pete

The day Microsoft makes something that doesn't suck is the day they  
start selling vacuum cleaners.
				– Ernest Jan Plugge




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
  2010-07-08 20:15       ` Allan Gottlieb
  2010-07-08 20:53         ` Peter Dyballa
@ 2010-07-08 21:03         ` Qiang Guo
  2010-07-08 22:08           ` Allan Gottlieb
  1 sibling, 1 reply; 11+ messages in thread
From: Qiang Guo @ 2010-07-08 21:03 UTC (permalink / raw
  To: Allan Gottlieb; +Cc: help-gnu-emacs

Hi Allan

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 :-)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
  2010-07-08 21:03         ` Qiang Guo
@ 2010-07-08 22:08           ` Allan Gottlieb
  0 siblings, 0 replies; 11+ messages in thread
From: Allan Gottlieb @ 2010-07-08 22:08 UTC (permalink / raw
  To: help-gnu-emacs

Qiang Guo <mcknight0219@gmail.com> writes:

> 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



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
  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>
  1 sibling, 0 replies; 11+ messages in thread
From: Allan Gottlieb @ 2010-07-08 22:21 UTC (permalink / raw
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> 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



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Why can't emacs recognize X fonts?
       [not found]           ` <mailman.7.1278627686.10601.help-gnu-emacs@gnu.org>
@ 2010-07-12 19:05             ` Giacomo Boffi
  0 siblings, 0 replies; 11+ messages in thread
From: Giacomo Boffi @ 2010-07-12 19:05 UTC (permalink / raw
  To: help-gnu-emacs

Allan Gottlieb <gottlieb@nyu.edu> writes:

> 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-07-12 19:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.