[Fontconfig] Question about disabling globaladvance

James Cloos cloos at jhcloos.com
Tue Mar 13 04:25:24 PDT 2007


>>>>> "Peng" == Peng Deng <dengpeng at gmail.com> writes:

Peng> But the problem is, not every application uses fonts.conf for
Peng> their fonts, like the emacs23 (with Xft support) which reads
Peng> Xft settings from ~/.Xresources.  So is there anyone who knows
Peng> how to disable globaladvance with ~/.Xresources for these apps?

While emacs23 does get font names from X resources, settings in
fonts.conf which override the details for specific fonts should
still work as expected.

So, you should be able to add a file to /etc/fonts/conf.d which
looks like /etc/fonts/conf.avail/20-fix-globaladvance.conf; eg
something like:

,----
| <?xml version="1.0"?>
| <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
| <fontconfig>
| 	<match target="font">
| 		<test name="family"><string>Monaco</string></test>
| 		<edit name="globaladvance"><bool>false</bool></edit>
| 	</match>
| </fontconfig>
`----

Or you can add that <match/> clause to your ~/.fonts.conf.

If you prefer to do it via the X Resource, add :globaladcance=false
to the font specification.  Eg something like:

,----
| emacs*FontBackend: xft
| emacs.font: Monaco:globaladvance=false:pixelsize=16
`----

(I use :pixelsize rather than specifying a point size for Emacs and
terminals so that I can be sure how many rows and columns to expect
when maximized....)

-JimC
-- 
James Cloos <cloos at jhcloos.com>         OpenPGP: 1024D/ED7DAEA6


More information about the Fontconfig mailing list