1
$\begingroup$

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.

$\endgroup$
6
  • $\begingroup$ in V9 Rasterize[a,ImageResolution->300] works fine (it gives the same image as your first one). $\endgroup$
    – kglr
    Commented Dec 5, 2012 at 12:15
  • $\begingroup$ @kguler - yes, thanks, I just tried. I need it for version 7 though. $\endgroup$ Commented Dec 5, 2012 at 12:18
  • $\begingroup$ V8 works fine two. How about adding Rasterize[a, ImageResolution -> 300, ImageSize -> 600] $\endgroup$
    – s.s.o
    Commented Dec 5, 2012 at 12:18
  • $\begingroup$ @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. $\endgroup$ Commented Dec 5, 2012 at 12:24
  • $\begingroup$ How about increasing the image resolution and setting image size in export rather than using default values. $\endgroup$
    – s.s.o
    Commented Dec 5, 2012 at 12:39

1 Answer 1

2
$\begingroup$

Please try:

Rasterize[Magnify[a, 1], ImageResolution -> 300]
$\endgroup$
3
  • $\begingroup$ Could you explain why this helps/may help? Can't check for myself, as I don't have 7 installed. $\endgroup$ Commented Dec 5, 2012 at 14:09
  • $\begingroup$ @Mr.Wizard - Very nice. Thanks. It works for the final export too, with Export["a.png", Magnify[a, 1], ImageResolution -> 300] $\endgroup$ Commented Dec 5, 2012 at 14:33
  • $\begingroup$ @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. $\endgroup$
    – Mr.Wizard
    Commented Dec 5, 2012 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.