MathGroup Archive 2000

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

Search the Archive

Re: export graphic to ps---trouble with fonts

  • To: mathgroup at smc.vnet.net
  • Subject: [mg22458] Re: [mg22484] export graphic to ps---trouble with fonts
  • From: Bojan Bistrovic <bojanb at python.physics.odu.edu>
  • Date: Wed, 8 Mar 2000 02:21:55 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

> I want to export a graphic to postscript format (for Ghostview) as an
> illustration to a document written for LaTex.  My problem is the fonts in
> the legend, axes and elsewhere.  I can make them look they way I want in
> Mathematica, but in the exported I always get courier fonts.
> 
> Can I get links to Mathematica's fonts in the exported graphic, or get
> Mathematica to use LaTex fonts so that they will not change when exported?
> Other solutions?
> --
> scrog at lvcm.com
> Steven Scroggin
> 
> 
No; that's not correct. What happens is that Mathematica uses Math1, Math2,
etc. fonts in your graph. Ghostscript doesn't know how to load them so it
substitutes Courier by default. Adding the option 

DefaultFont->{"Times",12}

or 

TextStyle -> {FontFamily -> "Times", FontSize->12}

to the Plot[... ] function will change the font to 12pt  Times font, but will
still display brackets and parenthesis in Math2 font. Changing THAT isn't
that simple. What I usually do is open the file in vi-editor and change the
font manually, for example change the line

/Math2 findfont 10.000000 scalefont

to 

/Times-Roman findfont 10.000000 scalefont

or

/Helvetica findfont 10.000000 scalefont

or whatever font you want to use. Then, since Math2 font has different 
encodings you have to change the characters themselves:

(@) show 			to			([) show
(D) show			to			(]) show
(H) show			to			(\() show
(L) show			to			(\)) show

Note that parenthesis are special characters in PostScript so you have to
protect them with a backslash. Now, since you're already editing the
PostScript file, you might as well change the locations of the text if you
want. In lines like

77.312500 12.312500 moveto
(some text) show

change the numbers 77.312500 12.312500 for positioning to fit your needs.

Bye, Bojan

--
---------------------------------------------------------------------
Bojan Bistrovic,                                      bojanb at jlab.org
Old Dominion University, Norfolk VA & Jefferson Lab, Newport News, VA
---------------------------------------------------------------------


  • Prev by Date: Defining a function within a module
  • Next by Date: Re: export graphic to ps---trouble with fonts
  • Previous by thread: export graphic to ps---trouble with fonts
  • Next by thread: Re: export graphic to ps---trouble with fonts