The styles are registered by id, usually they are used by lexers, but also there are some predefined ids that you can set to modify the appearence of the text.
There are 256 lexer styles that you can set (0-255), I suggest you to use the highest numbers because low numbers are usually used by lexers.
The default styles ids starts from 32 and control standard text behaviour and appeareance:
Attribute | Id | Description |
---|---|---|
default | 32 |
|
linenumber | 33 | This style sets the attributes of the text used to display line numbers in a line number margin. |
bracelight | 34 | This style sets the attributes used when highlighting braces with the gtkscintilla.Scintilla.brace_hightlight() and when highlighting thecorresponding indentation set_highlight_guide. |
bracebad | 35 | This style sets the display attributes used when marking an unmatched brace with the gtkscintilla.Scintilla.brace_badlight() method. |
controlchar | 36 | This style sets the font used when drawing control characters. Only the font, size, bold, italics, and character set attributes are used and not the colour attributes. |
indentguide | 37 | This style sets the foreground and background colours used when drawing the indentation guides. |
calltip | 38 | Call tips normally use the font attributes defined by default. Use of gtkscintilla.Scintilla.calltip_use_style() causes call tips to use this style instead. Only the font face name, font size, foreground and background colours and character set attributes are used. |
lastpredefined | 39 | To make it easier for client code to discover the range of styles that are predefined, this is set to the style number of the last predefined style. This is currently set to 39 and the last style with an identifier is 38, which reserves space for one future predefined style. |
For each style you can set the font name, size and use of bold, italic and underline, foreground and background colour and the character set. You can also choose to hide text with a given style, display all characters as upper or lower case and fill from the last character on a line to the end of the line (for embedded languages). There is also an experimental attribute to make text read-only.
This methods assigns to the id the text style specified or by a stylesp TextStyle instance, or by simple kwargs. It’s simpler with an example:
>>> s = Scintilla()
>>> ts = TextStyle(color = "blue", font = "!Bitstream Vera")
>>> s.set_style(2, ts)
>>> s.set_style(1, color = "#000fff", italics=True)
They’re equivalent. The get_style returns a TextStyle instance.
Here the complete specification of text styles:
Parameters: |
|
---|