Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Forcing Mathematica to use standard fonts

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111344] Re: Forcing Mathematica to use standard fonts
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Wed, 28 Jul 2010 02:54:41 -0400 (EDT)

If what you're exporting is really text with no embedded math, then you can use
TextCell...

Graphics[{Style[
   Text[TextCell["The (quick+brown) fox == the lazy-dog"], {0, 0}],
   FontFamily -> "Times"]}]

This will also fix various other things like the line-wrapping behavior to be
more appropriate for straight text.

If you have embedded math, but still don't want to use the Mathematica fonts,
you can use the "OperatorSubstitution" option, which I've mentioned a few times
before in this group:

Graphics[{Style[Text["The (quick+brown) fox == the lazy-dog", {0, 0}],
   FontFamily -> "Times",
   PrivateFontOptions -> {"OperatorSubstitution" -> False}]}]

In both cases, Mathematica fonts will still be used for things like Greek
characters and special mathematical symbols, but they won't be used for routine
operators such as (){}[]#+==-*/, which I think is what you're mainly interested
in.

Sincerely,

John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.


On Tue, 27 Jul 2010 07:53:00 -0400 (EDT), Greg Egan wrote:
> Suppose I embed some text in a graphic using:
>
> Style[
> Text["The (quick+brown) fox == the lazy-dog", coords],
> FontFamily->"Times"]
>
> If I export this graphic (e.g. to PDF or SVG), Mathematica will put
> most of the text in Times, but the characters "(+)==-" will all be in
> special Mathematica fonts, generally with their own special encodings.
>
> I appreciate that Mathematica has good reasons for substituting its
> own fonts when it typesets mathematical expressions, but in some
> situations I'd like to be able to create output that uses only
> standard fonts.
>
> Is there any way to force Mathematica to stop this character-by-
> character font-substitution, and output all characters unchanged in a
> single, specified font?  There's a tantalising claim in the
> documentation (tutorial/TextAndFontOptions):
>
> "For a given text font, Mathematica tries to choose the special
> character font that matches it best. You can help Mathematica to make
> this choice by giving rules for "FontSerifed" and "FontMonospaced" in
> the setting for the FontProperties option. You can also give rules for
> "FontEncoding" to specify explicitly from what font each character is
> to be taken."
>
> ... but there's no proper documentation of this feature, if it even
> still exists in v7; the documentation for FontProperties warns that
> "This function has not been fully integrated into the long-term
> Mathematica system, and is subject to change."
>
> Thanks for any help people can offer.



  • Prev by Date: Re: Disable save in player pro
  • Next by Date: Re: Problems compiling addrow with gcc-mingw (windows).
  • Previous by thread: Re: Forcing Mathematica to use standard fonts
  • Next by thread: Re: Forcing Mathematica to use standard fonts