Sublime Forum

Italic/bold not working


I can’t get italic or bold fonts to work in Sublime Text 3 (build 3114).

This is my current settings:

"font_face": "Operator Mono Medium",
"font_options": [],
"font_size": 12,

I’m using this colorscheme:

I’ve tried every font size, every font-type there is (Operator Mono, Operator Mono Light).
My OS is Ubuntu 16.04.

EDIT: this seems to be the same problem as: Proportional fonts lose italic/bold syntax highlighting except it occurs in every syntax.

EDIT 2: I seem to have narrowed it down to being the font and sublime. Input Mono and other monospace fonts (though not all) work fine with italic and bold. The font also works fine in Atom with italic and bold style.

EDIT 3: I tried adding font_options:["italic"] and that works just as expected. It seems to be something to do with the colorscheme, even though I have the exact same colorscheme on another computer where it displays the italic and bold styles fine.


Italic/bold not working with `Roboto Mono` when `directwrite` on Windows

I have the same issue, italics work if I apply them globally in settings file, but not through the tmTheme.



I have the same problem, using the last dev build

1 Like


I ran into the same issue as well. I found out what fixed it for me.
It depends on the theme. The syntax in the theme I was using “One Dark Color Theme” in this case was wrong.
In your theme’s .thTheme file, look for this:

		<string>Comment</string>  <---- this is the line that is wrong in most themes. It should be "Comment" and not "Comment(s)"
		<string>comment, punctuation.definition.comment</string>
			<string> italic</string>

AND NOT JUST THAT! Italics will only show up with certain font sizes. So make sure you stay at 9, 12, or 16!
I found out through this thread:
“font_face”: “Operator mono medium”,
“font_size”: 12,



My tmTheme file already looks like that. Also tried the thing with font-size. No luck so far.



I’m currently using Matherial Theme in Ubuntu 16.04 and the italics with Operator Mono won’t work.

I have tried it in Mac and Windows and it works there.

If i use Hack font, the italics work with Matherial Theme.



same problem
it working only when font_face is consolas



Try this, It’s working for me.



Nope, stil not working for me.



Not working with Material theme 4.0.0. My font is Operator not Operator mono, but I think there is nothing to do with that :frowning:



sublime’s behavior with respect to this is pretty weird.

I’m on windows 7 and I find that with one font, only gdi will give me bold and italic, with another font, only directwrite works. With some fonts, either will work, with others, neither will work. If you only have the bold or italic version of a font, sublime will fake the missing italic or bold version, respectively, unless it does not like the font for some reason, in which case you get neither bold nor italic. It’s pretty baffling.

(I verify that bold and italic of these fonts work in Word, and that Word is really the bold and italic versions of these fonts and not “faking it” because for example, the italic f of certain font has a distinct look from regular f.)



Not working here too.

As far as I’ve tested, italic and bold work only with fixed font.



FYI this issue happens to me when with Sublime Text and fonts that have no explicit Italic/Bold faces/variants. Using font that comes with all variants makes Sublime render well. Can you check that you are not using the font with single “Regular” variant only.

NOTE: Other programs, especially on Windows, can automatically bolden or make italic such fonts, but not Sublime, that seem to use kind of own font renderer.



I’ve tried with several fonts and none of them seem to work even though I have the italic version installed (I usually install the entire font with ALL variants).



It’s really weird because when you do

  "font_options": [ "bold" ]

The font is bold, but when the schemes set the font bold, it’s not working… (same for italic)

And it does this only with some font… (consolas is working properly, but I haven’t found any other that does)



FYI, I am planning to take a look into the italic/bold issue at some point in the next couple of weeks.



Related to this: Italic/bold not working with `Roboto Mono` when `directwrite` on Windows



I don’t think so. I can make any font work fine on windows with both italic and bold.



It’s true, but only when directwrite is disabled (by default).



I just checked in Windows and it works fine even with directwrite on. What font-size are you using? Sometimes you have to have a specific font-size for the italic and bold to work properly.