-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmakerFonts.py
executable file
·126 lines (123 loc) · 4.31 KB
/
makerFonts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import wx
def getFaces():
if wx.Platform == "__WXMSW__":
faces = {
"times": "Times New Roman",
"mono": "Courier New",
"helv": "Arial",
"other": "Comic Sans MS",
"size": 10,
"size2": 8,
}
elif wx.Platform == "__WXMAC__":
faces = {
"times": "Times New Roman",
"mono": "Courier New",
"helv": "Arial",
"other": "Comic Sans MS",
"size": 13,
"size2": 10,
}
else:
faces = {
"times": "Times",
"mono": "Courier",
"helv": "Helvetica",
"other": "new century schoolbook",
"size": 12,
"size2": 10,
}
return faces
def styleTextCtrl(textCtrlToStyle):
faces = getFaces()
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_STYLE_DEFAULT, "face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleClearAll() # Reset all to be like the default
# Global default styles for all languages
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_STYLE_DEFAULT, "fore:#000000,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_STYLE_LINENUMBER,
"back:#C0C0C0,face:%(other)s,size:%(size2)d" % faces,
)
textCtrlToStyle.StyleSetSpec(wx.stc.STC_STYLE_CONTROLCHAR, "face:%(other)s" % faces)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_STYLE_BRACELIGHT, "fore:#FFFFFF,back:#0000FF,bold"
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_STYLE_BRACEBAD, "fore:#000000,back:#FF0000,bold"
)
# Python styles
# Default
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_DEFAULT, "fore:#000000,face:%(other)s,size:%(size)d" % faces
)
# HTML tags
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_TAG, "fore:#882288,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_ATTRIBUTE, "fore:#993300,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_ATTRIBUTEUNKNOWN,
"fore:#993300,face:%(other)s,size:%(size)d" % faces,
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_TAGEND, "fore:#993399,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_OTHER, "fore:#882288,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_COMMENT, "fore:#006600,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_SINGLESTRING, "fore:#2200bb,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_DOUBLESTRING, "fore:#2200bb,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_H_NUMBER, "fore:#00ff00,face:%(other)s,size:%(size)d" % faces
)
# php
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_DEFAULT, "fore:#2200bb,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_COMMENT, "fore:#aa0000,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_COMMENTLINE, "fore:#00aa00,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_HSTRING, "fore:#aa0000,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_HSTRING_VARIABLE,
"fore:#000000,face:%(other)s,size:%(size)d" % faces,
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_NUMBER, "fore:#aa0000,face:%(other)s,size:%(size)d" % faces
)
# {} () =
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_OPERATOR, "fore:#000000,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_SIMPLESTRING,
"fore:#2244bb,face:%(other)s,size:%(size)d" % faces,
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_VARIABLE, "fore:#993300,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.StyleSetSpec(
wx.stc.STC_HPHP_WORD, "fore:#ff0000,face:%(other)s,size:%(size)d" % faces
)
textCtrlToStyle.SetCaretForeground("BLUE")
textCtrlToStyle.SetMarginWidth(0, 30)
textCtrlToStyle.SetMarginWidth(1, 0)
textCtrlToStyle.SetMarginType(0, 1)