MATLAB Spoken Here

Choose a good font – your eyes will thank you 12

Posted by admin,

This past week I became aware that I was naively accepting MATLAB’s default code font, when I should be exploring the vast landscape of programmer fonts available. I finally settled on the gorgeous Bitstream Vera Sans Monspaced font pictured below:

I think this font looks fantastic in MATLAB – I especially like the distinction between the letter “O” ( ) and the digit “0” ( ) (the zero has a tiny dot in it’s center). I find this font much smoother and more elegant to view. I think it even makes me enjoy using MATLAB more!

If you don’t like Bitstream Vera Sans Monospaced, check out some of these other “programmer” fonts:

Once you’ve downloaded the font of your choice, you can change your code font in MATLAB by doing the following:

  1. Select the File -> Preferences menu item
  2. Select the Fonts group
  3. In the Desktop code font section, select a font in the font combo box (pictured below).

You can also change the font for a specific component (e.g. the Editor) by selecting the Custom item under Fonts in the preferences tree. In the Desktop tools section, select the component to change the font for, select the category of font to change (e.g. Desktop code) and finally select a font in the combo box.

For more information on installing fonts check out these links:

What font do you use?

12 CommentsOldest to Newest

Ken, should this work with version 7.0 (R14) on Windows? My favorite font is Consolas, but MATLAB seems to do a terrible job of rendering it on screen. In fact, about the only font that doesn’t get butchered is Courier New.

Perhaps there is some other setting I need to tweek?

Ken,
That’s a nice font. I use “Andale Mono” which has a similar look. I also like the clear distinction it makes between “l” (lower case L) and the number “1”.

Hi Mark,

The issue your referring to (see the bug report here) was fixed in version 7.5 (R2007b). The problem actually was with Sun’s handling of ClearType font rendering (see the Java bug here).

If you’re really set on getting Consolas to work you have two options:
1) Upgrade to R2007b or newer (preferred option)
2) Install and run with Java 6 (instruction for this can be found here)

Note, however, that MATLAB is only supported on the version of Java that we ship (1.4.2 for R14SP1).

-Ken

Hi Ken,

Every year or so I try to find a programming font that would really make me happy. A couple of months ago I discovered Bitstream Vera Sans Monospaced, and I really like it. It might just be a keeper.

Steve

The code in Bitstream Vera Sans Monospaced is beautiful and easy to read. But the comments other in English become little square symbols(□) after changed to this font.

In Linux the font hinting is much much too strong. I would love to get light hinting like on OSX. In addition, the pseudo-ClearType LCD-filtering in java is very ugly; It causes color fringes.

Great advice for us beginners! If planning to write comments in other languages Andale Mono can serve that purpose well. If not, I would certainly prefer Bitstream Vera Sans Mono!

These postings are the author's and don't necessarily represent the opinions of MathWorks.