help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Client-side font selection weirdness: font or size requested but never b


From: Nix
Subject: Client-side font selection weirdness: font or size requested but never both
Date: Wed, 16 Mar 2011 00:28:43 +0000
User-agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.5-b29 (linux)

[Note: this may be a trunk bug, or it may not be a bug at all.
 I tested with emacs-23 as well, but only in a desultory fashion.
 I'll do more investigation tomorrow.

 This is not in any way a formal bug report: I haven't collected
 enough information for that yet, and the cause is very probably
 user error.]

So I'm migrating from XEmacs 21.5 to Emacs trunk. I put this off for far
longer than was sensible because when you've been using the same editor
for fifteen years you get a bit set in your ways.

One of the ways I'm set in my ways is that I want a particular font:
to be specific, Neep Alt-12. In XEmacs 21.5, this is easy: it has
client-side fonts like most apps these days, so you just ask for
"Neep Alt-12", and you get back the thing fc-match would return
for it, to wit

address@hidden 200 /home/nix% fc-match 'Neep Alt-12'
neep-alt-iso10646-1-06x13.pcf.gz: "Neep Alt" "SemiCondensed"

With Emacs... not so much, though this is a Gtk Emacs, and fontconfig
and freetype are compiled in, so I'd expect client-side fonts to work.
Actually I suspect they sort of do, but the wrong font is determinedly
selected.

My X resources stipulate

Emacs.default.attributeFont: Neep Alt-12

and it is not overridden at the Lisp layer. But what I see when Emacs
comes up is a different font, much too large: a font which 'face-font'
states is

"-jmk-Neep Alt-normal-normal-normal-*-15-*-*-*-c-80-iso10646-1"

Firstly, this looks like a server-side font to me, not the client-side
font I would prefer. Is Emacs translating fontconfig fontspecs into some
sort of weird mutant hybrid fake XLFD specification, or is it actually
digging out a server-side font when I asked for a client-side one? The
manual is decidedly unclear on this. (I'm using Emacs trunk, but the
same behaviour is observed with the emacs-23 branch.)

I suspect this apparent XLFD fontspec is actually a translation of what
is really a client-side font (what a bizarre approach, if so), because
setting FC_DEBUG=1 reveals Emacs making numerous queries of fontconfig.
Unfortunately none of them are actually using the fontspec I requested!
e.g. here's a representative one (with indentation reduced to fit in 80
columns):

Match Pattern has 27 elts (size 32)
  family: "Neep Alt"(s) "DejaVu Sans"(w) [... huge list of families cut ...]
  slant: 0(i)(s)
  weight: 100(i)(s)
  width: 100(i)(s)
  pixelsize: 15(f)(s)
  spacing: 110(i)(s)
  foundry: "jmk"(s)
  antialias: FcTrue(s)
  hintstyle: 3(i)(s)
  hinting: FcTrue(s)
  verticallayout: FcFalse(s)
  autohint: FcFalse(s)
  globaladvance: FcTrue(s)
  file: "/usr/lib/X11/fonts/jmk/neep-alt-iso10646-1-08x15.pcf.gz"(s)
  index: 0(i)(s)
  dpi: 96.2816(f)(s)
  rgba: 1(i)(s)
  scale: 1(f)(s)
  minspace: FcFalse(s)
  charset:
  0000: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
  0001: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
  0002: ffffffff 000ffffd ffff0000 ffffffff ffffffff ffff3fff ffffffff 00007fff
  0003: ffffffff ffffffff 00007fff 4430ffff ffffd7f0 fffffffb ffff7fff 007fffff
  0004: ffffffff ffffffff ffffffff ffffffff ffffff7f ffffffff ffff7fff 033fffff
  0005: 0000ffff fffe0000 fe7fffff fffffffe 000006ff 40000000 ffff0009 001f07ff
  000e: fffffffe 87ffffff 0fffffff 00000000 00000000 00000000 00000000 00000000
  0016: 00000000 00000000 00000000 00000000 00000000 4b8a0e4d e4c48b92 00003827
  001e: ffffffff ffffffff ffffffff ffffffff 0fffffff 000000ff 00000000 03fc0000
  001f: 3f3fffff ffffffff aaff3f3f 3fffffff ffffffff ffdfffff efcfffdf 7fdcffff
  0020: ffff0000 56fd007f 00000010 fff30000 00007fff 00009edd 00ff0000 00000000
  0021: 2468002f 000040d4 78000000 00000000 003f0000 000001f0 003f1850 00000000
  0022: e72f9bff 10004ffa 82000328 00000c3f 03e00ffc 000001fc 0000002c 0003c000
  0023: 00010f05 00000603 00000000 00000000 00000000 3c000000 00000000 00000000
  0024: 0000ff01 0000001b 00000000 00000000 00000000 00000000 00000000 00000000
  0025: ffffffff ffffffff ffffffff ffffffff ffffffff 3fccfc03 03008c7f 00000040
  0026: 00000000 1e000000 00000007 00007e69 00000000 00000000 00000000 00000000
  0028: ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
  00fb: 80000006 5f7ffe01 0000ffdb 00000000 00000000 00000000 00000000 00000000
  00ff: 00000000 00000000 00000000 fffffffe ffffffff 00000000 00000000 20000000
