[Rd] Postscript font bugs (and a suggestion) (PR#914)
Prof Brian D Ripley
Sat, 14 Apr 2001 07:33:13 +0100 (BST)
On Sat, 14 Apr 2001 email@example.com wrote:
> Documentation and other bugs with postscript():
> 1. This code crashes R (it asks for a font that isn't there):
Only on Windows, I think. This works fine on Unix.
> The bug appears to be in the FixupFont routine in plot.c; on line 236,
> it checks that the font number is in the range 1..32. Later this
(1..32 on Windows, 1..4 elsewhere.)
> crashes PostScriptStringWidth in devPS.c, because only fonts numbered
> 1..5 are actually defined. I don't know how to fix it.
I've added a range check in PS_StrWidth.
> 2. The ?postscript help topic refers to .ps.profile; the actual
> variable name is .ps.prolog. The C source in main/devPS.c has this
> on lines 606-608, with the incorrect name in the error message:
> prolog = findVar(install(".ps.prolog"), R_GlobalEnv);
> error("Object .ps.profile is not a character vector");
> 3. And this is a suggestion, not a bug: I'd like to change the font
> definitions by changing the .ps.prolog instructions, but devPS.c puts
> PSEncodeFont(fp, encoding);
> line after the place where .ps.prolog is written to the file. If
> .ps.prolog were last, then it could override any standard setting.
> This would mean that the font metrics would not be quite right, but it
> would be useful for experimenting.
Why not use the way which is supported, to supply a user-specifed family?
For experimenting the easiest way surely is to edit the postscript file.
Brian D. Ripley, firstname.lastname@example.org
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
r-devel 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: email@example.com