# Magnification, ScreenResolution, ScreenInformation and Printing: Please shine some Light into it!

According to How to set default magnification for all windows Mathematica assumes 72 dpi screen resolution. In my computer, the screen resolution actually is 120 dpi which is a very common value on recent laptops.

Since I worry about

• different appearance on the screen and on printed notebooks,
• characters on the screen being too small,
• strange things happening when editing, sometimes the cursor operates one character left of where it is displayed, which really makes headache!
• using paragraphs with a negative indent and wanting to use a tab to outdent the first word of such a paragraph

I got the idea, to set the screen resolution to 120 dpi which is very close to what my screen really has (it has 120.4 dpi, but I can't enter a decimal number here). I used OptionInspector this way:

. The original value in this place was 72. Probably It might haven been the same as executing

SetOptions[$FrontEnd, FontProperties->{"AutoSpaceWidth"->{0.221,0.439}, "FontMonospaced"->Automatic, "FontSerifed"->Automatic, "ScreenResolution"->120 } ]  (unfortunately I find nothing in the documentation what AutoSpaceWidth influences! Does anyone have an idea, what it affects? BTW: How would I just modify the setting for ScreenResolution without affecting any of the others?). Then I modified Default.nb to use Courier 10 pt for Input (bold), Output (regular) and Print (regular) and also I set all Text cells to Arial 10 pt. Now everything looks nice on the screen. But when I printed my notebook, everything came out as something like 6 points size, which also makes headache! (I printed in the working environment). Later I came across a discussion about ScreenInformation Strangely the Magnification indicated in the lower right corner and the one returned from the command differ! Is there someone who can shine some light • which of those many adjustment screws serves which purpose and • how to set them to get WYSIWYG for Input, Output, Print and Text cells? • related: (109525), (109813) – Kuba Jul 11, 2016 at 17:49 • 100% on notebook's frame seems to be something like 100% Inherited where Inherited is $FrontEnd's 125%. You can change is from popup menu and check CurrentValue[EvaluationNotebook[], Magnification].
– Kuba
Jul 11, 2016 at 17:53
• From what I understood (second link) every Image/Window/FontSize has to be considered as given in pixels - that is what happens effectively because of default fixed settings. Unless you are on OSX with retina display, there again something is hardcoded and I left that due to the lack of such screen. And unless we are talking about printing, there are no pixels ofc but I haven't done reserach if pp's, with all implications of that, are used.
– Kuba
Jul 11, 2016 at 17:58
• Also related: (64761) Jul 12, 2016 at 2:16
• I don't have the time to test this with an actual printout at the moment, but I believe that the problem comes from the "Printout" style in the Default.nb Style Sheet having a non unity Magnification value: Cell[StyleData[All, "Printout"], Magnification->0.72] Try changing the menu setting File > Print Settings > Printing Environment to Working and see if the size is now correct. Jul 12, 2016 at 2:24

The issue is that for reasons that are mysterious, Mathematica has been using an incorrect value of the ScreenResolution parameters on Windows machines since time untold. I believe this has some historical reasons, related to developers using Apple machines at some time, for which somehow the 72dpi is appropriate (noting in parentheses that this "screen resolution" is somehow virtualized, and does not necessarily correspond to the actual pixel pitch on the physical screen).

Long story short, out of hundreds of thousands of perfectly fine applications for Windows, Mathematica is pretty much the only one that is unable to correctly display fonts on Windows machines.

I have experimented a lot with this, and there's two viable solutions I have found. Let's first quickly deal with two options that will not work:

1. While it is possible to set ScreenResolution to Automatic globally, if you do that you'll be in a world of pain due to fixed-size dialog boxes and other graphical elements, with button texts being cut off, etc.
2. If you set a different Magnification globally, you will run into similar issues. In addition, the ScreenResolution issue only affects fonts, whereas a changed Magnification will change the size of everything. As a consequence, the relative size of, say, fonts in plots will be wrong.

So here are two viable kludges to work around this issue (of course, what really should happen is for Wolfram to finally get around to fix this issue...):

1. You can set the ScreenResolution parameter to Automatic for individual notebooks.
2. You can create a new StyleSheet (or modify any of your existing ones), and the use the Option Inspector to apply the ScreenResolution parameter to any or all of the Styles you want. Thus, you could have a style definition for text like so:

Cell[StyleData["Text"],
CellMargins->{{66, 10}, {7, 7}},
StyleKeyMapping->{
"Backspace" -> "Subsubsubsubsection", "Tab" -> "SmallText",
KeyEvent["Tab", Modifiers -> {Shift}] -> "Input"},
CellChangeTimes->{3.61081924778518*^9},
FontFamily->"Georgia",
FontSize->11,
FontWeight->"Plain",
FontSlant->"Plain",
FontVariations->{"StrikeThrough"->False,
"Underline"->False},
FontProperties->{"ScreenResolution"->"Automatic"}]


Note that you don't have to mess with the actual style definition; simply selecting the Style and then applying Option Inspector to the selected cell will do the trick. At this point you'll just load the Stylesheet to have the fonts appear at the correct size.

Mathematica 11 Update

Well, there really isn't an update: As I had expected, Mathematica 11 still uses an inappropriate ScreenResolution parameter on Windows machines, just as all versions before it. Why Wolfram doesn't care to fix this is beyond me. They advertise that wonderful new Consolas font they introduced for Input cells, but of course, on Windows machines this, just like all other fonts, is displayed at a size that is too small by a factor of 72/96. The good news is that the fixes discussed above still work, of course.

As an aside, it would also be great if I could even just get a decent selection window (the one that comes up after all notebooks have been closed) on my Windows machine. What I get now (and have been getting for the last couple of versions) looks like this:

I'm left to wonder what that stuff on the bottom right corner might be. There's a checkbox there, too. No idea what it might do...

For completeness, here is what I get when following Karsten's suggestion and using Append[ColumnSpacings -> 5]@newClosingDialog[[1, 3, 1, 1, 1, 1]];

Clearly, I need to find a way to increase the window width, but I don't know how to do that.

Solution

I apologize, rather than putting this in my comment, I should have added it to my post. I fixed the issue with the width of the closing dialog window as follows: There's an expression saying WindowSize -> {500, All}, near the end of the notebook expression obtained following Karsten's hint, where I changed the 500 to 550. Now I have a window size that works, and all is well. Thanks again!

• Welcome to Mathematica.SE! I suggest the following: 1) Take the tour! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Finally, 3) if you ask a question, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! Jul 13, 2016 at 23:17
• This issue was discussed also here Fix incorrect DPI setting for rendering fonts in Mathematica ? Jul 14, 2016 at 0:32
• This has also been adressed in Heike's answer here.
– gwr
Jul 14, 2016 at 9:30
• Kuba, would it be viable to add in Default.nb to all style which I actually use the option FontProperties->{"ScreenResolution"->"Automatic"}? First you gave a warning about dialog boxes being affected: does this happen, if Default.nb is modified and Core.nb is left unchanged? Which one only affects everything after I start typing into Mma but not Mma itself? Jul 15, 2016 at 15:40
• If you want to change the look of the closing dialog and make it more useful, check this Q&A. I posted a screen shot of a cleaned up dark theme version in chat yesterday. That check box is the same as the last one in Preferences►Interface (Always exit after closing last window). Aug 10, 2016 at 18:54