Wednesday, October 12, 2011

Changing Fonts in Sublime Text 2

I’ve been using the Sublime Text 2 app for this past week and really like it. One of the things I wanted to change though was the font used in the editor. A font I’ve liked in the past was Consolas but I couldn’t find that. I did find one named Inconsolata, which is almost identical from what I can tell, on Google Web Fonts. Here’s how I set everything up on my Mac

Get the font(s)

  • Head over to Google Web Fonts and search for “Inconsolata”, or any other font that you like (other suggestions are Ubuntu Mono or Varela Round)
  • Click the “Add to Collection” button to the far right of the font name
  • Click the “Download your Collection” link on the top-right.
  • Click the “Download the font families in your Collection as a zip-file” link on the pop-up dialog
  • Open the zip-file that’s downloaded
  • Double-click on each .ttf file
  • Select to “Install Font”

Configure Sublime Text 2

  • Open Sublime Text 2
  • Click on the “Sublime Text 2” application menu
  • Select “Preferences”
  • Select “File Settings - User”
  • In the file that opens, add the following line along with the name of the font you installed:
    "font_face": "Varela Round"
    Be sure to include a comma “,” if you’re adding this to a line already within the file, like a color scheme selection.

You can also change the font size using the following:

"font_size": 16
Notice that the number for the font size isn’t in quotes. Once you save the file you should see the results immediately as the configuration file you’re working in is redrawn using your selections.

Here’s my current complete configuration file

{
    "color_scheme": "Packages/Color Scheme - Default/Indy Merbivore Soft.tmTheme",
    "font_face": "Varela Round",
    "font_size": 16
}

3 comments:

Anonymous said...

Thanks Troy. Since we spend all day staring at silly characters, they might as well be pleasing to the eye. I cast my vote for "Varela Round"

Seb said...

Nice article - I use Monofur - quite a quirky monospaced font that looks great :)

Unknown said...

Thanks heaps!