14

There are a few user interface changes in Mathematica 11, and the new font is what I'm interested in. Unfortunately, the official document doesn't say what the font's name is.

I attempted to find the answer using this command:

In[1]:= System`$DefaultFont 

Out[1]:= {"Courier", 10.}

which is obviously the same result as in version 10 (see here). I don't think Courier is the right answer.

Some comments below suggest the answer varies from one platform to another. My system is Linux Mint 17.3 KDE. I'm sure the font isn't Source Code Pro, although it does exist in my font folder. It should be one of DejaVu Sans Mono Bold and Bitstream Vera Sans Mono Bold, but I can't tell exactly which one is correct, because they look identical:

enter image description here

Comments are welcomed and if you have a different font, please attach a sample screenshot in your answer.

btwiuse
  • 567
  • 7
  • 11
  • Style[#, FontFamily -> #] & /@ $FontFamilies may be useful, but some fonts are too similar to tell one from another. – btwiuse Aug 12 '16 at 00:24
  • 6
    Isn't it Source Code Pro? I like it because it reminds me of the default Ubuntu font – Jason B. Aug 12 '16 at 00:25
  • @JasonB Looking at the lowercase letter 'g', there seems to be some differences. – btwiuse Aug 12 '16 at 00:32
  • 3
    Try CurrentValue[{StyleHints, "CodeFont"}] – Michael E2 Aug 12 '16 at 00:41
  • @MichaelE2 that gives "Bitstream Vera Sans Mono". I'm running mma on linuxmint – btwiuse Aug 12 '16 at 01:17
  • @navigaid: Ah, yes, that font also gets installed with mma 11 on Windows. I have liked that one for a few years, and that's in fact the one that I use in my own "default" custom stylesheet for input and code. I'm curious now, do different platforms get different default fonts, even though identical fonts are available for all platforms? What would be the reason for this? – Pirx Aug 12 '16 at 01:25
  • 1
    If anyone was in their prerelease program I believe these new 11 fonts were mentioned in some of the materials that were sent out. Unfortunately I am traveling currently so I cannot access the information at the moment. – ktm Aug 12 '16 at 04:30
  • What do other Mac users get when they run CurrentValue[{StyleHints, "CodeFont"}]? I get Source Code Pro but it's possible I'm still running one of the prerelease versions. – Jason B. Aug 12 '16 at 13:30
  • Well, the first thing I tried was CurrentValue[{StyleDefinitions, "Input", FontFamily}], but it returned "Times". (It got it right for the style "Text", though.) – Michael E2 Aug 12 '16 at 17:14
  • 1
    @JasonB I knew that I recognized it when I installed it last night, and was thinking the exact same thing! – Ben Kalziqi Aug 12 '16 at 17:52
  • 2
    @user6014 Quoteth: Default font changed to Source Code Pro on Mac, Consolas on Windows, and Bitstream Vera Sans Mono on Linux. – kale Aug 13 '16 at 02:51
  • Is it possible to set the CodeFont weight from "Bold" to "Regular"? Where? – RonH Mar 20 '17 at 14:20
  • A new font for the code in v11? Does this mean that the issue with lowercase l being almost the same as 1 is now solved? (That alone would make switching to the new version worth it.) Or are they still indistinguishable? – Kvothe Aug 23 '17 at 10:25
  • @Kvothe: at least on Mac, version 11.1.1, code clearly distinguishes between lowercase letter l and numeral 1: the former is a bit taller and its bottom serif extends only to the right whereas the latter's bottom serif extends both left and right. – murray Nov 19 '20 at 16:54

2 Answers2

15

Straight from the proverbial horse's mouth:

Default font changed to Source Code Pro on Mac, Consolas on Windows, and Bitstream Vera Sans Mono on Linux.

kale
  • 10,922
  • 1
  • 32
  • 69
10

On my Windows 7 system, CurrentValue[{StyleHints, "CodeFont"}] gives Consolas. A perhaps more intuitive way to find it is to simply highlight a piece of text/output/input/etc. the font of which you're interested in, then go to Format->Font..., and you'll see the font highlighted.

Having said that, I am a bit surprised, too, that they use the somewhat dated Consolas as the default, given that they do have Source Sans Pro, a much nicer font IMHO, in their installation folder (Wolfram Research\Mathematica\11.0\SystemFiles\Fonts\TrueType on Windows). Of course, it's easy to change your style so you get that font.

Pirx
  • 4,139
  • 12
  • 37
  • You're on windows, right? Here on my linuxmint laptop, the same code gives "Bitstream Vera Sans Mono", and MemberQ[$FontFamilies, "Consolas"] simply gives False, which suggests they probably use different font on each platform. – btwiuse Aug 12 '16 at 01:26
  • 1
    @navigaid: Yep, and I'm getting really curious now as to where those fonts that Mathematica uses are coming from. Is it possible they scan the system for pre-existing fonts, and pick one of these in some order of preference if possible? – Pirx Aug 12 '16 at 01:29
  • Pirx, for completeness, can you mention your OS in your post? – J. M.'s missing motivation Aug 12 '16 at 13:41
  • On OSX, or to be specfic according to Apple, "macOS Sierra Beta", the font is (Adobe) Source Code Pro. It's interesting that this varies so much from OS (or an "operating environment") to another. BTW, this is clearly a change from v10 - but I don't care to check what it was in it. Probably it was some sort of monospace Courier. – kirma Aug 12 '16 at 17:35
  • 1
    Is it possible to change the default code font of Mathematica 11 (back to Courier, for example) by changing the value of {StyleHints, "CodeFont"}? – User18 Aug 12 '16 at 18:00
  • 5
    @User18 Yes, you can change it: {"CodeFont" -> "Courier"}. Then it looks like Mathematica 10 and older. But to be honest, the "Source Code Pro" font looks nice too. – QuantumDot Aug 12 '16 at 19:14
  • 1
    @navigaid, I just checked on my Xubuntu machine, and 11 does use that font. I wonder if this is indeed used for all *nix distributions… – J. M.'s missing motivation Aug 13 '16 at 00:21
  • 4
    @User18 I'm using a Mac. And I changed it simply by navigating in the Options Inspector: Formatting Options -> Font Options, and changing the field StyleHints to {"CodeFont" -> "Courier"} – QuantumDot Aug 13 '16 at 05:31
  • 1
    @QuantumDot: That is wonderful. A setting in the Options Inspector is exactly what I hoped for. Yes it works. Thanks a lot for the further help. – User18 Aug 13 '16 at 09:08