MathGroup Archive 2001

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

Search the Archive

Re: fonts

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31209] Re: fonts
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 19 Oct 2001 03:11:59 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <9qjjdu$j7s$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

it had probably nothing to do with the Frontend
because the frontend knows the system fonts.
The kernel prepare the graphics but it does not
look for the fonts. Here is the
(not perfect) hard way to change the
font 

SetAttributes[ShowFontReplace, HoldFirst]

ShowFontReplace[gr_, oldfnt_String, newfnt_String] := Module[{gg, gstr},
    Block[{$DisplayFunction = Identity},
      gg = gr
      ];
    gstr = StringReplace[DisplayString[gg, "MPS"], oldfnt -> newfnt];
    NotebookWrite[SelectedNotebook[], 
      Cell[GraphicsData["PostScript", gstr, "Graphics"]]];
    gg
    ]


And ...

ShowFontReplace[
  Plot[Sin[x], {x, 0, Pi}, 
    FrameLabel -> {x, Sin[x], "A plot of sin(x)", ""}],
  "/Courier", "/Honesty"]

will be shown in the frontend *with* the correct
font.

Regards
  Jens



Bernd Brandt wrote:
> 
> Dear group,
> 
> On our Solaris system i have a 'font problem'.
> Mathematica contains Helvetica, Courier, Times. If i do
> 
> Plot[x, {x, 0, 10}, TextStyle -> {FontFamily -> "Palatino"}]
> The Font in FullForm is Palatino, but the graph is rendered with Times.
> As a results also the Exported EPS has Times-Roman instead of Palatino Roman.
> 
> On Solaris (8 SunOS 5.8) however Palatino, Bookman etc are present.
> Also ghostview is able to display EPS files with these fonts.
> Somehow Mathematica is unable to access these fonts, although it looks like the are loaded in $OPENWINHOME/lib/openwin-sys, and gv displays them.
> 
> How should i tell mathematica to use these fonts?
> I tred
> xset fp+ /usr/openwin/lib/X11/fonts/Type1/
> xset fp+ /usr/openwin/lib/X11/fonts/TrueType/
> 
> The fonts.alias file in TrueType/ contains
> palatino-roman  "-monotype-book antiqua-regular-r---0-0-0-0-p-0-iso8859-1"
> 
> and the fonts.dir file in TrueType/ contains Arial, Bookman.
> xset -q indeed reports all these fontpaths (they are always loaded).
> 
> However with xset the Plots are still rendered with Times instead of
> Palatino, Bookman etc.
> 
> How should I tell mathematica (4.0.2) to also look in the X fontpaths?
> 
> Kind regards,
> Bernd


  • Prev by Date: Re: Laveling solution in package. Problems with context
  • Next by Date: Re: Solve bug !!
  • Previous by thread: Re: fonts
  • Next by thread: Carriage Return oddity in Mathematica