MathGroup Archive 1992

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Font problem and Postscr

  • To: MATHGROUP at yoda.physics.unc.edu (Mathematica Discussion Group)
  • Subject: Re: Font problem and Postscr
  • From: Ross_Moore at mac-mpce-services.mpce.mq.edu.au (Ross Moore)
  • Date: Thu, 26 Nov 1992 18:23:26 +1000

        Reply to:   RE>Font problem and Postscript
Tero Siili  is having trouble with his Macintosh Front-End...

--------------------------------------
1. Mathematica printing fonts
I generate curve and surface plots with Mathematica and typically use
DefaultFont->Times.  When I print these plots using "Print selection",
the output font is Courier, not Times.  I have tried to change the font
of the Graphics style, to no avail.
--------------------------------------
The problem here is one of font names. What is called `Times` on the
Macintosh corresponds to a PostScript font called `Times-Roman`.

The following code  PRINTS correctly:

ParametricPlot[{x, x(1-x)}, {x, 0, 1}
 , DefaultFont -> "Times-Roman"
 , PlotLabel -> "inverted parabola"
]

... however it shows on-screen using the default of `Courier`, since the Mac
cannot find a font called "Times-Roman".


This is a real bug in the Mathematica Front-End.
However there is a reasonably simple fix, provided you are prepared to hack
at the resources of the Macintosh Front-End application, e.g. using ResEdit.

*** STANDARD WARNING ***  
Do what follows on a copy, and test it thoroughly before trashing your
unedited version.
Do NOT edit your original disks from WRI .
( If you do not know what ResEdit is, 
or what is meant by the resource-fork of a Macintosh file, 
then find someone with more experience who does know. )

Find the resource of type TEXT with ID = 287, named "PS header"
Scroll to the end of this resource.
Append the following PostScript code:

   /Timescheck{dup /Times eq{pop /Times-Roman}if}def
   /realfindfont{systemdict /findfont get exec}def
   /findfont{Timescheck realfindfont}def

(In PostScript, this creates a local version of the function  findfont 
which will override the system version. It simply checks the name of the
requested font, substituting  /Times-Roman  when the request was for  /Times
,  then it calls up the system version of  findfont  to do its thing. The
change is localized to Mathematica-produced graphics only.)

Close the resource, and SAVE the file. 
Close the file, quit from ResEdit.


The beauty of this solution is that, since the hack resides in the
PostScript header only, it will work with any pre-existing graphics that you
may have for which the Default Font is `Times`. 
Of course if the Notebook is copied to another Mac which does not have its
header so modified, the same printing problems will occur.
EPSF files, or PICT+Embed PS, which you produce will incorporate the
modified header, so they will be fine (e.g. see below).


Related problem ... 
-----------------------------------------
2. Mathematica/MS Word/Postscript problem
I have tried to paste Mathematica plots to MS Word 5.0.  I copy the
cell, convert it to PICT+EPS and subsequently paste to MS Word
document.  Our LW II NTX refuses to print pages containing pictures
pasted in such a way after a Postscipt error.
-----------------------------------------
My guess here is that the PostScript error was caused by failure to find a
font called  /Times  ---  same problem as above, same solution.

Using the above-given PostScript hack, both the screen-representation and
printed version come out the way they should. 
(I have implemented it and tested it on precisely your set-up.  :-) )



I seem to recall this problem having been mentioned once before; surely WRI
are aware of it. Maybe it's fixed in the latest Front-Ends ???

Regards,
Ross Moore









  • Prev by Date: Re: mma too smart to print?
  • Next by Date: time consumption FindRoot
  • Previous by thread: Re: Font problem and Postscr
  • Next by thread: Announcing CleanSlate