1

Can anyone see how to fix this text display? The example is from a larger project. I need to export the graphic at high resolution, but the text is going wrong.

text = StringTake[
   ExampleData[{"Text", "DonQuixoteIEnglish"}], {110600, 110914}];

a = Graphics[{{LightBlue, Rectangle[{0, -0.21}, {1, -0.04}]}, Inset[Graphics[{{LightYellow, Rectangle[{0, 0}, {450, 40}]}, Inset[ TextCell[text, LineSpacing -> {0, 16}, TextJustification -> 1], Center, Center, {450, 40}]}, BaseStyle -> {FontSize -> 12}, PlotRange -> {{0, 450}, {0, 40}}], {0.5, -0.155}, Center, {0.9, Automatic}]}, PlotRange -> {{0, 1}, {-0.21, -0.04}}, ImageSize -> 600]

enter image description here

Rasterize[a, ImageResolution -> 300]

enter image description here

N.B. This problem is happening on Mathematica 7. I just checked on Mathematica 9 and it works ok, but I need to run it on version 7.

Chris Degnen
  • 30,927
  • 2
  • 54
  • 108
  • in V9 Rasterize[a,ImageResolution->300] works fine (it gives the same image as your first one). – kglr Dec 05 '12 at 12:15
  • @kguler - yes, thanks, I just tried. I need it for version 7 though. – Chris Degnen Dec 05 '12 at 12:18
  • V8 works fine two. How about adding Rasterize[a, ImageResolution -> 300, ImageSize -> 600] – s.s.o Dec 05 '12 at 12:18
  • @s.s.o. That works for the example, but when used in Export["a.png", a, ImageResolution -> 300, ImageSize -> 600] my output is not high resolution. It's the same as Export["a.png", a]. Thanks though. – Chris Degnen Dec 05 '12 at 12:24
  • How about increasing the image resolution and setting image size in export rather than using default values. – s.s.o Dec 05 '12 at 12:39
  • @s.s.o - That's what I tried in my previous comment. ImageSize overrode ImageResolution. If I use a larger ImageSize such as in Export["a.png", a, ImageResolution -> 300, ImageSize -> 2600] the text appears too small. Mr.Wizard has come up with the solution. – Chris Degnen Dec 05 '12 at 14:49

1 Answers1

2

Please try:

Rasterize[Magnify[a, 1], ImageResolution -> 300]
Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
  • Could you explain why this helps/may help? Can't check for myself, as I don't have 7 installed. – Sjoerd C. de Vries Dec 05 '12 at 14:09
  • @Mr.Wizard - Very nice. Thanks. It works for the final export too, with Export["a.png", Magnify[a, 1], ImageResolution -> 300] – Chris Degnen Dec 05 '12 at 14:33
  • @Sjoerd I don't have an explanation, at least not right now. I only know that Magnify has helped in similar situations. Perhaps later I'll try to dig out why this helps, if the operations are not out of reach. Certainly magnification is entwined with ImageSize, etc. – Mr.Wizard Dec 05 '12 at 15:04