-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathvecchars.go
361 lines (354 loc) · 19.6 KB
/
vecchars.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
package main
import (
"fmt"
"strings"
)
const (
vecCharScale = 0.85
vecCharWidth = 5.270 * vecCharScale // in pts
vecCharHeight = 10.064 * vecCharScale // in pts
)
var vecChars = map[rune]string{
'0': `12.121 5.199 m 12.121 5.344 12.168 5.469 12.27 5.566 c 12.367 5.668 12.488
5.715 12.633 5.715 c 12.777 5.715 12.902 5.668 13 5.566 c 13.102 5.469
13.148 5.344 13.148 5.199 c 13.148 5.055 13.102 4.934 13 4.836 c 12.902
4.734 12.777 4.688 12.633 4.688 c 12.488 4.688 12.367 4.734 12.27 4.832
c 12.168 4.93 12.121 5.055 12.121 5.199 c h
12.633 7.371 m 12.352 7.371 12.145 7.199 12.016 6.855 c 11.887 6.508 11.82
5.957 11.82 5.199 c 11.82 4.445 11.887 3.895 12.016 3.551 c 12.145 3.203
12.352 3.031 12.633 3.031 c 12.918 3.031 13.125 3.203 13.254 3.551 c 13.383
3.895 13.449 4.445 13.449 5.199 c 13.449 5.957 13.383 6.508 13.254 6.855
c 13.125 7.199 12.918 7.371 12.633 7.371 c h
10.594 5.199 m 10.594 6.27 10.762 7.07 11.102 7.602 c 11.441 8.137 11.953
8.406 12.633 8.406 c 13.316 8.406 13.828 8.141 14.168 7.605 c 14.508 7.074
14.68 6.273 14.68 5.199 c 14.68 4.129 14.508 3.328 14.168 2.797 c 13.828
2.266 13.316 1.996 12.633 1.996 c 11.953 1.996 11.441 2.266 11.102 2.797
c 10.762 3.332 10.594 4.133 10.594 5.199 c h
10.594 5.199 m f`,
'1': `20.859 3.191 m 22.227 3.191 l 22.227 7.199 l 20.957 6.887 l 20.957 7.988
l 22.234 8.293 l 23.414 8.293 l 23.414 3.191 l 24.781 3.191 l 24.781 2.117
l 20.859 2.117 l h
20.859 3.191 m f`,
'2': `31.879 3.191 m 34.484 3.191 l 34.484 2.117 l 30.559 2.117 l 30.559 3.16
l 31.223 3.863 l 32.008 4.699 32.484 5.215 32.652 5.406 c 32.859 5.645
33.008 5.852 33.102 6.035 c 33.191 6.219 33.238 6.402 33.238 6.582 c 33.238
6.855 33.152 7.07 32.984 7.219 c 32.82 7.371 32.582 7.445 32.277 7.445
c 32.059 7.445 31.812 7.402 31.539 7.312 c 31.27 7.227 30.988 7.102 30.691
6.938 c 30.691 8.074 l 30.988 8.18 31.273 8.262 31.555 8.316 c 31.84 8.375
32.113 8.406 32.371 8.406 c 33.027 8.406 33.539 8.25 33.91 7.945 c 34.289
7.641 34.477 7.227 34.477 6.699 c 34.477 6.457 34.434 6.23 34.352 6.02
c 34.27 5.805 34.133 5.57 33.934 5.312 c 33.785 5.125 33.387 4.703 32.727
4.047 c 32.371 3.691 32.09 3.406 31.879 3.191 c h
31.879 3.191 m f`,
'3': `42.355 4.879 m 41.703 4.879 l 41.703 5.957 l 42.355 5.957 l 42.66 5.957
42.895 6.016 43.059 6.133 c 43.227 6.254 43.312 6.426 43.312 6.645 c 43.312
6.871 43.227 7.051 43.059 7.176 c 42.895 7.305 42.66 7.371 42.355 7.371
c 42.125 7.371 41.875 7.34 41.609 7.285 c 41.344 7.227 41.07 7.141 40.785
7.031 c 40.785 8.141 l 41.07 8.227 41.352 8.289 41.625 8.336 c 41.902 8.383
42.168 8.406 42.422 8.406 c 43.074 8.406 43.582 8.262 43.945 7.98 c 44.309
7.695 44.492 7.305 44.492 6.805 c 44.492 6.438 44.387 6.137 44.176 5.902
c 43.969 5.672 43.668 5.52 43.277 5.449 c 43.719 5.371 44.059 5.195 44.289
4.918 c 44.52 4.645 44.637 4.285 44.637 3.84 c 44.637 3.238 44.445 2.785
44.062 2.469 c 43.676 2.156 43.121 1.996 42.387 1.996 c 42.078 1.996 41.77
2.023 41.465 2.078 c 41.164 2.129 40.875 2.203 40.602 2.305 c 40.602 3.438
l 40.859 3.309 41.141 3.207 41.441 3.141 c 41.742 3.074 42.059 3.039 42.387
3.039 c 42.719 3.039 42.98 3.117 43.176 3.266 c 43.367 3.422 43.465 3.629
43.465 3.887 c 43.465 4.203 43.367 4.449 43.176 4.621 c 42.98 4.793 42.707
4.879 42.355 4.879 c h
42.355 4.879 m f`,
'4': `52.957 6.938 m 51.395 4.496 l 52.957 4.496 l h
52.848 8.293 m 54.129 8.293 l 54.129 4.496 l 54.805 4.496 l 54.805 3.449
l 54.129 3.449 l 54.129 2.117 l 52.957 2.117 l 52.957 3.449 l 50.504 3.449
l 50.504 4.633 l h
52.848 8.293 m f`,
'5': `60.883 8.293 m 64.238 8.293 l 64.238 7.219 l 61.871 7.219 l 61.871 6.07
l 61.969 6.109 62.078 6.137 62.191 6.156 c 62.305 6.176 62.422 6.184 62.551
6.184 c 63.164 6.184 63.66 5.992 64.039 5.605 c 64.422 5.219 64.613 4.715
64.613 4.098 c 64.613 3.449 64.406 2.938 63.992 2.559 c 63.578 2.184 63.02
1.996 62.305 1.996 c 62.039 1.996 61.773 2.02 61.504 2.062 c 61.23 2.109
60.957 2.176 60.676 2.262 c 60.676 3.363 l 60.902 3.25 61.137 3.164 61.379
3.105 c 61.621 3.051 61.863 3.023 62.105 3.023 c 62.539 3.023 62.863 3.113
63.09 3.297 c 63.312 3.48 63.422 3.75 63.422 4.098 c 63.422 4.422 63.312
4.68 63.09 4.871 c 62.867 5.066 62.57 5.168 62.203 5.168 c 61.984 5.168
61.766 5.137 61.543 5.082 c 61.324 5.031 61.105 4.949 60.883 4.844 c h
60.883 8.293 m f`,
'6': `72.746 5.211 m 72.48 5.211 72.277 5.113 72.137 4.922 c 72 4.73 71.93 4.453
71.93 4.09 c 71.93 3.73 72 3.453 72.137 3.258 c 72.277 3.07 72.48 2.973
72.746 2.973 c 73.008 2.973 73.211 3.07 73.352 3.258 c 73.496 3.453 73.57
3.73 73.57 4.09 c 73.57 4.453 73.496 4.73 73.352 4.922 c 73.211 5.113 73.008
5.211 72.746 5.211 c h
74.348 8.148 m 74.348 7.039 l 74.129 7.164 73.918 7.258 73.719 7.316 c
73.52 7.379 73.328 7.41 73.141 7.41 c 72.699 7.41 72.363 7.262 72.133 6.965
c 71.902 6.672 71.781 6.234 71.773 5.652 c 71.902 5.832 72.066 5.969 72.27
6.055 c 72.469 6.145 72.707 6.191 72.98 6.191 c 73.539 6.191 73.969 6.016
74.273 5.664 c 74.574 5.312 74.727 4.816 74.727 4.168 c 74.727 3.477 74.555
2.941 74.215 2.559 c 73.875 2.18 73.395 1.988 72.777 1.988 c 72.023 1.988
71.477 2.242 71.133 2.746 c 70.793 3.25 70.625 4.066 70.625 5.191 c 70.625
6.262 70.832 7.062 71.25 7.594 c 71.668 8.129 72.293 8.395 73.125 8.395
c 73.32 8.395 73.516 8.375 73.723 8.336 c 73.93 8.293 74.137 8.23 74.348
8.148 c h
74.348 8.148 m f`,
'7': `80.641 8.293 m 84.551 8.293 l 84.551 7.43 l 82.453 2.117 l 81.207 2.117
l 83.223 7.219 l 80.641 7.219 l h
80.641 8.293 m f`,
'8': `92.633 4.871 m 92.359 4.871 92.141 4.785 91.969 4.613 c 91.801 4.441 91.719
4.215 91.719 3.93 c 91.719 3.645 91.801 3.418 91.969 3.242 c 92.141 3.07
92.359 2.98 92.633 2.98 c 92.906 2.98 93.125 3.07 93.297 3.246 c 93.465
3.422 93.551 3.652 93.551 3.93 c 93.551 4.215 93.469 4.441 93.301 4.613
c 93.133 4.785 92.91 4.871 92.633 4.871 c h
91.727 5.391 m 91.414 5.496 91.176 5.664 91.016 5.895 c 90.852 6.125 90.77
6.41 90.77 6.742 c 90.77 7.254 90.938 7.66 91.27 7.957 c 91.605 8.258 92.059
8.406 92.633 8.406 c 93.211 8.406 93.664 8.258 94 7.957 c 94.332 7.66 94.5
7.254 94.5 6.742 c 94.5 6.41 94.418 6.129 94.262 5.898 c 94.102 5.668 93.867
5.5 93.559 5.391 c 93.902 5.285 94.172 5.098 94.363 4.828 c 94.555 4.559
94.652 4.234 94.652 3.855 c 94.652 3.262 94.477 2.805 94.129 2.48 c 93.777
2.16 93.277 1.996 92.633 1.996 c 91.988 1.996 91.492 2.16 91.141 2.48 c
90.793 2.805 90.617 3.262 90.617 3.855 c 90.617 4.234 90.715 4.562 90.91
4.832 c 91.105 5.102 91.379 5.289 91.727 5.391 c h
91.855 6.645 m 91.855 6.398 91.922 6.207 92.062 6.062 c 92.203 5.922 92.395
5.852 92.633 5.852 c 92.875 5.852 93.066 5.922 93.203 6.062 c 93.344 6.207
93.414 6.398 93.414 6.645 c 93.414 6.883 93.344 7.07 93.203 7.211 c 93.066
7.352 92.875 7.422 92.633 7.422 c 92.395 7.422 92.207 7.352 92.066 7.211
c 91.926 7.07 91.855 6.879 91.855 6.645 c h
91.855 6.645 m f`,
'9': `100.922 2.199 m 100.922 3.312 l 101.141 3.188 101.348 3.094 101.547 3.031
c 101.75 2.973 101.941 2.941 102.129 2.941 c 102.566 2.941 102.902 3.086
103.129 3.379 c 103.363 3.676 103.484 4.113 103.5 4.699 c 103.367 4.52
103.203 4.383 103 4.293 c 102.801 4.203 102.562 4.16 102.285 4.16 c 101.73
4.16 101.301 4.336 100.996 4.688 c 100.695 5.039 100.543 5.539 100.543
6.184 c 100.543 6.871 100.711 7.406 101.051 7.785 c 101.391 8.16 101.871
8.352 102.492 8.352 c 103.246 8.352 103.793 8.098 104.133 7.594 c 104.473
7.094 104.645 6.281 104.645 5.156 c 104.645 4.09 104.438 3.289 104.02 2.754
c 103.602 2.223 102.977 1.957 102.145 1.957 c 101.953 1.957 101.75 1.977
101.543 2.02 c 101.34 2.059 101.133 2.121 100.922 2.199 c h
102.523 5.184 m 102.789 5.184 102.988 5.277 103.125 5.469 c 103.266 5.66
103.336 5.941 103.336 6.305 c 103.336 6.664 103.266 6.941 103.125 7.129
c 102.988 7.324 102.789 7.422 102.523 7.422 c 102.262 7.422 102.055 7.324
101.914 7.129 c 101.773 6.941 101.703 6.664 101.703 6.305 c 101.703 5.941
101.773 5.664 101.914 5.473 c 102.055 5.277 102.262 5.184 102.523 5.184
c h
102.523 5.184 m f`,
'A': `112.633 7.176 m 112.059 4.648 l 113.211 4.648 l h
111.887 8.293 m 113.383 8.293 l 115.051 2.117 l 113.828 2.117 l 113.449
3.645 l 111.812 3.645 l 111.441 2.117 l 110.219 2.117 l h
111.887 8.293 m f`,
'B': `121.781 4.922 m 121.781 3.094 l 122.59 3.094 l 122.98 3.094 123.254 3.16
123.406 3.293 c 123.562 3.426 123.645 3.656 123.645 3.984 c 123.645 4.316
123.562 4.555 123.398 4.703 c 123.234 4.848 122.969 4.922 122.59 4.922
c h
121.781 7.328 m 121.781 5.895 l 122.59 5.895 l 122.902 5.895 123.121 5.949
123.25 6.059 c 123.383 6.168 123.449 6.352 123.449 6.605 c 123.449 6.859
123.379 7.043 123.246 7.156 c 123.113 7.27 122.895 7.328 122.59 7.328 c
h
120.602 8.301 m 122.59 8.301 l 123.277 8.301 123.793 8.172 124.141 7.91
c 124.488 7.648 124.66 7.262 124.66 6.742 c 124.66 6.344 124.559 6.035
124.355 5.812 c 124.152 5.586 123.852 5.457 123.457 5.422 c 123.93 5.375
124.285 5.219 124.52 4.945 c 124.762 4.676 124.879 4.297 124.879 3.812
c 124.879 3.219 124.703 2.785 124.344 2.52 c 123.984 2.25 123.398 2.117
122.59 2.117 c 120.602 2.117 l h
120.602 8.301 m f`,
'C': `134.559 2.297 m 134.363 2.195 134.16 2.121 133.949 2.07 c 133.738 2.023
133.512 1.996 133.277 1.996 c 132.445 1.996 131.809 2.273 131.371 2.82
c 130.93 3.371 130.711 4.164 130.711 5.199 c 130.711 6.238 130.93 7.031
131.371 7.582 c 131.809 8.129 132.445 8.406 133.277 8.406 c 133.512 8.406
133.738 8.379 133.953 8.332 c 134.168 8.281 134.371 8.207 134.559 8.105
c 134.559 6.75 l 134.348 6.941 134.145 7.082 133.945 7.172 c 133.75 7.262
133.547 7.309 133.336 7.309 c 132.891 7.309 132.551 7.129 132.324 6.773
c 132.098 6.422 131.984 5.898 131.984 5.199 c 131.984 4.504 132.098 3.98
132.324 3.625 c 132.551 3.27 132.891 3.094 133.336 3.094 c 133.547 3.094
133.75 3.137 133.945 3.227 c 134.145 3.316 134.348 3.461 134.559 3.652
c h
134.559 2.297 m f`,
'D': `141.871 7.191 m 141.871 3.219 l 142.203 3.219 l 142.684 3.219 143.023 3.367
143.23 3.668 c 143.434 3.973 143.535 4.484 143.535 5.211 c 143.535 5.93
143.434 6.441 143.23 6.742 c 143.023 7.043 142.684 7.191 142.203 7.191
c h
140.648 8.293 m 141.957 8.293 l 142.969 8.293 143.695 8.051 144.141 7.57
c 144.586 7.09 144.805 6.305 144.805 5.211 c 144.805 4.117 144.586 3.328
144.141 2.84 c 143.695 2.359 142.969 2.117 141.957 2.117 c 140.648 2.117
l h
140.648 8.293 m f`,
'E': `154.629 2.117 m 150.777 2.117 l 150.777 8.293 l 154.629 8.293 l 154.629
7.219 l 152 7.219 l 152 5.887 l 154.379 5.887 l 154.379 4.809 l 152 4.809
l 152 3.191 l 154.629 3.191 l h
154.629 2.117 m f`,
'F': `164.688 7.219 m 162.059 7.219 l 162.059 5.887 l 164.449 5.887 l 164.449
4.809 l 162.059 4.809 l 162.059 2.117 l 160.836 2.117 l 160.836 8.293 l
164.688 8.293 l h
164.688 7.219 m f`,
'G': `173.691 3.234 m 173.691 4.414 l 172.855 4.414 l 172.855 5.438 l 174.762
5.438 l 174.762 2.609 l 174.527 2.41 174.266 2.254 173.984 2.152 c 173.699
2.047 173.398 1.996 173.074 1.996 c 172.277 1.996 171.656 2.273 171.223
2.828 c 170.785 3.387 170.566 4.176 170.566 5.199 c 170.566 6.238 170.785
7.031 171.227 7.582 c 171.668 8.129 172.305 8.406 173.133 8.406 c 173.383
8.406 173.625 8.367 173.867 8.297 c 174.105 8.227 174.332 8.129 174.543
7.996 c 174.543 6.645 l 174.371 6.863 174.172 7.027 173.949 7.141 c 173.73
7.254 173.484 7.309 173.223 7.309 c 172.758 7.309 172.41 7.133 172.184
6.785 c 171.953 6.438 171.84 5.906 171.84 5.199 c 171.84 4.512 171.949 3.988
172.168 3.633 c 172.391 3.273 172.711 3.094 173.133 3.094 c 173.262 3.094
173.371 3.105 173.465 3.125 c 173.559 3.152 173.633 3.188 173.691 3.234
c h
173.691 3.234 m f`,
'H': `180.648 8.293 m 181.871 8.293 l 181.871 5.941 l 183.398 5.941 l 183.398
8.293 l 184.621 8.293 l 184.621 2.117 l 183.398 2.117 l 183.398 4.863 l
181.871 4.863 l 181.871 2.117 l 180.648 2.117 l h
180.648 8.293 m f`,
'I': `190.793 7.219 m 190.793 8.293 l 194.477 8.293 l 194.477 7.219 l 193.246
7.219 l 193.246 3.191 l 194.477 3.191 l 194.477 2.117 l 190.793 2.117 l
190.793 3.191 l 192.023 3.191 l 192.023 7.219 l h
190.793 7.219 m f`,
'J': `200.535 2.422 m 200.535 3.84 l 200.77 3.594 201.023 3.41 201.293 3.285
c 201.562 3.156 201.832 3.094 202.105 3.094 c 202.426 3.094 202.66 3.172
202.812 3.332 c 202.961 3.492 203.035 3.75 203.035 4.098 c 203.035 7.219
l 201.539 7.219 l 201.539 8.293 l 204.254 8.293 l 204.254 4.098 l 204.254
3.348 204.098 2.809 203.781 2.48 c 203.465 2.16 202.945 1.996 202.219 1.996
c 201.957 1.996 201.684 2.035 201.395 2.105 c 201.109 2.176 200.824 2.281
200.535 2.422 c h
200.535 2.422 m f`,
'K': `210.566 8.293 m 211.789 8.293 l 211.789 5.852 l 213.699 8.293 l 215.082
8.293 l 213.133 5.859 l 215.152 2.117 l 213.797 2.117 l 212.332 4.898 l
211.789 4.211 l 211.789 2.117 l 210.566 2.117 l h
210.566 8.293 m f`,
'L': `221.016 2.117 m 221.016 8.293 l 222.234 8.293 l 222.234 3.191 l 224.848
3.191 l 224.848 2.117 l h
221.016 2.117 m f`,
'M': `230.438 8.293 m 231.895 8.293 l 232.633 5.582 l 233.367 8.293 l 234.832
8.293 l 234.832 2.117 l 233.781 2.117 l 233.781 7.066 l 233.125 4.363 l
232.152 4.363 l 231.492 7.066 l 231.492 2.117 l 230.438 2.117 l h
230.438 8.293 m f`,
'N': `240.574 8.293 m 241.887 8.293 l 243.609 3.805 l 243.609 8.293 l 244.688
8.293 l 244.688 2.117 l 243.383 2.117 l 241.652 6.605 l 241.652 2.117 l
240.574 2.117 l h
240.574 8.293 m f`,
'O': `252.633 7.309 m 252.32 7.309 252.094 7.141 251.949 6.809 c 251.805 6.477
251.734 5.941 251.734 5.199 c 251.734 4.461 251.805 3.922 251.949 3.59
c 252.094 3.258 252.32 3.094 252.633 3.094 c 252.949 3.094 253.176 3.258
253.32 3.59 c 253.465 3.922 253.535 4.461 253.535 5.199 c 253.535 5.941
253.465 6.477 253.32 6.809 c 253.176 7.141 252.949 7.309 252.633 7.309
c h
250.465 5.199 m 250.465 6.254 250.645 7.055 251.012 7.594 c 251.379 8.133
251.918 8.406 252.633 8.406 c 253.352 8.406 253.891 8.133 254.254 7.594
c 254.621 7.055 254.805 6.254 254.805 5.199 c 254.805 4.145 254.621 3.348
254.254 2.809 c 253.891 2.27 253.352 1.996 252.633 1.996 c 251.918 1.996
251.379 2.27 251.012 2.809 c 250.645 3.348 250.465 4.145 250.465 5.199
c h
250.465 5.199 m f`,
'P': `261.977 7.266 m 261.977 5.457 l 262.477 5.457 l 262.875 5.457 263.156 5.523
263.316 5.656 c 263.48 5.793 263.559 6.027 263.559 6.363 c 263.559 6.695
263.48 6.93 263.316 7.066 c 263.156 7.199 262.875 7.266 262.477 7.266 c
h
260.754 8.293 m 262.43 8.293 l 263.281 8.293 263.895 8.141 264.27 7.84
c 264.645 7.535 264.832 7.043 264.832 6.363 c 264.832 5.68 264.645 5.188
264.27 4.883 c 263.895 4.582 263.281 4.43 262.43 4.43 c 261.977 4.43 l
261.977 2.117 l 260.754 2.117 l h
260.754 8.293 m f`,
'Q': `272.797 2.023 m 272.762 2.016 272.727 2.008 272.699 2.004 c 272.676 2 272.648
1.996 272.625 1.996 c 271.914 1.996 271.379 2.27 271.012 2.809 c 270.645
3.348 270.465 4.145 270.465 5.199 c 270.465 6.254 270.645 7.055 271.012
7.594 c 271.379 8.133 271.918 8.406 272.633 8.406 c 273.352 8.406 273.891
8.133 274.254 7.594 c 274.621 7.055 274.805 6.254 274.805 5.199 c 274.805
4.473 274.719 3.867 274.547 3.375 c 274.371 2.887 274.117 2.539 273.789
2.328 c 274.559 1.574 l 273.723 0.957 l h
272.633 7.309 m 272.32 7.309 272.094 7.141 271.949 6.809 c 271.805 6.477
271.734 5.941 271.734 5.199 c 271.734 4.461 271.805 3.922 271.949 3.59
c 272.094 3.258 272.32 3.094 272.633 3.094 c 272.949 3.094 273.176 3.258
273.32 3.59 c 273.465 3.922 273.535 4.461 273.535 5.199 c 273.535 5.941
273.465 6.477 273.32 6.809 c 273.176 7.141 272.949 7.309 272.633 7.309
c h
272.633 7.309 m f`,
'R': `283.422 5.035 m 283.547 5.008 283.648 4.949 283.738 4.859 c 283.828 4.773
283.941 4.598 284.07 4.34 c 285.188 2.117 l 283.848 2.117 l 283.102 3.676
l 283.078 3.723 283.051 3.781 283.016 3.859 c 282.797 4.324 282.539 4.559
282.242 4.559 c 281.855 4.559 l 281.855 2.117 l 280.633 2.117 l 280.633
8.293 l 282.398 8.293 l 283.191 8.293 283.762 8.152 284.105 7.871 c 284.453
7.59 284.629 7.133 284.629 6.496 c 284.629 6.074 284.523 5.734 284.316
5.484 c 284.109 5.234 283.812 5.082 283.422 5.035 c h
281.855 7.266 m 281.855 5.582 l 282.43 5.582 l 282.766 5.582 283.004 5.648
283.145 5.777 c 283.293 5.91 283.367 6.125 283.367 6.426 c 283.367 6.727
283.293 6.941 283.148 7.074 c 283.008 7.203 282.766 7.266 282.43 7.266
c h
281.855 7.266 m f`,
'S': `292.195 4.828 m 291.578 5.062 291.16 5.305 290.945 5.562 c 290.727 5.82
290.617 6.168 290.617 6.605 c 290.617 7.164 290.797 7.605 291.156 7.926
c 291.516 8.246 292.008 8.406 292.633 8.406 c 292.918 8.406 293.203 8.371
293.484 8.305 c 293.77 8.242 294.051 8.148 294.332 8.02 c 294.332 6.828
l 294.066 7.012 293.801 7.152 293.531 7.25 c 293.262 7.348 292.992 7.395
292.727 7.395 c 292.434 7.395 292.207 7.336 292.051 7.219 c 291.891 7.098
291.812 6.93 291.812 6.707 c 291.812 6.539 291.871 6.395 291.984 6.281
c 292.098 6.172 292.34 6.051 292.703 5.914 c 293.23 5.715 l 293.727 5.535
294.09 5.293 294.324 4.992 c 294.562 4.691 294.68 4.312 294.68 3.855 c
294.68 3.23 294.492 2.766 294.125 2.457 c 293.758 2.152 293.199 1.996 292.453
1.996 c 292.148 1.996 291.84 2.035 291.531 2.109 c 291.227 2.18 290.93
2.289 290.641 2.434 c 290.641 3.695 l 290.969 3.461 291.281 3.289 291.586
3.176 c 291.891 3.062 292.195 3.008 292.492 3.008 c 292.793 3.008 293.027
3.074 293.191 3.211 c 293.355 3.348 293.441 3.539 293.441 3.785 c 293.441
3.969 293.387 4.129 293.273 4.27 c 293.164 4.41 293.004 4.52 292.793 4.598
c h
292.195 4.828 m f`,
'T': `303.246 2.117 m 302.023 2.117 l 302.023 7.227 l 300.457 7.227 l 300.457
8.293 l 304.816 8.293 l 304.816 7.227 l 303.246 7.227 l h
303.246 2.117 m f`,
'U': `310.523 4.398 m 310.523 8.293 l 311.742 8.293 l 311.742 4.09 l 311.742
3.781 311.82 3.539 311.98 3.363 c 312.137 3.188 312.355 3.102 312.633 3.102
c 312.91 3.102 313.129 3.188 313.285 3.363 c 313.445 3.539 313.523 3.781
313.523 4.09 c 313.523 8.293 l 314.742 8.293 l 314.742 4.398 l 314.742
3.559 314.578 2.949 314.242 2.566 c 313.91 2.188 313.371 1.996 312.633 1.996
c 311.895 1.996 311.359 2.188 311.023 2.566 c 310.688 2.949 310.523 3.559
310.523 4.398 c h
310.523 4.398 m f`,
'V': `322.633 3.137 m 323.723 8.293 l 324.949 8.293 l 323.48 2.117 l 321.789
2.117 l 320.32 8.293 l 321.547 8.293 l h
322.633 3.137 m f`,
'W': `330.082 8.293 m 331.152 8.293 l 331.594 3.762 l 332.129 6.691 l 333.141
6.691 l 333.762 3.762 l 334.109 8.293 l 335.188 8.293 l 334.477 2.117 l
333.336 2.117 l 332.633 5.359 l 331.977 2.117 l 330.844 2.117 l h
330.082 8.293 m f`,
'X': `345.074 2.117 m 343.812 2.117 l 342.633 4.16 l 341.457 2.117 l 340.195
2.117 l 342.008 5.254 l 340.246 8.293 l 341.508 8.293 l 342.633 6.328 l
343.762 8.293 l 345.027 8.293 l 343.27 5.254 l h
345.074 2.117 m f`,
'Y': `350.117 8.293 m 351.434 8.293 l 352.633 5.812 l 353.836 8.293 l 355.152
8.293 l 353.246 4.551 l 353.246 2.117 l 352.023 2.117 l 352.023 4.551 l
h
350.117 8.293 m f`,
'Z': `360.648 8.293 m 364.832 8.293 l 364.832 7.285 l 361.965 3.191 l 364.891
3.191 l 364.891 2.117 l 360.559 2.117 l 360.559 3.125 l 363.336 7.219 l
360.648 7.219 l h
360.648 8.293 m f`,
}
// strToVecChars returns PDF graphics command stream making up the
// characters given with the specified alignment. A negative align value
// indicates top/right aligned. A zero value indicates center and a
// positive value indicates right/bottom aligned.
func strToVecChars(s string, hAlign, vAlign int) string {
b := &strings.Builder{}
// alignments
var hOff, vOff float32
if hAlign == 0 { // center
hOff = float32(len(s)) * vecCharWidth / 2
} else if hAlign < 0 { // right
hOff = float32(len(s)) * vecCharWidth
}
if vAlign == 0 { // center
vOff = vecCharHeight / 2
} else if vAlign < 0 { // bottom
vOff = vecCharHeight
}
b.WriteString(fmt.Sprintf(" q 1 0 0 1 -%f -%f cm ", hOff, vOff))
for i, c := range s {
v := vecChars[rune(c)]
if v == "" {
continue
}
b.WriteString(fmt.Sprintf(" q 1 0 0 1 %f 0 cm %s Q ", float32(i)*vecCharWidth, v))
}
b.WriteString(" Q ")
return b.String()
}
func init() {
ci := "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for c, v := range vecChars {
vecChars[c] = fmt.Sprintf("q %f 0 0 %f 0 0 cm 1 0 0 1 -%d 0 cm %s Q",
vecCharScale, vecCharScale, (strings.IndexRune(ci, c)+1)*10, v)
}
}