/
typeFont.go
189 lines (165 loc) · 2.67 KB
/
typeFont.go
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
package html
import (
"strconv"
"strings"
)
type Font struct {
//Style
//
// English:
//
// Specifies the font style.
//
// Português:
//
// Especifica o estilo da fonte.
Style FontStyleRule
// Variant
//
// English:
//
// Specifies the font variant.
//
// Português:
//
// Especifica a variante da fonte.
Variant FontVariantRule
// Weight
//
// English:
//
// Specifies the font weight.
//
// Português:
//
// Especifica o peso da fonte.
Weight FontWeightRule
// Size
//
// English:
//
// Specifies the font size and the line-height, in pixels.
//
// Português:
//
// Especifica o tamanho da fonte e a altura da linha, em pixels.
Size int
// Family
//
// English:
//
// Specifies the font family.
//
// Português:
//
// Especifica a família de fontes.
Family string
// Caption
//
// English:
//
// Use the font captioned controls (like buttons, drop-downs, etc.)
//
// Português:
//
// Use os controles legendados de fonte (como botões, menus suspensos etc.)
Caption string
// Icon
//
// English:
//
// Use the font used to label icons.
//
// Português:
//
// Use a fonte usada para rotular os ícones.
Icon string
// Menu
//
// English:
//
// Use the font used in menus (drop-down menus and menu lists).
//
// Português:
//
// Use a fonte usada nos menus (menus suspensos e listas de menus).
Menu string
// MessageBox
//
// English:
//
// Use the font used in dialog boxes.
//
// Português:
//
// Use a fonte usada nas caixas de diálogo.
MessageBox string
// SmallCaption
//
// English:
//
// Use the font used for labeling small controls.
//
// Português:
//
// Use a fonte usada para rotular pequenos controles.
SmallCaption string
// StatusBar
//
// English:
//
// Use the fonts used in window status bar.
//
// Português:
//
// Use as fontes usadas na barra de status da janela.
StatusBar string
}
func (e *Font) String() string {
var ret string
if e.Style != "" {
ret += e.Style.String()
ret += " "
}
if e.Variant != "" {
ret += e.Variant.String()
ret += " "
}
if e.Weight != "" {
ret += e.Weight.String()
ret += " "
}
if e.Size != 0 {
ret += strconv.FormatInt(int64(e.Size), 10)
ret += "px "
}
if e.Family != "" {
ret += e.Family
ret += " "
}
if e.Caption != "" {
ret += e.Caption
ret += " "
}
if e.Icon != "" {
ret += e.Icon
ret += " "
}
if e.Menu != "" {
ret += e.Menu
ret += " "
}
if e.MessageBox != "" {
ret += e.MessageBox
ret += " "
}
if e.SmallCaption != "" {
ret += e.SmallCaption
ret += " "
}
if e.StatusBar != "" {
ret += e.StatusBar
ret += " "
}
return strings.TrimSpace(ret)
}