[R] Problems using Computer Modern fonts
Brian D'Urso
durso at hussle.harvard.edu
Fri Jun 29 16:28:08 CEST 2001
I have been trying to use the Computer Modern fonts in postscript output
from R, but I have run into a few problems and limitations. I did read and
follow the instructions in the documentation.
The first problem is that R sometimes needs to use a minus sign in the
text in plots, but the non-symbol computer modern fonts contain only a
hyphen. There is no way that I can find to tell R to use a hyphen for
labeling axis ticks with negative numbers instead of a minus. This makes
the computer modern fonts unusable in many situations.
The second problem is that I would prefer to use the computer modern
symbols as well, but R seems to have the symbol font hard coded in
devPS.c (and perhaps elsewhere). Also the computer modern symbols are
spread across many fonts.
Both of these are really the same problem: font encodings are not always
divided up the same way between fonts as AdobeStandard and AdobeSymbol, so
re-encoding the fonts the way R tries to doesn't always work. I could
think of two ways to generalize the fonts to allow full use of the
computer modern fonts:
To just fix the postscript output, afm files could be manually assembled
from several fonts so that they look like AdobeStandard or AdobeSymbol
encodings. Then if the prolog in the ps file output could be completely
customized, the many computer modern fonts could be rearranged to look
like the fonts that were given in the afm files. The hard coding of the
symbol font would of course also have to be removed, but it could be set
just like the other fonts in the ps driver.
To give a more driver independent fix, one would have to give R a list of
fonts instead of a single font for each style. Then R would look through
those fonts (via the afm files) until it found the character it was
looking for. The nice part about this is that it would eliminate the hard
coded separation of the symbols from the alphanumeric characters since any
character can be found by this procedure and it could allow for symbols of
different styles, for example bold, italic, etc to be used if the fonts
are available. The downside of this is that it almost surely requires more
changes to R.
Thank you,
Brian D'Urso
My system:
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
minor 3.0
year 2001
month 06
day 22
language R
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list