From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Wells Newsgroups: gmane.emacs.devel Subject: can't use Emacs with new free STIX fonts Date: Sun, 02 Dec 2007 05:50:58 +0000 Message-ID: <86wsrxablp.fsf@macs.hw.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1196574675 24999 80.91.229.12 (2 Dec 2007 05:51:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2007 05:51:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 02 06:51:23 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Iyhje-0003St-PF for ged-emacs-devel@m.gmane.org; Sun, 02 Dec 2007 06:51:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyhjO-0004tw-27 for ged-emacs-devel@m.gmane.org; Sun, 02 Dec 2007 00:51:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IyhjK-0004te-6N for emacs-devel@gnu.org; Sun, 02 Dec 2007 00:51:02 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IyhjI-0004s3-Oq for emacs-devel@gnu.org; Sun, 02 Dec 2007 00:51:01 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyhjI-0004rc-HL for emacs-devel@gnu.org; Sun, 02 Dec 2007 00:51:00 -0500 Original-Received: from izanami.macs.hw.ac.uk ([137.195.13.6]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IyhjH-0001Dv-Pq for emacs-devel@gnu.org; Sun, 02 Dec 2007 00:51:00 -0500 Original-Received: from lxultra1.macs.hw.ac.uk ([137.195.27.173]:39936 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1IyhjC-0004dT-MP for emacs-devel@gnu.org; Sun, 02 Dec 2007 05:50:54 +0000 Original-Received: (nullmailer pid 22522 invoked by uid 1001); Sun, 02 Dec 2007 05:50:58 -0000 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84473 Archived-At: Dear Emacs gurus, You may be aware that the STIX Fonts Project recently released a beta test version of the STIX fonts. These fonts contain a large set of glyphs for scientific and technical characters. As far as I am aware, these fonts are the only _free_ (as in non-proprietary) source for glyphs in a modern Unicode font for most of these characters. Naturally, it would be nice to be able to use these fonts with Emacs. Currently the only other option is slaveware fonts (for example, Code 2000, Everson Mono Unicode, and Bitstream Cyberbit), and it would be very nice to have a free font option in Emacs. Unfortunately, the STIX fonts do not seem to work with the many X Window System applications like Emacs that use the old X =E2=80=9Ccore font= s=E2=80=9D method. At least I have not been able to get them to work. Some of you are probably well aware that there are two main methods for accessing fonts in X Window System applications: =E2=80=9CX includes two font systems: the original core X11 fonts system, which is present in all implementations of X11, and the Xft fonts system, ...=E2=80=9D Usually, the same font files can be accessed via both methods. However, some modern fonts do not work with the old core fonts mechanism. The old core fonts mechanism is regarded by developers as a legacy method and some developers refuse to fix bugs that are related to the old core fonts mechanism. So there seem to be two possibilities: #1: Someone can figure out how to make the STIX fonts work with the old core fonts mechanism. #2: Emacs can be upgraded to work with the Xft mechanism. I know there is ongoing work toward #2, but if I understand correctly this is not scheduled for the next Emacs release. Below I include the details of what I did to try to get the STIX fonts to work via the core fonts mechanism, in case anyone else wants to try #1. Can anyone help? Joe ---------------------------------------------------------------------- P.S. Here is what I did to try to install and use the fonts with Emacs. First, you have to get the font files. I refuse to get them from the main STIX web site because they (absurdly) require the downloader to supply their e-mail address. The license is free so it is no problem to get the fonts from elsewhere. Here is one place you can get the fonts (this one RPM contains 4 of the font files and is enough for testing purposes): mkdir ~/.fonts/stixfonts cd ~/.fonts/stixfonts wget http://koji.fedoraproject.org/packages/stix-fonts/0.9/6.fc9/noarch/s= tix-fonts-0.9-6.fc9.noarch.rpm Then unpack the RPM to get the file STIXGeneral.otf (you can get the others if you like, but one is enough for testing): rpm2cpio stix-fonts-0.9-6.fc9.noarch.rpm | cpio --extract --make-director= ies ./usr/share/fonts/stix/STIXGeneral.otf rm stix-fonts-0.9-6.fc9.noarch.rpm mv usr/share/fonts/stix/STIXGeneral.otf . rm -r usr Then make the font accessible to X via the =E2=80=9Ccore fonts=E2=80=9D mec= hanism: mkfontscale mkfontdir xset fp+ ~/.fonts/stixfonts (must execute this in every X session) This is the ordinary way of installing fonts for the core fonts method. (Note that this method also happens to simultaneously install the fonts for the Xft method on many systems, because by default on many systems all directories inside ~/.fonts are included for the Xft method.) After installing the fonts, I tried to use them: xterm -fn '*-stixgeneral-medium-r-normal-*' I got this error message: xterm: unable to open font "*-stixgeneral-medium-r-normal-*", trying "fi= xed".... I tried to view the font with a font viewer program: xfd -fn '*-stixgeneral-medium-r-normal-*' I got this error message: Warning: Cannot convert string "*-stixgeneral-medium-r-normal-*" to type = FontStruct I also tried in Emacs but I will not bother to report the details of the failure, as there is no simple error message. To try to debug what is happening, I used strace: ( sleep 1 ; xfd -fn '*-stixgeneral-medium-r-normal-*' & ) ; sudo strace -= o /tmp/X.strace -s 10000 -p `pidof X` This revealed the following system calls occur in the X server: read(47, "7\0\10\0\32\0\0\5D\0\0\0\f@\1\0\20\20\20\0\347\353\357\0\27\0\0= \5\0\0\0\0005\30\4\0\33\0\0\5D\0\0\0\2\0\2\00077\6\0\34\0\0\5\33\0\0\5\f\0\= 0\0\20\20\20\0\347\353\357\0H\0\10\0\33\0\0\5\34\0\0\5\2\0\2\0\0\0\0\0\0\1\= 0\0\2\0\0\0\1\0\0\0<\0\2\0\34\0\0\0057\0\n\0\35\0\0\5D\0\0\0\fE\1\0\20\20\2= 0\0\347\353\357\0\1\0\0\0\33\0\0\5\27\0\0\5\0\0\0\0007\0\t\0\36\0\0\5D\0\0\= 0\\@\0\0\20\20\20\0\347\353\357\0\2\0\0\0\3\0\0\0\27\0\0\0057\0\t\0\37\0\0\= 5D\0\0\0\\@\0\0\347\353\357\0\20\20\20\0\2\0\0\0\3\0\0\0\27\0\0\5-\0\v\0 \0= \0\5\37\0\0\0*-stixgeneral-medium-r-normal-*\0\227\1\3\0 \0\0\5\1\0\0\0", 4= 096) =3D 280 open("/home/jbw/.fonts/stixfonts/STIXGeneral.otf", O_RDONLY) =3D 48 fcntl64(48, F_SETFD, FD_CLOEXEC) =3D 0 fstat64(48, {st_mode=3DS_IFREG|0644, st_size=3D273424, ...}) =3D 0 mmap2(NULL, 273424, PROT_READ, MAP_PRIVATE, 48, 0) =3D 0xa2de7000 close(48) =3D 0 munmap(0xa2de7000, 273424) =3D 0 This indicates that the X server gets the font request, correctly figures out that it needs to get the font from the file STIXGeneral.otf, maps that file into memory, (presumably) inspects the font data, and then unmaps the font file. This is all the debugging information I have been able to obtain so far. Despite turning debugging up to level 11 (the highest debugging messages from the X server are at level 10), no interesting messages show up in the X server's log file. So I don't know what is going wrong. I don't know whether the X server doesn't like the font file, or whether the problem is elsewhere. The X server has no problem using other OTF font files as core fonts (this feature is provided by the loadable module /usr/lib/xorg/modules/fonts/libfreetype.so), so I know the problem is not missing support. Further progress on this problem seems likely to require running the X server under the debugger to find out what is going wrong.