Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specific font_face based on syntax in Sublime Text 2

Is it possible to display a specific font_face for each individual syntax language setting in Sublime Text 2? For example:

"php" : { "font_face" : "Droid Sans Mono" },
"c#" : { "font_face" : "Courier New" },
"javascript" : { "font_face" : "monospace" } 

Couldn't find much about the font_face setting in ST2 other than how to change it globally. My job requires me to jump around a lot of different language files and think this would make them easier to distinguish on the fly. I like my color scheme and want to keep that the way it is, but unfortunately it doesn't quite differ enough for me to be able to pick out the languages quickly.

like image 529
voodooGQ Avatar asked Feb 19 '23 09:02

voodooGQ


2 Answers

If you go to Preferences > Settings - More > Syntax Specific - User, you can add

{
    "font_face": "Source Code Pro"
}

to have that font for only that syntax.

like image 96
Darkwater Avatar answered Feb 21 '23 23:02

Darkwater


For syntax specific settings for targeted language, in Packages > User folder, create a file with name of that language.

ex. for PHP, create php.sublime-settings.

and add following code to it:

{
    "font_face": "Source Code Pro"
}

For JavaScript create file names JavaScript.sublime-settings and so on.

Also, using this technique, you can set different color schemes for different languages using the color_scheme attribute.

{
    "font_face": "Source Code Pro",
    "color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme"
}

Alternatively, if the file with targeted language is open, you can go to Preferences > Settings - More > Syntax Specific - User, and add the font_face setting.

like image 26
acdarekar Avatar answered Feb 22 '23 00:02

acdarekar