Skip to content
This repository

Bold and Italic styles in Sublime Text 2 #32

Closed
smlombardi opened this Issue · 16 comments

4 participants

smlombardi Miguel Sousa Francisc Romano Ce
smlombardi

In Sublime Text 2, to name just one, a language syntax might have some code selectors as Bold or Italic. When using this font, everything appears in regular weight & style in spite of that.

If I had to guess, I'd say most of these apps are just looking for a simple -bold and -italic in the font name, whilst SPP have more complicated naming structure in this family.

Any ideas?

Miguel Sousa
Collaborator

How are you enabling Bold and Italic in ST2 with other font families (e.g. Arial)?
What are your user settings, and which file format are you using? It would be also good to have a sample of the text you're trying to style.

According to this page -- Bold and Italic font support to display keywords text -- font styling is supported in ST2, but I haven't found the way to turn it on.

Miguel Sousa
Collaborator

OK, I think I figured it out. Selecting the Sunburst color scheme, and Markdown as the language the text displays with Bold and Italic. Then setting the User font to Source Code Pro I get this,

I see that the Bold font is working. The Italic is not because Source Code Pro does not have italics, and Sublime Text 2 is not fauxing them.

Francisc Romano

ST2 is "fauxing" italics for me.
If you paste body{background-color:#92000D;} into ST2 and set the syntax to CSS it will make background-color italic.

smlombardi

I have used other fonts, such as Bitstream Vera Sans Mono, which has the more typical 4 fonts, work perfectly in ST2. If the syntax has bold, I get bold. And real italics. Even though the SCP download has other weights and styles, this font WON'T display them in ST2. That's my issue. Vera Sans = works. SCP = no works.

And this is how themes set it:

<dict>
            <key>name</key>
            <string>Comment</string>
            <key>scope</key>
            <string>comment,punctuation.definition.comment</string>
            <key>settings</key>
            <dict>
                <key>fontStyle</key>
                <string>italic</string>
                <key>foreground</key>
                <string>#717171</string>
            </dict>
        </dict>
smlombardi

Yes, I find it hard to understand why SCP comes with 2 different light weights and a SEMIbold, yet no italics.

smlombardi

FWIW, be sure to set your font in ST2 to "font_face": "SourceCodePro-Regular"

Miguel Sousa
Collaborator

@Francisc Are you sure you have ST2 set to use SCP? I'm not seeing italics being fauxed.

@smlombardi By setting "font_face" to "SourceCodePro-Regular" you're hard-coding all font styling to that particular font. What you need to use is the name of the family, like so, "font_face": "Source Code Pro"

smlombardi

Bold does indeed work, but I see no itals.

screen

Miguel Sousa
Collaborator

Good you got it sorted out.
For italics you can add your voice to issue #6

smlombardi

I did. It's nice to have the option. Check out Vera Sans or Ubuntu Mono to see.

smlombardi smlombardi closed this
Francisc Romano

Hi Miguel,

Here's how it looks on Windows:

Screenshot

The plugins that I have installed shouldn't be interfering.
The version I have installed is the Dev version which is ahead of the Stable one.

Miguel Sousa
Collaborator

Thanks, that's good to know. Are you able to say if this fauxing is a feature of the Windows version or if it's something that will be available on all platforms in the future?

Francisc Romano

I've no idea. The Dev version is available to everyone. (http://www.sublimetext.com/dev)
I've made a clean install of ST2 Dev and I get the same.
It's not plugins that do that, it comes out of the box.

Miguel Sousa
Collaborator

The feature is not available on the Mac. I tried the latest Dev build (#2220) and the font does not get slanted.

Francisc Romano

Must be Windows-specific.
Maybe Mac OS checks if italics exists and does not slant if not found?

Ce

Help! I'm having the same issue as @Francisc is/was... I am on Mac OS, only CSS files are affected. Did anyone ever figure out a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.