A change that Andrew sent me this morning fixed the segfault problem, and I
am now seeing antialiased fonts with PLplot for the first time!
For those of you who would like to try this for themselves on Linux, here is
the cookbook:
(1) Make sure the freetype 2 libraries and headers are installed on your
system.
(2) configure using the new --with-freetype option
(3) make
(4) cd tmp ; make x01c
(5) ./x01c -dev png -drvopt text,smooth -o test.png
These 5 steps are almost the complete extent of my testing so far.
Also, there are some caveats.
(1) There is a 180 degree orientation problem with the vertical labels
generated by x01c with -drvopt. I presume Andrew will soon be able to fix
that.
(2) familied mode introduces more segfaults in some situations. valgrind
testing in progress.
(3) The default font directory and fonts (see plfreetype.c) are hard coded
to be the correct locations if the Debian msttcorefonts package has been
installed. If your truetype fonts reside in a different directory or have
different names, then you will have to set the appropriate environment
variables (see plfreetype.c for documentation). Furthermore, even for my
situation I haven't yet found a truetype symbols font (the default is
hard-coded to use Arial instead). Anybody have advice?
Clearly, the font-finding problems should be dealt with in a slick way
before --with-freetype is considered non-experimental. One promising XFree86
package called fontconfig for finding fonts in a way that works nicely
with the freetype library has just been announced by Keith Packard. Because
of his fame and influence amongst the XFree86 community, I suspect this
package will become the standard so we may want to give it a try eventually.
Meanwhile, the environment variable approach is good enough for experimenting
with freetype.
Despite the caveats, what you can do with plfreetype is already impressive,
and I urge experimentation with trying a variety of examples with png and
jpeg and making the straightforward changes to other drivers to allow them
to use this infrastructure as well. Anti-aliased fonts just look cool!
Alan
email: ir...@be...
phone: 250-727-2902 FAX: 250-721-7715
snail-mail:
Dr. Alan W. Irwin
Department of Physics and Astronomy,
University of Victoria, P.O. Box 3055,
Victoria, British Columbia, Canada, V8W 3P6
__________________________
Linux-powered astrophysics
__________________________
|