Sublime Forum

Font weight in color scheme


Is there a way to dynamically change the font weight for a scope?

In my org package i would like headlines to pop with a larger font weight and decrease to normal weight as headings are indented. I would kind of like the same behaviour in markdown files.

I could make them all bold, but i would kind of like them to pop a bit more than text that has been made bold in the document. (For an example see the spacemacs org mode theme or some of the doom-emacs themes )



The only thing that color schemes can alter regarding text is the color that’s used to display it, and whether or not it should be normal, bold, italic or bold italic; things like the font face and font size can’t be changed except on a document-wide basis (and that happens in settings and not a color scheme).

It’s possible for headlines to be bold unless they’re indented, though that requires the syntax definition that’s in use to apply a unique scope to those items so that the color scheme can target them with different rules.

There’s not a lot that plugins can do to modify this in a dynamic way, though. It’s possible to modify the color of text in a plugin by using the region API and carefully constructed scope rules, but that puts you into the territory of either forcing someone to use a specific color scheme or trying to generate color scheme patches on the fly.



Thank you.
I will attempt to play with the region api and see what i can accomplish.