[mg22484] export graphic to ps---trouble with fonts

13 views
Skip to first unread message

Bojan Bistrovic

unread,
Mar 5, 2000, 3:00:00 AM3/5/00
to
> 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?
> --
> sc...@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, boj...@jlab.org
Old Dominion University, Norfolk VA & Jefferson Lab, Newport News, VA
---------------------------------------------------------------------


Jens-Peer Kuska

unread,
Mar 9, 2000, 3:00:00 AM3/9/00
to
Hi,

changing the brackets is much easyer. Open the Option Inspector,

Formating Options |
Font Options |
Private FontOptions |
Operator Substitution -> False

will use backets form the normal fonts. The help say

With the default setting, "OperatorSubstitution" -> True, special
characters such as {, (, or [ are replaced by the
equivalent characters in a special Mathematica font.
This allows, for example, spanning characters to
change size when the expression containing them grows larger.

With the setting "OperatorSubstitution" -> False, the above characters
are not replaced by equivalent Mathematica characters. In this case,
spanning characters cannot change size automatically.

Regards
Jens

Reply all
Reply to author
Forward
0 new messages