Sublime Forum

Italic/bold not working

#1

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: https://packagecontrol.io/packages/Oceanic%20Next%20Italic%20Color%20Scheme

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.

2 Likes

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

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

0 Likes

#5

I have the same problem, using the last dev build

1 Like

#6

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:

	<dict>
		<key>name</key>
		<string>Comment</string>  <---- this is the line that is wrong in most themes. It should be "Comment" and not "Comment(s)"
		<key>scope</key>
		<string>comment, punctuation.definition.comment</string>
		<key>settings</key>
		<dict>
			<key>foreground</key>
			<string>#5C6370</string>
			<key>fontStyle</key>
			<string> italic</string>
		</dict>
	</dict>

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:
https://laracasts.com/discuss/channels/general-discussion/operator-mono-font
{
“font_face”: “Operator mono medium”,
“font_size”: 12,
}

0 Likes

#7

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

0 Likes

#8

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.

0 Likes

#9

same problem
it working only when font_face is consolas

0 Likes

#10
"font_options":
	[
		"gray_antialias",
		"subpixel_antialias",
		"directwrite"
	],

Try this, It’s working for me.

0 Likes

#11

Nope, stil not working for me.

0 Likes

#12

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:

0 Likes

#13

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.)

0 Likes

#14

Not working here too.

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

0 Likes

#15

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.

2 Likes

#16

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).

0 Likes

#17

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)

2 Likes

#18

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

3 Likes

#19

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

0 Likes

#20

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

0 Likes

#21

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

0 Likes

#22

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.

0 Likes