Nov 2, 2013 at 10:51 AM
Edited Nov 3, 2013 at 8:33 AM
I was looking at the Default.XLM file in the configuration directory. It seems that someone wanted to standardize the the Style names (and that sounds perfectly logical
). Out of curiosity I dumped all the styles from the built in languages to
compare them. There are a total of 1907. I sorted these by the style numbers. I note that there is limited consistency in the use of the styles between various languages. It is most consistent at the top and bottom ends but in the middle there are a great
number of variations.
At the bottom end "style0" is consistently refered to as "DEFAULT" or "DOCUMENT_DEFAULT" except for the following:
Hypertext, PhpScript and Xml refer to it as "HTML.DOCUMENT_DEFAULT".
Mmixal refers to it as "LEADWS"
Opal refers to it as "SPACE"
They do all use the same attributes (Font, size, color, etc).
After that all bets are off.
Style1 has several colors and a range of names.
(Specman uses style1 with a red foreground on a red background ... that has got to be hard to read.)
Anyway I came to the conclusion that anyone wants to standardize the Stylenames then they will want to consider the amount of effort that is going to be required to rewrite all the language configurations as well.
The other thing that this wild goose chase revealed is the only built in language that does not use a Lexer by the same name is XML which uses the "hypertext" lexer.
I do not see any way to attach a file so I will make this file available on my Web site temporarily for anyone that is interested:
This is the VB 2010 code used to extract the information:
Private Sub Button6_Click(sender As System.Object, e As System.EventArgs) Handles Button6.Click
' The idea here is to write all style to and file so that we can compare them
' The file will be tab delimited and conatained a header line
' It is intended to be loaded into a spreadsheet
Dim Languages() As String = [Enum].GetNames(GetType(ScintillaNET.Lexer))
For Each Lang In Languages
Dim I, J, K As Integer
Dim H, T As String
Dim N As Integer
MyTop = 0
Dim FileName As String = "C:\Tempwork\StyleList.txt"
' Header Line
H = "Language" & vbTab & "Lexer" & vbTab & "Style No" & vbTab & "Style Name" & vbTab & "Font Name" & vbTab & "Charater Set" & vbTab & _
"Font Size" & vbTab & "Bold" & vbTab & "Italic" & vbTab & "Under Line" & vbTab & "Case" & vbTab & "Back Color" & vbTab & _
"Fore Color" & vbTab & "Visibile" & vbTab & "EOL Filled" & vbCrLf
' Overwrite file
My.Computer.FileSystem.WriteAllText(FileName, H, False)
For I = 0 To ComboBox1.Items.Count - 1
H = ComboBox1.Items(I).ToString
Scintilla1.ConfigurationManager.Language = H
H = H & vbTab & Scintilla1.Lexing.LexerName
N = Scintilla1.Lexing.StyleNameMap.Count
For J = 0 To N - 1
' Style Number and Name
K = Val(Scintilla1.Lexing.StyleNameMap.Values(J).ToString)
T = H & vbTab & Str(K)
T = T & vbTab & Scintilla1.Lexing.StyleNameMap.Keys(J).ToString
' Style properties
T = T & vbTab & Scintilla1.Styles(K).FontName.ToString
T = T & vbTab & Scintilla1.Styles(K).CharacterSet.ToString
T = T & vbTab & Scintilla1.Styles(K).Size.ToString
T = T & vbTab & Scintilla1.Styles(K).Bold.ToString
T = T & vbTab & Scintilla1.Styles(K).Italic.ToString
T = T & vbTab & Scintilla1.Styles(K).Underline.ToString
T = T & vbTab & Scintilla1.Styles(K).Case.ToString
T = T & vbTab & Scintilla1.Styles(K).BackColor.ToString
T = T & vbTab & Scintilla1.Styles(K).ForeColor.ToString
T = T & vbTab & Scintilla1.Styles(K).IsVisible.ToString
T = T & vbTab & Scintilla1.Styles(K).IsSelectionEolFilled.ToString
' append to file
My.Computer.FileSystem.WriteAllText(FileName, T & vbCrLf, True)
but seeing as I am trying to figure the XLM stuff out I did create default.xlm files with all the attributes filled in. See the issue labeled "default.xml (attributes filled in)". It has the zip file (with source code of course) attached.