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: [mg22464] Re: export graphic to ps---trouble with fonts
  • From: "P.J. Hinton" <paulh at wolfram.com>
  • Date: Wed, 8 Mar 2000 02:22:02 -0500 (EST)
  • Organization: "Wolfram Research, Inc."
  • References: <89qgui$akb@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 4 Mar 2000, Steven Scroggin wrote:

> 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?

The answer depends on the method you're using for the export as well as
what kinds of fonts are used to draw the glyphs.

If you are using Display[] or Export[] (with a standalone kernel), then
conversion of the Mathematica PostScript version of the graphic to EPS is
handled by an external program called psrender.  psrender can format the
text only if you are using Type 1 fonts in ASCII format (.pfa).  To make
psrender aware of the Type 1 fonts, you need to build a PostScript
resource catalog file (PSres.upr) in the directory where the fonts reside.
The tool for building these catalogs is makepsres.  After the catalog file
is built, you need to add the path to the fonts to a kernel session
variable within your kernel init.m file:

AppendTo[System`Dump`$FontPath, <string with path to new font directory>]

If you are using Export[] (with a front end present) or using the front
end menu command Edit -> Save Selection As -> EPS, the PostScript should
contain references to the appropriate fonts.  The only exeception may be
under X Window, wherein the front end must have access to the Adobe Font
Metric (AFM) files for the specific font family.  Check with the font
foundry who created the font to see if an AFM file is available.

Regardless of what route you take, the EPS files created will not contain
the actual code needed to render the font glyphs.  You will need to
configure your printer or Ghostscript to access the appropriate fonts
before rendering.

-- 
P.J. Hinton
Mathematica Programming Group           paulh at wolfram.com
Wolfram Research, Inc.
Disclaimer: Opinions expressed herein are those of the author alone.



  • Prev by Date: Re: export graphic to ps---trouble with fonts
  • Next by Date: Re: string-variable-Set-snarl
  • Previous by thread: Re: export graphic to ps---trouble with fonts
  • Next by thread: Re: Re: export graphic to ps---trouble with fonts