sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

add_regions ignores font_style for scope

Open dev-dwarf opened this issue 1 month ago • 2 comments

Description of the bug

I'm using version 4192. I made a plugin to highlight TODOs and other special keywords in comments (I know several plugins exist for similar functionality, but wanted to make my own). The keyword scopes should be styled bold by my colorscheme, but do not render as bold. view.style_for_scope shows that the scopes are styled as bold.

Image

Plugin file: TODO.py

Relevant parts of colorscheme:

{
    /* snip */
    "rules": [
        /* snip */
        {
          "name": "Comment",
          "scope": "comment",
          "foreground": "color(var(green))",
          "font_style": "bold",
        },
        /* snip */
        { 
          "name": "TODO", "scope": "comment.todo", 
          "background": "var(lyellow)", "font_style": "bold", "foreground": "var(black)", 
        },
        { 
          "name": "NOTE", "scope": "comment.note", 
          "background": "var(lblue)", "font_style": "bold", "foreground": "var(black)", 
        },
        { 
          "name": "WARN", "scope": "comment.warn", 
          "background": "var(lred)", "font_style": "bold", "foreground": "var(black)", 
        },

    ]
}

Steps to reproduce

  1. Install TODO.py plugin (attached)
  2. Style relevant scopes as bold
  3. Text does not render as bold
  4. Open Console and looking at messages shows scope should be bold.

Expected behavior

Expected highlighted text to be rendered bold.

Actual behavior

Text is rendered at standard font weight.

Sublime Text build number

4192

Operating system & version

NixOS 25.05 (warbler)

(Linux) Desktop environment and/or window manager

Gnome 48.2 (wayland)

Additional information

No response

OpenGL context information


dev-dwarf avatar Dec 11 '25 02:12 dev-dwarf

Is bold/italic rendering probably disabled via "font_options" setting?

deathaxe avatar Dec 11 '25 08:12 deathaxe

Is bold/italic rendering probably disabled via "font_options" setting?

I don't think so. You can see in the screenshot other text rendering bold (other comments, keywords)

dev-dwarf avatar Dec 12 '25 00:12 dev-dwarf