Sublime Forum

Font_face for comments

#1

Hello,
is it possible to assign a different font_face for comments?

I tried this way but it doesn’t work:

// Documentation at https://www.sublimetext.com/docs/color_schemes.html
{
	"variables": {},
	"globals": {},
	"rules": [
		{
			"name": "Comment",
			"scope": "comment",
			"font_face": "MonoLisaVariable-Italic"
		}
	]
}

Thanks!

0 Likes

#2

This is not possible. To avoid text jumping around Sublime Text requires that the sizes of glyphs don’t change when syntax highlighting is applied.

0 Likes

#3

@bschaaf My goal was to enable the comment style shown in the screenshot below, which in Zed is enabled with "ss02": true

In ST I also tried:

"font_options": [
    "dlig",
    "ss02",
],

but the comment style always remains the default one.

0 Likes

#4

That’s possible with ST very much the same way as it is in other editors,
assuming a font being used which supports alternative glyphs for italic text.

grafik

Color Scheme Override:

{
	"rules": [
		{
			"name": "Comment",
			"scope": "comment",
			"font_style": "italic",
		},
	]
}

Preferences:

	"font_face": "Cascadia Code Light",
	"font_options": [
		"ss01",
	],
0 Likes

#5

Hi @deathaxe and thanks for your help, but I can’t get it to work. Is it possibly because the font I’m using (https://www.monolisa.dev/) doesn’t support this setting?

0 Likes

#6

I guess it requires Script variant feature, of Monalisa Plus or Monalisa Complete.

Those font variants may also be gated behind different ssXY flag or one which is not supported by ST.

1 Like