Sublime Forum

Italic comments

#1

Hello,

I’ve been using Sublime Text for some time now and have gone from 2 to 3 with great ease. Somewhere during my using Sublime Text 3 I noticed I no longer had italicized comments. I’d like to get those back. I know that one must use a font that has an italic format and I’ve read other posts that seem to eventually get it working again. I’ve gone through multiple fonts/removing my properties file/reinstalling ST3 and have run out of options. I’m using 64-bit Windows 7 and ST3 build 3065.

Any help would be greatly appreciated, thanks!

0 Likes

#2

Your color scheme has to specify that comments are italicized. Try different color schemes. Dawn, for example, has italicized comments.

0 Likes

#3

Thanks for the suggestion, but still, no italics. I’ve tried setting to the default color scheme as well as a few others.

0 Likes

#4

The Twilight color scheme (in the Color Scheme - Default package) definitely uses italics for comments.

If that doesn’t work it could also be because of the font your are using. Did you change that recently?

0 Likes

#5

It could also be that you have the “no_italic” font option enabled. Enter view.settings().get(‘font_options’) in the Console and verify it isn’t listed there.

0 Likes

#6

Found the answer by playing with the default/user color settings. I wanted to use the Mariana color scheme, but just with italic comments. I copied /opt/sublime_text/Packages/Color Scheme - Default.sublime-package to ~/.config/sublime-text-3/Packages/User/, removed irrelavent binary and other schemes, renamed the scheme, and renamed the file to MarianaModified.sublime-color-scheme and then it popped up in my color scheme switcher. Finally, under “rules”: I modified the section with “name”: “Comment” and added “font_style”: “italic”. It ended up looking lik this:

....
"rules":
[
    {
        "name": "Comment",
        "scope": "comment, punctuation.definition.comment",
        "foreground": "var(blue6)",
        "font_style": "italic"
    },
...
2 Likes