Sublime Forum

Have a different font for Sublime Text 3 comments

#1

Hello,
I use Sublime Text 3.

“theme”: “Material-Theme.sublime-theme”
“font_face”: “Fira Code Medium”

I could change the color of the comments:


name
Comments
scope
comment, punctuation.definition.comment
settings

fontStyle
italic
foreground
#00ff00



I would like to know if it is possible to have a different font than the main font.
I would like, for comments the police “Operator Mono Light”.
If so, what is the syntax for doing this in the “Material-Theme.tmTheme” file?

Thank you for your help.

Best regards

0 Likes

#2

Never see something like scope-based font setting. So probably no.

0 Likes

#3

This isn’t possible. You’ll have to craft two font files with the desired properties (notably their glyphs should have the same widths) yourself. This is possible but not something I would know how to do without experimenting.

0 Likes

#4

My settings:
“font_face”: “Fira Code Medium”,
“color_scheme”: “Packages/Material Theme/schemes/Material-Theme.tmTheme”
and in Material-Theme.tmTheme, i have changed comments color, i want to knom if i can add lines as follows:

name
Comments
scope
comment, punctuation.definition.comment
settings

fontFace
Operator Mono Light
fontStyle
italic
foreground
#00ff00

0 Likes

#5

My settings:
“font_face”: “Fira Code Medium”,
“color_scheme”: “Packages/Material Theme/schemes/Material-Theme.tmTheme”
and in Material-Theme.tmTheme, i have changed comments color, i want to knom if i can add lines as follows:
fontFace
Operator Mono Light
I have change the color of the comments line as shown belows

name
Comments
scope
comment, punctuation.definition.comment
settings

fontFace
Verdana
fontStyle
italic
foreground
#00ff00

0 Likes

#6

As FichteFoll indicates, there is no <string> argument for “fontface” in the required context. Perhaps FichteFoll would be so kind as to provide this thread with a link to the current list of valid tmTheme string arguments?

In any case, string formats must be observed. One method is to use PackageResourceViewer to extract a package. Then your comment environment can be provided with the correctly formatted code. I do not see how to code a unique font using themeName.tmTheme construction.

	<dict><!-- comment -->
		<key>name</key>
		<string>Comment</string>
		<key>scope</key>
		<string>comment</string>
		<key>settings</key>
		<dict>
			<key>foreground</key>
			<string>seagreen</string>
			<key>background</key><!-- comment -->
				<string>#161618</string>
		</dict>
	</dict>
	<dict><!-- comment -->
		<key>name</key>
		<string>Tag</string>
		<key>scope</key>
		<string>brackethighlighter.default</string>
		<key>settings</key>
		<dict>
			<key>foreground</key>
			<string>deepskyblue</string>
		</dict>
	</dict>
	<dict><!-- comment -->
		<key>name</key>
		<string>Tag</string>
		<key>scope</key>
		<string>meta.tag, declaration.tag</string>
		<key>settings</key>
		<dict>
			<key>foreground</key>
			<string>dodgerblue</string>
		</dict>
	</dict>
0 Likes

#7

http://docs.sublimetext.info/en/latest/reference/color_schemes.html

0 Likes