# Font changes once Exported for Text inside a Grid

I am trying to work with Mathematica 10's new font and have found a simple way to revert the font family to Times New Roman for all my figure. I enter the following command in the Private Style Definitions, under 'Format' > 'Edit Stylesheet'.

Cell[StyleData["Graphics"],FontFamily->"Times"]


However, if a Graphics is inside a Grid, the font may look like Times in the FrontEnd of Mathematica, but it goes back to the Sans font family once exported.

myFigure=Grid[{{Show[RegionPlot[1<0,{x,0,1},{y,0,1},FrameLabel->{"Text","Text"},ImageSize->400]]}}]
Button["Export Figure",Export["C:\\Figure.pdf",myFigure];]
myFigure2=Show[RegionPlot[1<0,{x,0,1},{y,0,1},FrameLabel->{"Text","Text"},ImageSize->400]]
Button["Export Figure 2",Export["C:\\Figure 2.pdf",myFigure2];]


Any thought why? Any ideas how to get Times in my final output?

• Dıd you try GraphıcsGrıd? – Rom38 Aug 14 '14 at 15:55
• Can you try t[text_] := First@ImportString@ExportString[Style[text, FontFamily -> "Times"],"PDF"] then FrameLabel -> {t@"text", t@"text"}? Exporting figures with these labels give me twice the same text in PDF. – Öskå Aug 14 '14 at 16:34
• I'm looking for a fundamental solution, not a cheat which happens to give the same final result. – LBogaardt Aug 17 '14 at 18:09

There may be a problem with the Export function and you might need to specify the FontFamily directly in the plot. The following script may help you solve the problem of getting the exported plot in the way you want, although using a slightly different approach.

{myFigure =
Grid[{{Show[
RegionPlot[1 < 0, {x, 0, 1}, {y, 0, 1},
FrameLabel -> {"Text", "Text"}, ImageSize -> 400],
BaseStyle -> {FontFamily -> "Helvetica"}]}}]
,
Button["Export Figure",
Export[FileNameJoin[{\$HomeDirectory, "Figure.pdf"}], myFigure]]
}

• (+1) This workaround works for me under Win 7 x64. – Alexey Popkov Aug 15 '14 at 17:23
• This works for me (Win7 x64, MMA 10.0.0). – LBogaardt Aug 16 '14 at 19:33
• However, it's not a real solution to the problem, only a workaround. As noted, there may simply be a small bug in the new Mathematica. – LBogaardt Aug 17 '14 at 22:18