Sublime Forum

Italic/bold not working

#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

#23

I think it depends on font family too, e.g. Consolas working for me as expected, however with directwrite ST doesn’t show Roboto Mono Italic/Bold variants.

0 Likes

#24

Hey kris5228: Does bold and italics work for you with the Cobalt theme? If so, can you save a backup copy of your Oceanic_Next.tmTheme file and then add the following lines to the original:

 <dict>
      <key>name</key>
      <string>Bold Markup</string>
      <key>scope</key>
      <string>markup.bold</string>
      <key>settings</key>
      <dict>
        <key>fontStyle</key>
        <string>bold</string>
        <key>foreground</key>
        <string>#C1AFFF</string>
      </dict>
    </dict>
    <dict>
      <key>name</key>
      <string>Italic Markup</string>
      <key>scope</key>
      <string>markup.italic</string>
      <key>settings</key>
      <dict>
        <key>fontStyle</key>
        <string>italic</string>
        <key>foreground</key>
        <string>#B8FFD9</string>
      </dict>
    </dict>

Does this give you bold and italics? (You might need to exit sublime and delete the cache file to get this to work.) It does for me. It looks to me like some of the .tmTheme files are using bold and italics only for certain code elements and/or only with certain syntaxes. This means that some of them won’t do anything in response to _ italics _ or ** bold **.

0 Likes

#25

I should add that you should test this with Markdown or Textile.

0 Likes

#26

I’ve tried adding it to my tmTheme file but still no change. I’ve tried many different tmTheme files and even though they work perfectly fine in Windows, none of them work in Linux.

0 Likes

#27

It seems some of the bugs are because font creators and sublime dont sync.

Most of the modern fonts have “Regular”, “Italic”, “Bold”, “Bold Italic” typefaces at lease. So, Sublime does not catch the default “Regular” type, and if you set font_face to “Some Font Regular”, you lose bold and italic, because Sublime cannot find it, as it appends “Bold” and “Italic” keywords to look for a font. Obviously “Regular Bold” does not exist.

For fonts whose regular type consists only of a name “Some Font”, everything’s fine.

So since you cannot make font designers to name fonts as we want, SublimeText should be made capable of defining font sets manually, like “font_face”: [“Font Regular”, “Font SemiBold”, “Font Italic”, “Font Compressed Bold Italic”].

1 Like

#28

Handling of fonts with many weights was fixed in build 3127. Linux and Windows were primarily affected. Build 3127 will also now print info to the console if a font has geometry issues that prevent using the bold or italic faces.

1 Like

#29

I can confirm Operator Mono Mediu works now but non-monospaced fonts (e.g. Garamond, Verdana) still face the same issue.

0 Likes

#30

This behavior is intended, and not a bug.

0 Likes

#31

Fine, works for me. I will tell that to my users.

0 Likes

#32

I’m using Input Serif Compressed and was trying to get it to reflect various weights. I discovered that you have to go to the actual font name as it is stored on your machine. So in my case, to get the bold variant, I had to show it like so:

"font_face": "InputSerifCompressed-Bold",

That worked for me on my Mac.

0 Likes

#33

I was struggling to get Ubuntu Mono font to work. On my Mac, the font book has a collection that I installed called Ubuntu Mono but when I enabled that font in the file: Preferences.sublime-settings–User like this: “font_face”: “Ubuntu Mono”, all text characters turned in to squares with a question mark in the center.

*Resolution: from font book, select the font collection you want to use. In my case, Ubuntu Mono. Then right click on that collection and “show in finder”. Each font was listed individually in the Fonts folder: UbuntuMono-B.ttf, UbuntuMono-BI.ttf, UbuntuMono-R.ttf, UbuntuMono-RI.ttf. So I created a new folder in the Fonts folder named “Ubuntu Mono” and moved the UbuntuMono fonts to the new folder. When I enabled “font_face”: "Ubuntu Mono: and saved the Preferences file it worked!

I hope this is helpful to others,

0 Likes