Juliusz,
I'm finding this bug a real stumper. I don't even really know where to
begin in establishing whether this is user error or not, or if not what
part of the X server is broken. Can you help, please?
Anyone else from debian-x who'd like to pitch in, please do.
----- Forwarded message from Massimo Dal Zotto <dz@cs.unitn.it> -----
From: Massimo Dal Zotto <dz@cs.unitn.it>
To: submit@bugs.debian.org
Subject: Bug#156115: xserver generates bogus fontnames for scalable fonts
Date: Fri, 9 Aug 2002 23:33:10 +0200 (MEST)
Message-Id: <200208092133.g79LXAfN008256@dizzy.dz.net>
X-Spam-Status: No, hits=-5.0 required=4.0
tests=SENT_BY_BTS,FORGED_RCVD_FOUND
version=2.31
Package: xserver-xfree86
Version: 4.1.0-16
I found a problem with Xserver, Type1 fonts, gsfonts-x11 and Tk on woody.
When the xserver has Type1 fonts in the fontpath and package gsfonts-x11
is installed the default Tk button font {Helvetica -12 bold} looks ugly:
After some debugging I have found a strange behavior of the Xserver which
seems causing the Tk problem. The bug happens only when all the following
conditions are met:
- the X server (4.1.0) is running at 75 dpi
- the Type1 module is loaded in the X server
- the directory /usr/lib/X11/fonts/Type1 is at the end of X fontpath
- package gsfonts-x11 is installed
- Tk is searching a font {Helvetica -12 bold}, the default for buttons
The bug can be reproduced with the following commands:
### Install the required packages
# apt-get install xserver-xfree86 gsfonts-x11 tk8.3
### Start the X server at 75dpi
$ startx -- :1 -dpi 75
### Set the X fontpath. Don't use a font server
$ xset fp /usr/X11R6/lib/X11/fonts/misc/:unscaled,/usr/X11R6/lib/X11/fonts/75dpi/:unscaled,/usr/X11R6/lib/X11/fonts/100dpi/:unscaled,/usr/lib/X11/fonts/Type1
$ xset fp rehash
### List fonts, if some have 12-120-75-75-p-0 we have the problem
$ xlsfonts -fn "-*-helvet*-*-*-*-*-*-*-*-*-*-*-iso8859-1" | grep p-0-iso8859-1
...
-adobe-helvetica-bold-r-normal--12-120-75-75-p-0-iso8859-1
### Run this Tk script
$ echo "pack [button .b -font {Helvetica -12 bold} -text abcde12345]" | wish
On my woody sytem the button text looks very ugly, in particular the "2" has
a small dot under the baseline and all the font is generally very bad.
If I remove /usr/lib/X11/fonts/Type1 from the fontpath or deinstall the
package gsfont-x11, which install the font used by Tk, the text is ok:
$ xset fp- /usr/lib/X11/fonts/Type1
$ xset fp rehash
$ echo "pack [button .b -font {Helvetica -12 bold} -text abcde12345]" | wish
The following packages and fonts are installed on my system:
$ dpkg -l xserver* gsfonts-x11 tk8.3 | grep ^i
ii xserver-common 4.1.0-16 files and utilities common to all X servers
ii xserver-xfree86 4.1.0-16 the XFree86 X server
ii gsfonts-x11 0.16 Make Ghostscript fonts available to X11.
ii tk8.3 8.3.3-8 The Tk toolkit for TCL and X11 v8.3 - Run-Time Files.
$ DISPLAY= dpkg-www /usr/X11R6/lib/X11/fonts
Packages owning /usr/X11R6/lib/X11/fonts:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-========================-==========-=================================================
ii xfonts-75dpi-transcoded 4.1.0-16 75 dpi fonts for X (transcoded from ISO 10646-1)
ii xfonts-pex 4.1.0-16 fonts for minimal PEX support in X
ii xfonts-75dpi 4.1.0-16 75 dpi fonts for X
ii xfonts-100dpi-transcoded 4.1.0-16 100 dpi fonts for X (transcoded from ISO 10646-1)
ii xfonts-base 4.1.0-16 standard fonts for X
ii gtk-engines-xenophilia 0.7-6 Customizable GTK+ engine with a plain look
ii xvgafont 1.2 Vga fonts for X11 in iso-8859-1 encoding.
ii ttfonts-ms 1.0 TrueType fonts from M$
ii gsfonts-x11 0.16 Make Ghostscript fonts available to X11.
ii xfonts-100dpi 4.1.0-16 100 dpi fonts for X
ii xfonts-scalable 4.1.0-16 scalable fonts for X
I have the Type1 module loaded in the server and the following fontpath:
FontPath "/usr/X11R6/lib/X11/fonts/misc/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/TrueType/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
What seems strange to me is that sometimes the xserver lists fontnames
which should not exist:
$ xlsfonts | grep "helvetica-.*-iso8859-1$" | tee a | wc -l
58
$ xlsfonts -fn "-*-helvetica-*-*-*-*-*-*-*-*-*-*-iso8859-1" | tee b | wc -l
68
$ diff a b | grep '^>'
> -adobe-helvetica-bold-i-normal--12-120-75-75-p-0-iso8859-1
> -adobe-helvetica-bold-o-narrow--12-120-75-75-p-0-iso8859-1
> -adobe-helvetica-bold-o-normal--12-120-75-75-p-0-iso8859-1
> -adobe-helvetica-bold-r-narrow--12-120-75-75-p-0-iso8859-1
> -adobe-helvetica-bold-r-normal--12-120-75-75-p-0-iso8859-1
> -adobe-helvetica-medium-i-normal--12-120-75-75-p-0-iso8859-1
> -adobe-helvetica-medium-o-narrow--12-120-75-75-p-0-iso8859-1
> -adobe-helvetica-medium-o-normal--12-120-75-75-p-0-iso8859-1
> -adobe-helvetica-medium-r-narrow--12-120-75-75-p-0-iso8859-1
> -adobe-helvetica-medium-r-normal--12-120-75-75-p-0-iso8859-1
$ xlsfonts -l | grep "helvetica-.*-iso8859-1$" | tee c | wc -l
58
$ xlsfonts -l -fn "-*-helvetica-*-*-*-*-*-*-*-*-*-*-iso8859-1" | grep -v NAME | tee d | wc -l
58
Note that option -l of xlsfonts doesn't show the bogus fonts. Why?
$ xset fp- /usr/X11R6/lib/X11/fonts/Type1/; xset fp rehash
$ xlsfonts | grep "helvetica-.*-iso8859-1$" | tee e | wc -l
48
$ xlsfonts -fn "-*-helvetica-*-*-*-*-*-*-*-*-*-*-iso8859-1" | tee f | wc -l
48
It seems that when gsfonts-x11 is installed and Type1 fonts are added to
the fontpath the xserver returns some extra font names with pixelSize=12
and avgWidth=0. In the examples I have considered only helvetica iso8859-1
fonts, but there are many other.
Note that normally the fonts with avgWidth=0 are only scalable fonts with
pixelSize=0. Why are these bogus font names returned by the xserver?
It seems also that pixelSize=12 is related to the fact that the X server is
running at 75dpi. If you run the server at 100dpi you will get fonts with
pixelSize=17.
The problem with Tk is that when searching for an {Helvetica -12 bold} font
it finds a bogus fixed font name which matches exactly what is required but
is actually a scalable postscript font which looks very ugly on the display.
The problem doesn't happen if the server runs at 100dpi because the bogus
fontnames with pixelSize=17 are ignored by Tk which is looking for 12pixels
fonts.
--
Massimo Dal Zotto
----- End forwarded message -----
--
G. Branden Robinson |
Debian GNU/Linux | De minimis non curat lex.
branden@debian.org |
http://people.debian.org/~branden/ |
Attachment:
pgp932_t5xDnD.pgp
Description: PGP signature