# Frame with round corners does not look the same in Working and Printout environments

I want to generate some graphics that contain framed texts with rounded corners that display correctly in the Working and PrintOut environment. For example,

Graphics[{Inset@Framed[Text[Foobar], RoundingRadius -> 15]}]


generates the first of the following two boxes in a notebook, which is what I want.

However, when I export my notebook to pdf or print it then the frame will look like the second box in the picture, which I do not want. I can fix the second box by using a smaller RoundingRadius but then the box looks almost like a rectangular frame in my notebook.

How can I get a frame with rounded corners that looks like the first example the Working and PrintOut environment?

(I do not want to use the Working environment when printing because then font sizes and such will also change.)

• I am running V10.3.1 on OS X. I can not reproduce your problem. The framed text looks the same in both the Working environment, the Printout environment and in saved PDF document. BTW, you have not need to use Inset. Graphics[Text[Framed[Foobar, RoundingRadius -> 15]]] will give the same image as the one you post in your question. – m_goldberg Jan 18 '16 at 16:36
• I can confirm what @m_goldberg found on Mac. Just a guess: does it help if you set the ImageSize to a fixed value? Or perhaps try SetOptions[EvaluationNotebook[], WindowSize -> All] - these guesses are based on the hunch that the rounding radius (and/or thickness) is referenced to a different external length scale (outside the plot). In any case, it looks like a bug on Windows. – Jens Jan 18 '16 at 20:51
• Thanks for the help. Setting ImageSize->{72} did not help and neither did changing the WindowSize. Also, I am using Mathematica 10.2.0.0 and Win10. – Berg Jan 18 '16 at 21:54
• By the way, using Text@Framed is not identical to Inset@Framed@Text. Different (default) fonts are used. (But your suggestion seems better.) – Berg Jan 18 '16 at 21:57

As m_goldberg and Jens could not reproduce the problem on Mathematica 10.3.1 I updated my Mathematica and it turns out that the behavior of Mathematica depends on the version.

Graphics[Text[Framed[Foobar, RoundingRadius -> 7]]]


yields the following. From left to right: V10.2 Notebook, V10.2 PrintOut, V10.3.1 Notebook, V10.3.1 Printout

So the problem still exists in V10.3.1 but it is not nearly as pronounced.

It seems that the problem originates from a buggy implementation of the Magnification in Mathematica. (Someone not using a 4K-display would perhabs not notice it.) The line width of the frame scales faster with Magnification then the fonts. The same framed text at Magnification->5 looks like the following in V10.3.1:

This is even worse in V10.2: Left Magnification 1 and right 5, scaled to the same size (in gimp).

(The Magnification in the 4 samples above is 2.)

• (+1) A workaround is to set AbsoluteThickness for the FrameStyle (the default setting seems to be the relative Thickness): Graphics[Text[Framed[Foobar, RoundingRadius -> 7, FrameStyle -> AbsoluteThickness[1]]]]. – Alexey Popkov Jan 19 '16 at 20:42
• Very helpful, thanks. – Berg Jan 19 '16 at 23:09