X-Symbol on Mac OS X, natively
There are at least two nice native ports of GNU Emacs for Mac OS X:
Aqua Emacs and
Carbon Emacs.
These work well with Proof General except for the lack of support
for X-Symbol. The problem is that X-Symbol contains some custom
fonts which were built for the X font server machinery, in
bdf
format.
These fonts contain mathematical symbols, derived from
TeX fonts set
at different sizes and at a fixed width.
It would be good if these fonts could be made available in a format
understood by Mac OS X, and then in turn used inside a native Emacs
port. It looks as if nobody has done this yet, so I gave it a try.
Unfortunately I wasn't completely successful, but someone with
a bit more determination could probably finish things off.
One of the main problems is working around pecularities of font formats
and encodings to get the fonts understood both by Mac OS X and by
Carbon Emacs (whose font support is still in development).
There are three basic ways to go: most basic to the eventual
best, which is to use Unicode fonts instead of the old X-Symbol
ones. This would then also work with the
xft Emacs on Linux:
http://www.emacswiki.org/cgi-bin/wiki/XftGnuEmacs
Bitmap conversion: embed bdf files into a format understood by Font Book
First attempt was with ufond (part of fondu package):
= cd
ProofGeneral /x-symbol/etc/fonts=
= ufond -dfont xsymb0*.bdf =
This produces a file
XSymb0.fam.dfont
which gets silently ignored by Fontbook.
It's possibly re-encoded into Mac Latin as well, but this can maybe be stopped by setting the
script code:
= ufond -dfont -script 32 xsymb0*.bdf =
The file can be loaded into
*fontforge*
and saved again from there in different formats (also experimenting with encodings).
The aim is to get a result where Emacs recognises the font in its current hacky
XFLD-emulating way:
= (x-list-fonts "-apple-xsymb0-*") =
Should return a list of fonts at the available pixel sizes and with a useful encoding.
I'm not sure that the (default?) UCS encoding
iso10646 is useful. The reason seems
to be (I'm guessing) is that Emacs gets scared if a character set doesn't seem to contain
any ASCII characters, so when making a fontset it searches for a nearby font with
ASCII characters and adds them to the fontset. I managed to get further
with an incantation like this:
(create-fontset-from-fontset-spec
"-apple-xsymb0-medium-r-normal--14-*-*-*-*-*-fontset-xsymb0,
ascii:-apple-xsymb0-medium-r-normal--14-*-*-*-*-*-iso10646-1,
latin-iso8859-1:-apple-xsymb0-medium-r-normal--14-*-*-*-*-*-iso10646-1")