WARNING: New ISO10646-1 fonts in XFree86 4.1 might break GTK+ 1.2.3



ANNOUNCEMENT AND WARNING:

The classic and widely used X11 BDF bitmap font families
"-misc-fixed-*", "-adobe-*", and "-b&h-*" have been extended from
ISO8859-1 to ISO10646-1 (Unicode) to accommodate users of more languages
and mathematical symbols under X11 and to facilitate the migration
towards UTF-8. They are available on

  http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html
  http://www.cl.cam.ac.uk/~mgk25/download/ucs-fonts-75dpi100dpi.tar.gz

Most likely, XFree86 4.1 will include these "*-iso10646-1" fonts, so
they will become quickly widely installed.

Unfortunately, GTK+ 1.2.3 contained a bug that was triggered by the mere
presence of a certain Unicode font, namely

    -Adobe-Helvetica-Medium-R-Normal--12-120-75-75-P-67-ISO10646-1

In gtk/gtkstyle.c, the line

  gdk_font_load ("-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*");

simply picks the first font in the alphabet that matches the wildcard.
With the ISO10646-1 fonts present, this will be

  -Adobe-Helvetica-Medium-R-Normal--12-120-75-75-P-67-ISO10646-1

instead of

  -Adobe-Helvetica-Medium-R-Normal--12-120-75-75-P-67-ISO8859-1

Getting an ISO10646-1 font instead of an ISO8859-1 font should normally
not make a big difference to an application. The latter is just a
superset of the former, it contains in the first 256 glyph positions the
same Latin-1 characters as the old ISO8859-1 font and just consumes a
bit more memory. Almost all X clients survive the addition of an
ISO10646-1 font or even the replacement of all ISO8859-1 fonts by
ISO10646-1 fonts without any problem.

GTK+ 1.2.3 broke badly, because gdk/gdkfont.c contained several
unfortunate code pieces that tested whether a font contained any
characters > 0xff and then treated any string written out in such a font
as a (Japanese, etc.) EUC coded string of 16-bit values. So if you tried
to print 8-bit text with an ISO10646-1 font, all you saw were default
character boxes. For this reason, XFree86 delayed the introduction of
ISO10646-1 versions of the Adobe fonts by a year after I reported this
GTK+ bug in 1999-08-06 to gtk-bugs gimp org  This year is soon over.

Newer versions of GTK+ (I just looked at 1.2.9) fixed this problem by
explicitly specifying "*-iso8859-1" in the default font. So I hope
nothing too bad will happen if XFree86 4.1 adds the new fonts soon.
However there might still be numerous older GTK+ applications around for
which an update or workaround will be necessary.

You hereby have been warned!

Markus

-- 
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org,  WWW: <http://www.cl.cam.ac.uk/~mgk25/>





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