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

#9

Colors, YES! These are for what was Seth theme. Seth Beautified.

<plist version="1.0">
<dict>
	<key>name</key>
	<string>Seth</string>
	<key>settings</key>
	<array>
		<dict>
			<key>settings</key>
			<dict>
				<key>background</key> <!-- Default background color of the entire view (including gutter and minimap ) -->
					<string>#161618</string>
				<key>foreground</key> <!-- Default foreground color for view - affects file contents, gutter, rulers and guides -->
					<string>powderblue</string> <!-- While editing this string, caret may !! disappear -->
				<key>invisibles</key> <!-- White space characters, ignored unless selected, e.g., empty_space_character "·" -->
					<string>steelblue</string> <!-- preference: "draw_white_space" = "selection" | sets Ruler color -->
				<key>caret</key> <!-- Color of the caret -->
					<string>rosybrown</string>
				<key>lineHighlight</key> <!-- Color of the line the caret is in -->
					<string>#151618</string> <!-- preference: "highlight_line" = "true" -->
				<key>bracketsForeground</key> <!-- * Color of the highlighting(s) selected by bracketOptions -->
					<string>darkgreen</string> <!-- preference: "match_brackets" = "true" -->
				<key>bracketContentsForeground</key> <!-- Color of the highlighting(s) selected by bracketContentsOptions -->
					<string>deepskyblue</string> <!-- preference: "match_brackets" = "true" -->
				<key>tagsForeground</key> <!-- * Color of the highlighting(s) selected by tagsOptions -->
					<string>deepskyblue</string> <!-- preference: "match_brackets" = "true" -->
				<key>findHighlight</key> <!-- Background color of ACTIVE region matching the current search -->
					<string>#00AA00</string>
				<key>findHighlightForeground</key> <!-- Foreground color of regions matching the current search -->
					<string>003366</string>
				<key>gutter</key> <!-- Background color of the gutter -->
					<string>#1C1C1F</string>
				<key>gutterForeground</key> <!-- Foreground color of the gutter, all gutter numbers -->
					<string>darkolivegreen</string>
				<key>selection</key> <!-- Color of the selection regions #003434 008080 is Teal -->
					<string>#003434</string>
				<key>selectionBorder</key> <!-- Color of active selection regions’ border -->
					<string>darkolivegreen</string>
				<key>inactiveSelection</key> <!-- Color of inactive selections background (inactive view) #003417 006400 is DarkGreen -->
					<string>#003417</string>
				<key>guide</key> <!-- Color of the guides displayed to indicate active nesting's levels -->
					<string>deepskyblue</string> <!-- preference: "indent_guide_options" = "draw_normal" -->
				<key>activeGuide</key> <!-- Color of the guide lined up with the caret -->
					<string>khaki</string> <!-- preference:  "indent_guide_options" = "draw_active" -->
				<key>stackGuide</key> <!-- Color of the current guide’s parent guide levels -->
					<string>sienna</string> <!-- preference:  "indent_guide_options" = "draw_active" -->
			</dict>
		</dict>
		<dict><!-- this dict › delete original, place first after settings dict -->
			<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><!-- 000000 original too harsh -->
					<string>#161618</string>
			</dict>
		</dict>
		<dict><!-- this dict › not found in Seth original, add to Seth.tmTheme document -->
			<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><!-- this dict › not found in Seth original, add to Seth.tmTheme document -->
			<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