25
$\begingroup$

I have this annoyance for a long time now: every Text cell uses the default font size, though it appears too small on my screen. See comparison of same text, same font (Times New Roman), same fontsize (12), same magnification (100%) on Word 2003 (left) and Mathematica 8.0.1 (right). The Screen Environment menu option is set to Working, though none of the other environments gives the proper visual size: some are even smaller (very hard to read), and e.g. Presentation gives enormous letters. I thought that a given fontsize should produce the same look-and-feel, though this is definitely not the case here. Of course I can set the fontsize larger in Mathematica, but then the problem manifests when I print the notebook (text will be too large).

enter image description here

Has anyone else experienced this?

$\endgroup$
1

3 Answers 3

26
$\begingroup$

I might as well post my comment to Szabolcs as an answer. As Szabolcs noted, the default screen resolution in Mathematica is set to 72 dpi which might not agree with the actual resolution.

You can change the screen resolution in the Option Inspector which can be found in the Format menu. Set "Show option values" to "Global preferences" to change Front End settings permanently or set it to "Selected Notebook" to apply them to only the current notebook. Then just search for ScreenResolution in the search box. The relevant option is the one called "ScreenResolution" with quotation marks. You can also find it via Formatting Options > Font Options > FontProperties > "ScreenResolution". It's set to 72 by default as Szabolcs figured out.

By the way, I found that on OS X at least, to change a value in the option inspector I need to click on the value and hover over the selection with my mouse cursor for a few seconds until it goes into edit mode, but it might be different on Windows.


You can try out using the system dpi temporarily by evaluating:

SetOptions[$FrontEndSession, FontProperties -> {"ScreenResolution" -> Automatic}]

(This will revert to the previous value after the Front End is closed.)

You do this for the current notebook using

SetOptions[EvaluationNotebook[], 
     FontProperties -> {"ScreenResolution" -> Automatic}]

Alternatively, If it's just the "Text" style that is too small, you could change the default text font in the style sheet you're using. In order to do this, go to Format > Edit Stylesheet... and type Text in the text field. Select the newly created cell, change the size in Format > Size to whatever you want, and close the stylesheet editor. All text cells in your notebook should now use the updated font size by default.

$\endgroup$
3
  • $\begingroup$ Ok, I see the problem now: either I change the screen resolution and then I have proper Text-cell fontsize but all other (Input, Output, Message, Print, etc. output) styles seem to be too big requiring thus manual resetting of style parameters OR I can change the style of Text cells, but then again, both solutions would end up printing in different, unproportional sizes. Thus the issue boiles down to the fact that Times New Roman 12pt looks approx. 2 points smaller than Courier New 12pt, independent of resolution. Strange choice of fonts... $\endgroup$ Commented Jan 31, 2012 at 12:13
  • $\begingroup$ @IstvánZachar You can change the text style in the working environment independently from that in the printout environment so you could set up different fontsizes for different environments. $\endgroup$
    – Heike
    Commented Jan 31, 2012 at 12:20
  • $\begingroup$ I tried to "change the default text font in the style sheet" as described by Heike, and text cells do not "use the updated font size by default." Are the instructions no longer valid? Can someone please give me current, more detailed instructions? $\endgroup$ Commented Jun 4, 2019 at 1:04
11
$\begingroup$

I noticed that if I set the font size to 96/72 times larger, then I get precisely the same font sizes as in WordPad. (I used WordPad because Word has more advanced text handling and does not usually look the same as other Windows programs.)

Mathematica graphics

The screen resolution on my system seems to be 96 dpi, and Mathematica knows this:

In[1]:= Options[$FrontEnd, ScreenInformation]

Out[1]= {ScreenInformation -> {{ScreenArea -> {{0, 1366}, {57, 768}}, 
    FullScreenArea -> {{0, 1366}, {0, 768}}, BitDepth -> 32, 
    Resolution -> 96}}}

My conclusion is that Mathematica does not use the system resolution value (i.e. how many pixels the screen has in a unit length), but always renders assuming 72 dpi. I have been looking at differrent Front End options for a while (see Format -> Option Inspector...) but I have not managed to get Mathematica to render with 96 dpi.

Perhaps this is a design decision, for compatibility reasons (and lack of full implementation)? Let's hope future versions will have better support for different dpi values.

As a workaround can change the global magnification factor for the current front end session like so:

SetOptions[$FrontEndSession, Magnification -> 96/72]

This will affect every notebook. To make the change persist after you restart the Front End, use $FrontEnd in place of $FrontEndSession. Unfortunately images will also be magnified (they won't be shown 1:1 to screen pixels), so this is not a really practical workaround.


Note that when exporting to PDF or printing, text is correctly exported at the right point size. I regularly use this to match fonts sizes in figure with the rest of my (LaTeX) document.

$\endgroup$
11
  • $\begingroup$ This doesn't really solve the problem, but it's too long for a comment and seemed to be worth noting down. $\endgroup$
    – Szabolcs
    Commented Jan 26, 2012 at 12:16
  • 2
    $\begingroup$ You can change the screen resolution in the Option Inspector. Just search for ScreenResolution (or navigate to Formatting Options > Font Options > FontProperties > "ScreenResolution"). It's set to 72 by default as you figured out. $\endgroup$
    – Heike
    Commented Jan 26, 2012 at 12:22
  • $\begingroup$ @Heike actually mine (OS X) was apparently set to 0... I set it to 135, which is the correct value, and don't see anything happening. $\endgroup$
    – acl
    Commented Jan 26, 2012 at 12:31
  • $\begingroup$ @Szabolcs none that I can see (here at least) $\endgroup$
    – acl
    Commented Jan 26, 2012 at 12:34
  • 1
    $\begingroup$ @acl make sure you change Formatting Options > Font Options > FontProperties > "ScreenResolution", and not some of the other ScreenResolution options available. Set it to Automatic. It's another ScreenResolution option that has a 0 value by default and changing it has no effect. $\endgroup$
    – Szabolcs
    Commented Jan 26, 2012 at 12:40
1
$\begingroup$

I fixed this by going to OptionInspector choosing GlobalPreferences then GlobalOptions, then SystemConfiguration then ScreenResolutionCompatibilityMode. I set this to True. It fixed everything.

$\endgroup$

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.