(s)
  lang: "en-GB"(s)
  fontversion: 2147483647(i)(s)
  embolden: FcFalse(s)
  embeddedbitmap: FcTrue(s)
  decorative: FcFalse(s)
  render: FcTrue(s)
  maxglyphmemory: 1048576(i)(s)

Note that this query does not specify a size of 12 like I asked: it
doesn't include a size property at all. In fact, *none* of the
fontconfig queries Emacs makes specify a size of 12 except for the first
one, and that gets the family wrong:

Match Pattern has 18 elts (size 32)
  family: "DejaVu Sans Mono"(w) "DejaVu LGC Sans Mono"(w) "DejaVu LGC
  Sans Mono"(w) "Bitstream Vera Sans Mono"(w) "DejaVu Sans Mono"(w)
  "Inconsolata"(w) "Andale Mono"(w) "Courier New"(w) "Cumberland AMT"(w)
  "Luxi Mono"(w) "Nimbus Mono L"(w) "Courier"(w) "Miriam Mono"(w) "VL
  Gothic"(w) "IPAMonaGothic"(w) "IPAGothic"(w) "Sazanami Gothic"(w)
  "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "MS Gothic"(w) "UmePlus
  Gothic"(w) "NSimSun"(w) "Min gLiu"(w) "AR PL ShanHeiSun Uni"(w) "AR PL
  New Sung Mono"(w) "HanyiSong"(w) "AR PL SungtiL GB"(w) "AR PL Mingti2L
  Big5"(w) "ZYSong18030"(w) "UnBatang"(w) "UnDotum"(w) "Baekmuk
  Batang"(w) "Baekmuk Dotum"(w) "Baekmuk Gulim "(w) "TlwgTypo"(w)
  "TlwgTypist"(w) "TlwgTypewriter"(w) "TlwgMono"(w) "Hasida"(w) "Mitra
  Mono"(w) "GF Zemen Unicode"(w) "Hapax Berbère"(w) "Lohit Bengali"(w)
  "Lohit Gujarati"(w) "Lohit Hindi"(w) "Lohit Marathi"(w) "Lohit
  Maithili"(w) "Lohit Kashmiri"(w) "Lohit Konkani"(w) "Lohit Nepali"(w)
  "Lohit Sindhi"(w) "Lohit Punjabi"(w) "Lohit Tamil"(w) "Meera"(w)
  "Lohit Malayalam"(w) "Lohit Kannada"(w) "Lohit Telugu"(w) "Lohit
  Oriya"(w) "LKLUG"( w) "FreeMono"(w) "monospace"(s) "Terafik"(w)
  "monospace"(w)
  slant: 0(i)(s)
  weight: 100(i)(s)
  width: 100(i)(s)
  size: 12(f)(s)
  pixelsize: 12.5(f)(s)
  hintstyle: 3(i)(s)
  hinting: FcTrue(s)
  verticallayout: FcFalse(s)
  autohint: FcFalse(s)
  globaladvance: FcTrue(s)
  dpi: 75(f)(s)
  scale: 1(f)(s)
  charset:
  0000: 00000000 00000000 00000000 00000000 00000000 10100003 00010000 00000000
(s)
  lang: en(s)
  fontversion: 2147483647(i)(s)
  embeddedbitmap: FcTrue(s)
  decorative: FcFalse(s)

I thought at first that the family list was the result of doing some
fontconfig query with :spacing=mono, but no, Neep Alt has :spacing=mono
like you'd expect.

Several other fontconfig requests include a size, but none of those
include Neep Alt in the family list, and the sizes are utterly bizarre
and look like rounding errors, e.g. 9.99976 or 10.0291. (Full FC_DEBUG
output available on request, but it's 77Kb so I thought it best not
to send it to the whole list.)

Anyone have any idea what on earth is going on here?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]