From: Alan W. I. <ir...@be...> - 2004-05-18 01:35:40
|
On 2004-05-16 10:14-0700 Alan W. Irwin wrote: > For the -dev png plots I am preparing for publication, I have been > attempting to use the TrueType fonts that are available with the png device > and the -drvopt text,smooth option. Normal characters that are on the line, > superscripted, or subscripted in either 2D and 3D plots seems to work. The > only trouble I am having is with special symbols and Greek letters. With private help from Andrew (Roach) I think my current publication needs are taken care of with some clumsy, but effective workarounds. On the dark side, there seems to be a current limitation that only the first 156 characters of any freetype font are accessible. My own feeling is that is unlikely to be a libfreetype issue since that library is heavily used by a lot of users. But Andrew is having trouble finding any place in the PLplot code where that limit is imposed. Off-hand does anybody know a place in our code where decimal 100 is added to the font index then effectively subtracted later? That would overflow an unsigned character and cause the symptoms we are seeing. On the bright side, I have been discovering a whole bunch of font options PLplot -dev png -drvopt text,smooth,24bit users have access to. For example, there are the bluesky computer modern fonts postscript type 1 format. We discussed those previously with regard to making nice-looking documentation, but it turns out they are useful for our plots as well. Those fonts appear in the /usr/share/texmf/fonts/type1/bluesky/ tree on my system, and are in the Debian package called tetex-extra, and they work fine with libfreetype (aside from the first 156 character issue). The only problem is they are split between a large number of files and switching between font files is currently rather clumsy because you have to set the PLPLOT_SYMBOL_FONT environment variable each time. (ToDo, use a modern font configuration system such as Keith Packard's fontconfig that is available with X and which serves as a user-friendly front-end for libfreetype.) Anyhow, despite much sampling of fonts I haven't yet found the symbol and Greek character font files I need yet in the bluesky tree. I know the symbols I need must be somewhere there since computer modern fonts are extraordinarily comprehensive and satisfy almost all Math needs. Perhaps what I need is hidden from me by the current limit of the first 156 characters. Another possibility that is accessible using libfreetype is truetype (as opposed to the bluesky postscript type 1) computer modern fonts. I got these from http://www.mozilla.org/projects/mathml/fonts/bakoma/texcm-ttf.zip. as recommended by http://www.mozilla.org/projects/mathml/fonts/. They are licensed for free distribution (see http://www.mozilla.org/projects/mathml/fonts/bakoma/license.txt) so long as you don't redistribute them for money yourself. Anyhow, they seem better organized (from the perspective of our current method of accessing fonts using PLPLOT_SYMBOL_FONT), and with fewer blank characters in the first 156. So the cmsy10.ttf file, for example has a gradient symbol while the corresponding bluesky /usr/share/texmf/fonts/type1/bluesky/cm/cmsy10.pfb font file seems to have a blank in the same location. I have yet to find a freely accessible font file with Greek characters in the first 156 locations, but for my immediate publication needs Andrew has given me such a font file privately that does that. So I can work around all the current freetype problems for my next two publications, and therefore my immediate needs are taken care of. To summarize my recent experience, Hershey fonts are not acceptable for the png device because they look pretty awful for that inherently low-resolution device (typically 800x600 pixels). So that is why libfreetype support for -dev png is so important. My recent experience with that shows there is tremendous potential there for -dev png users (and in fact users of any device once the required simple code changes are made for each device driver) since there are so many excellent free fonts that are available via libfreetype. Nevertheless, there is also scope for improvement in the way the libfreetype fonts are organized for PLplot (see ToDo item above), and we also have to find and fix the current 156 character limit bug. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the PLplot scientific plotting software package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |