David PHAM-VAN

Improve font bounds calculation

Too many changes to show.

To preserve performance only 10 of 10+ files are displayed.

1 # 1.3.3 1 # 1.3.3
2 * Fix dart lint warnings 2 * Fix dart lint warnings
  3 +* Improve font bounds calculation
3 4
4 # 1.3.2 5 # 1.3.2
5 * Update Readme 6 * Update Readme
@@ -34,6 +34,7 @@ part 'src/compatibility.dart'; @@ -34,6 +34,7 @@ part 'src/compatibility.dart';
34 part 'src/document.dart'; 34 part 'src/document.dart';
35 part 'src/font.dart'; 35 part 'src/font.dart';
36 part 'src/font_descriptor.dart'; 36 part 'src/font_descriptor.dart';
  37 +part 'src/font_metrics.dart';
37 part 'src/formxobject.dart'; 38 part 'src/formxobject.dart';
38 part 'src/graphics.dart'; 39 part 'src/graphics.dart';
39 part 'src/image.dart'; 40 part 'src/image.dart';
@@ -52,5 +53,6 @@ part 'src/stream.dart'; @@ -52,5 +53,6 @@ part 'src/stream.dart';
52 part 'src/ttf_parser.dart'; 53 part 'src/ttf_parser.dart';
53 part 'src/ttffont.dart'; 54 part 'src/ttffont.dart';
54 part 'src/type1_font.dart'; 55 part 'src/type1_font.dart';
  56 +part 'src/type1_fonts.dart';
55 part 'src/xobject.dart'; 57 part 'src/xobject.dart';
56 part 'src/xref.dart'; 58 part 'src/xref.dart';
@@ -128,6 +128,11 @@ class PDFFont extends PdfFont { @@ -128,6 +128,11 @@ class PDFFont extends PdfFont {
128 subtype ??= baseFont; 128 subtype ??= baseFont;
129 return PdfFont.helvetica(pdfDocument); 129 return PdfFont.helvetica(pdfDocument);
130 } 130 }
  131 +
  132 + @override
  133 + PdfFontMetrics glyphMetrics(int charCode) {
  134 + return PdfFontMetrics.zero;
  135 + }
131 } 136 }
132 137
133 @deprecated 138 @deprecated
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 16
17 part of pdf; 17 part of pdf;
18 18
19 -class PdfFont extends PdfObject { 19 +abstract class PdfFont extends PdfObject {
20 /// Constructs a [PdfFont]. This will attempt to map the font from a known 20 /// Constructs a [PdfFont]. This will attempt to map the font from a known
21 /// font name to that in Pdf, defaulting to Helvetica if not possible. 21 /// font name to that in Pdf, defaulting to Helvetica if not possible.
22 /// 22 ///
@@ -24,2647 +24,79 @@ class PdfFont extends PdfObject { @@ -24,2647 +24,79 @@ class PdfFont extends PdfObject {
24 /// @param subtype The pdf type, ie /Type1 24 /// @param subtype The pdf type, ie /Type1
25 /// @param baseFont The font name, ie /Helvetica 25 /// @param baseFont The font name, ie /Helvetica
26 PdfFont._create(PdfDocument pdfDocument, {@required this.subtype}) 26 PdfFont._create(PdfDocument pdfDocument, {@required this.subtype})
27 - : super(pdfDocument, '/Font') { 27 + : assert(subtype != null),
  28 + super(pdfDocument, '/Font') {
28 pdfDocument.fonts.add(this); 29 pdfDocument.fonts.add(this);
29 } 30 }
30 31
31 factory PdfFont.courier(PdfDocument pdfDocument) { 32 factory PdfFont.courier(PdfDocument pdfDocument) {
32 - return PdfType1Font._create(pdfDocument, 'Courier', 0.910, -0.220,  
33 - List<double>.generate(256, (int index) => 0.600)); 33 + return PdfType1Font._create(
  34 + pdfDocument, 'Courier', 0.910, -0.220, const <double>[]);
34 } 35 }
35 36
36 factory PdfFont.courierBold(PdfDocument pdfDocument) { 37 factory PdfFont.courierBold(PdfDocument pdfDocument) {
37 - return PdfType1Font._create(pdfDocument, 'Courier-Bold', 0.910, -0.220,  
38 - List<double>.generate(256, (int index) => 0.600)); 38 + return PdfType1Font._create(
  39 + pdfDocument, 'Courier-Bold', 0.910, -0.220, const <double>[]);
39 } 40 }
40 41
41 factory PdfFont.courierBoldOblique(PdfDocument pdfDocument) { 42 factory PdfFont.courierBoldOblique(PdfDocument pdfDocument) {
42 - return PdfType1Font._create(pdfDocument, 'Courier-BoldOblique', 0.910,  
43 - -0.220, List<double>.generate(256, (int index) => 0.600)); 43 + return PdfType1Font._create(
  44 + pdfDocument, 'Courier-BoldOblique', 0.910, -0.220, const <double>[]);
44 } 45 }
45 46
46 factory PdfFont.courierOblique(PdfDocument pdfDocument) { 47 factory PdfFont.courierOblique(PdfDocument pdfDocument) {
47 - return PdfType1Font._create(pdfDocument, 'Courier-Oblique', 0.910, -0.220,  
48 - List<double>.generate(256, (int index) => 0.600)); 48 + return PdfType1Font._create(
  49 + pdfDocument, 'Courier-Oblique', 0.910, -0.220, const <double>[]);
49 } 50 }
50 51
51 factory PdfFont.helvetica(PdfDocument pdfDocument) { 52 factory PdfFont.helvetica(PdfDocument pdfDocument) {
52 return PdfType1Font._create( 53 return PdfType1Font._create(
53 - pdfDocument, 'Helvetica', 0.931, -0.225, const <double>[  
54 - 0.500,  
55 - 0.500,  
56 - 0.500,  
57 - 0.500,  
58 - 0.500,  
59 - 0.500,  
60 - 0.500,  
61 - 0.500,  
62 - 0.500,  
63 - 0.500,  
64 - 0.500,  
65 - 0.500,  
66 - 0.500,  
67 - 0.500,  
68 - 0.500,  
69 - 0.500,  
70 - 0.500,  
71 - 0.500,  
72 - 0.500,  
73 - 0.500,  
74 - 0.500,  
75 - 0.500,  
76 - 0.500,  
77 - 0.500,  
78 - 0.500,  
79 - 0.500,  
80 - 0.500,  
81 - 0.500,  
82 - 0.500,  
83 - 0.500,  
84 - 0.500,  
85 - 0.500,  
86 - 0.278,  
87 - 0.278,  
88 - 0.355,  
89 - 0.556,  
90 - 0.556,  
91 - 0.889,  
92 - 0.667,  
93 - 0.191,  
94 - 0.333,  
95 - 0.333,  
96 - 0.389,  
97 - 0.584,  
98 - 0.278,  
99 - 0.333,  
100 - 0.278,  
101 - 0.278,  
102 - 0.556,  
103 - 0.556,  
104 - 0.556,  
105 - 0.556,  
106 - 0.556,  
107 - 0.556,  
108 - 0.556,  
109 - 0.556,  
110 - 0.556,  
111 - 0.556,  
112 - 0.278,  
113 - 0.278,  
114 - 0.584,  
115 - 0.584,  
116 - 0.584,  
117 - 0.556,  
118 - 1.015,  
119 - 0.667,  
120 - 0.667,  
121 - 0.722,  
122 - 0.722,  
123 - 0.667,  
124 - 0.611,  
125 - 0.778,  
126 - 0.722,  
127 - 0.278,  
128 - 0.500,  
129 - 0.667,  
130 - 0.556,  
131 - 0.833,  
132 - 0.722,  
133 - 0.778,  
134 - 0.667,  
135 - 0.778,  
136 - 0.722,  
137 - 0.667,  
138 - 0.611,  
139 - 0.722,  
140 - 0.667,  
141 - 0.944,  
142 - 0.667,  
143 - 0.667,  
144 - 0.611,  
145 - 0.278,  
146 - 0.278,  
147 - 0.277,  
148 - 0.469,  
149 - 0.556,  
150 - 0.333,  
151 - 0.556,  
152 - 0.556,  
153 - 0.500,  
154 - 0.556,  
155 - 0.556,  
156 - 0.278,  
157 - 0.556,  
158 - 0.556,  
159 - 0.222,  
160 - 0.222,  
161 - 0.500,  
162 - 0.222,  
163 - 0.833,  
164 - 0.556,  
165 - 0.556,  
166 - 0.556,  
167 - 0.556,  
168 - 0.333,  
169 - 0.500,  
170 - 0.278,  
171 - 0.556,  
172 - 0.500,  
173 - 0.722,  
174 - 0.500,  
175 - 0.500,  
176 - 0.500,  
177 - 0.334,  
178 - 0.260,  
179 - 0.334,  
180 - 0.584,  
181 - 0.500,  
182 - 0.655,  
183 - 0.500,  
184 - 0.222,  
185 - 0.278,  
186 - 0.333,  
187 - 1.000,  
188 - 0.556,  
189 - 0.556,  
190 - 0.333,  
191 - 1.000,  
192 - 0.667,  
193 - 0.250,  
194 - 1.000,  
195 - 0.500,  
196 - 0.611,  
197 - 0.500,  
198 - 0.500,  
199 - 0.222,  
200 - 0.221,  
201 - 0.333,  
202 - 0.333,  
203 - 0.350,  
204 - 0.556,  
205 - 1.000,  
206 - 0.333,  
207 - 1.000,  
208 - 0.500,  
209 - 0.250,  
210 - 0.938,  
211 - 0.500,  
212 - 0.500,  
213 - 0.667,  
214 - 0.278,  
215 - 0.278,  
216 - 0.556,  
217 - 0.556,  
218 - 0.556,  
219 - 0.556,  
220 - 0.260,  
221 - 0.556,  
222 - 0.333,  
223 - 0.737,  
224 - 0.370,  
225 - 0.448,  
226 - 0.584,  
227 - 0.333,  
228 - 0.737,  
229 - 0.333,  
230 - 0.606,  
231 - 0.584,  
232 - 0.350,  
233 - 0.350,  
234 - 0.333,  
235 - 0.556,  
236 - 0.537,  
237 - 0.278,  
238 - 0.333,  
239 - 0.350,  
240 - 0.365,  
241 - 0.448,  
242 - 0.869,  
243 - 0.869,  
244 - 0.879,  
245 - 0.556,  
246 - 0.667,  
247 - 0.667,  
248 - 0.667,  
249 - 0.667,  
250 - 0.667,  
251 - 0.667,  
252 - 1.000,  
253 - 0.722,  
254 - 0.667,  
255 - 0.667,  
256 - 0.667,  
257 - 0.667,  
258 - 0.278,  
259 - 0.278,  
260 - 0.278,  
261 - 0.278,  
262 - 0.722,  
263 - 0.722,  
264 - 0.778,  
265 - 0.778,  
266 - 0.778,  
267 - 0.778,  
268 - 0.778,  
269 - 0.584,  
270 - 0.778,  
271 - 0.722,  
272 - 0.722,  
273 - 0.722,  
274 - 0.722,  
275 - 0.667,  
276 - 0.666,  
277 - 0.611,  
278 - 0.556,  
279 - 0.556,  
280 - 0.556,  
281 - 0.556,  
282 - 0.556,  
283 - 0.556,  
284 - 0.896,  
285 - 0.500,  
286 - 0.556,  
287 - 0.556,  
288 - 0.556,  
289 - 0.556,  
290 - 0.251,  
291 - 0.251,  
292 - 0.251,  
293 - 0.251,  
294 - 0.556,  
295 - 0.556,  
296 - 0.556,  
297 - 0.556,  
298 - 0.556,  
299 - 0.556,  
300 - 0.556,  
301 - 0.584,  
302 - 0.611,  
303 - 0.556,  
304 - 0.556,  
305 - 0.556,  
306 - 0.556,  
307 - 0.500,  
308 - 0.555,  
309 - 0.500  
310 - ]); 54 + pdfDocument, 'Helvetica', 0.931, -0.225, _helveticaWidths);
311 } 55 }
312 56
313 factory PdfFont.helveticaBold(PdfDocument pdfDocument) { 57 factory PdfFont.helveticaBold(PdfDocument pdfDocument) {
314 return PdfType1Font._create( 58 return PdfType1Font._create(
315 - pdfDocument, 'Helvetica-Bold', 0.962, -0.228, const <double>[  
316 - 0.278,  
317 - 0.278,  
318 - 0.278,  
319 - 0.278,  
320 - 0.278,  
321 - 0.278,  
322 - 0.278,  
323 - 0.278,  
324 - 0.278,  
325 - 0.278,  
326 - 0.278,  
327 - 0.278,  
328 - 0.278,  
329 - 0.278,  
330 - 0.278,  
331 - 0.278,  
332 - 0.278,  
333 - 0.278,  
334 - 0.278,  
335 - 0.278,  
336 - 0.278,  
337 - 0.278,  
338 - 0.278,  
339 - 0.278,  
340 - 0.278,  
341 - 0.278,  
342 - 0.278,  
343 - 0.278,  
344 - 0.278,  
345 - 0.278,  
346 - 0.278,  
347 - 0.278,  
348 - 0.278,  
349 - 0.333,  
350 - 0.474,  
351 - 0.556,  
352 - 0.556,  
353 - 0.889,  
354 - 0.722,  
355 - 0.238,  
356 - 0.333,  
357 - 0.333,  
358 - 0.389,  
359 - 0.584,  
360 - 0.278,  
361 - 0.333,  
362 - 0.278,  
363 - 0.278,  
364 - 0.556,  
365 - 0.556,  
366 - 0.556,  
367 - 0.556,  
368 - 0.556,  
369 - 0.556,  
370 - 0.556,  
371 - 0.556,  
372 - 0.556,  
373 - 0.556,  
374 - 0.333,  
375 - 0.333,  
376 - 0.584,  
377 - 0.584,  
378 - 0.584,  
379 - 0.611,  
380 - 0.975,  
381 - 0.722,  
382 - 0.722,  
383 - 0.722,  
384 - 0.722,  
385 - 0.667,  
386 - 0.611,  
387 - 0.778,  
388 - 0.722,  
389 - 0.278,  
390 - 0.556,  
391 - 0.722,  
392 - 0.611,  
393 - 0.833,  
394 - 0.722,  
395 - 0.778,  
396 - 0.667,  
397 - 0.778,  
398 - 0.722,  
399 - 0.667,  
400 - 0.611,  
401 - 0.722,  
402 - 0.667,  
403 - 0.944,  
404 - 0.667,  
405 - 0.667,  
406 - 0.611,  
407 - 0.333,  
408 - 0.278,  
409 - 0.333,  
410 - 0.584,  
411 - 0.556,  
412 - 0.333,  
413 - 0.556,  
414 - 0.611,  
415 - 0.556,  
416 - 0.611,  
417 - 0.556,  
418 - 0.333,  
419 - 0.611,  
420 - 0.611,  
421 - 0.278,  
422 - 0.278,  
423 - 0.556,  
424 - 0.278,  
425 - 0.889,  
426 - 0.611,  
427 - 0.611,  
428 - 0.611,  
429 - 0.611,  
430 - 0.389,  
431 - 0.556,  
432 - 0.333,  
433 - 0.611,  
434 - 0.556,  
435 - 0.778,  
436 - 0.556,  
437 - 0.556,  
438 - 0.500,  
439 - 0.389,  
440 - 0.280,  
441 - 0.389,  
442 - 0.584,  
443 - 0.350,  
444 - 0.556,  
445 - 0.350,  
446 - 0.278,  
447 - 0.556,  
448 - 0.500,  
449 - 1.000,  
450 - 0.556,  
451 - 0.556,  
452 - 0.333,  
453 - 1.000,  
454 - 0.667,  
455 - 0.333,  
456 - 1.000,  
457 - 0.350,  
458 - 0.611,  
459 - 0.350,  
460 - 0.350,  
461 - 0.278,  
462 - 0.278,  
463 - 0.500,  
464 - 0.500,  
465 - 0.350,  
466 - 0.556,  
467 - 1.000,  
468 - 0.333,  
469 - 1.000,  
470 - 0.556,  
471 - 0.333,  
472 - 0.944,  
473 - 0.350,  
474 - 0.500,  
475 - 0.667,  
476 - 0.278,  
477 - 0.333,  
478 - 0.556,  
479 - 0.556,  
480 - 0.556,  
481 - 0.556,  
482 - 0.280,  
483 - 0.556,  
484 - 0.333,  
485 - 0.737,  
486 - 0.370,  
487 - 0.556,  
488 - 0.584,  
489 - 0.333,  
490 - 0.737,  
491 - 0.333,  
492 - 0.400,  
493 - 0.584,  
494 - 0.333,  
495 - 0.333,  
496 - 0.333,  
497 - 0.611,  
498 - 0.556,  
499 - 0.278,  
500 - 0.333,  
501 - 0.333,  
502 - 0.365,  
503 - 0.556,  
504 - 0.834,  
505 - 0.834,  
506 - 0.834,  
507 - 0.611,  
508 - 0.722,  
509 - 0.722,  
510 - 0.722,  
511 - 0.722,  
512 - 0.722,  
513 - 0.722,  
514 - 1.000,  
515 - 0.722,  
516 - 0.667,  
517 - 0.667,  
518 - 0.667,  
519 - 0.667,  
520 - 0.278,  
521 - 0.278,  
522 - 0.278,  
523 - 0.278,  
524 - 0.722,  
525 - 0.722,  
526 - 0.778,  
527 - 0.778,  
528 - 0.778,  
529 - 0.778,  
530 - 0.778,  
531 - 0.584,  
532 - 0.778,  
533 - 0.722,  
534 - 0.722,  
535 - 0.722,  
536 - 0.722,  
537 - 0.667,  
538 - 0.667,  
539 - 0.611,  
540 - 0.556,  
541 - 0.556,  
542 - 0.556,  
543 - 0.556,  
544 - 0.556,  
545 - 0.556,  
546 - 0.889,  
547 - 0.556,  
548 - 0.556,  
549 - 0.556,  
550 - 0.556,  
551 - 0.556,  
552 - 0.278,  
553 - 0.278,  
554 - 0.278,  
555 - 0.278,  
556 - 0.611,  
557 - 0.611,  
558 - 0.611,  
559 - 0.611,  
560 - 0.611,  
561 - 0.611,  
562 - 0.611,  
563 - 0.584,  
564 - 0.611,  
565 - 0.611,  
566 - 0.611,  
567 - 0.611,  
568 - 0.611,  
569 - 0.556,  
570 - 0.611,  
571 - 0.556  
572 - ]); 59 + pdfDocument, 'Helvetica-Bold', 0.962, -0.228, _helveticaBoldWidths);
573 } 60 }
574 61
575 factory PdfFont.helveticaBoldOblique(PdfDocument pdfDocument) { 62 factory PdfFont.helveticaBoldOblique(PdfDocument pdfDocument) {
576 - return PdfType1Font._create(  
577 - pdfDocument, 'Helvetica-BoldOblique', 0.962, -0.228, const <double>[  
578 - 0.278,  
579 - 0.278,  
580 - 0.278,  
581 - 0.278,  
582 - 0.278,  
583 - 0.278,  
584 - 0.278,  
585 - 0.278,  
586 - 0.278,  
587 - 0.278,  
588 - 0.278,  
589 - 0.278,  
590 - 0.278,  
591 - 0.278,  
592 - 0.278,  
593 - 0.278,  
594 - 0.278,  
595 - 0.278,  
596 - 0.278,  
597 - 0.278,  
598 - 0.278,  
599 - 0.278,  
600 - 0.278,  
601 - 0.278,  
602 - 0.278,  
603 - 0.278,  
604 - 0.278,  
605 - 0.278,  
606 - 0.278,  
607 - 0.278,  
608 - 0.278,  
609 - 0.278,  
610 - 0.278,  
611 - 0.333,  
612 - 0.474,  
613 - 0.556,  
614 - 0.556,  
615 - 0.889,  
616 - 0.722,  
617 - 0.238,  
618 - 0.333,  
619 - 0.333,  
620 - 0.389,  
621 - 0.584,  
622 - 0.278,  
623 - 0.333,  
624 - 0.278,  
625 - 0.278,  
626 - 0.556,  
627 - 0.556,  
628 - 0.556,  
629 - 0.556,  
630 - 0.556,  
631 - 0.556,  
632 - 0.556,  
633 - 0.556,  
634 - 0.556,  
635 - 0.556,  
636 - 0.333,  
637 - 0.333,  
638 - 0.584,  
639 - 0.584,  
640 - 0.584,  
641 - 0.611,  
642 - 0.975,  
643 - 0.722,  
644 - 0.722,  
645 - 0.722,  
646 - 0.722,  
647 - 0.667,  
648 - 0.611,  
649 - 0.778,  
650 - 0.722,  
651 - 0.278,  
652 - 0.556,  
653 - 0.722,  
654 - 0.611,  
655 - 0.833,  
656 - 0.722,  
657 - 0.778,  
658 - 0.667,  
659 - 0.778,  
660 - 0.722,  
661 - 0.667,  
662 - 0.611,  
663 - 0.722,  
664 - 0.667,  
665 - 0.944,  
666 - 0.667,  
667 - 0.667,  
668 - 0.611,  
669 - 0.333,  
670 - 0.278,  
671 - 0.333,  
672 - 0.584,  
673 - 0.556,  
674 - 0.333,  
675 - 0.556,  
676 - 0.611,  
677 - 0.556,  
678 - 0.611,  
679 - 0.556,  
680 - 0.333,  
681 - 0.611,  
682 - 0.611,  
683 - 0.278,  
684 - 0.278,  
685 - 0.556,  
686 - 0.278,  
687 - 0.889,  
688 - 0.611,  
689 - 0.611,  
690 - 0.611,  
691 - 0.611,  
692 - 0.389,  
693 - 0.556,  
694 - 0.333,  
695 - 0.611,  
696 - 0.556,  
697 - 0.778,  
698 - 0.556,  
699 - 0.556,  
700 - 0.500,  
701 - 0.389,  
702 - 0.280,  
703 - 0.389,  
704 - 0.584,  
705 - 0.350,  
706 - 0.556,  
707 - 0.350,  
708 - 0.278,  
709 - 0.556,  
710 - 0.500,  
711 - 1.000,  
712 - 0.556,  
713 - 0.556,  
714 - 0.333,  
715 - 1.000,  
716 - 0.667,  
717 - 0.333,  
718 - 1.000,  
719 - 0.350,  
720 - 0.611,  
721 - 0.350,  
722 - 0.350,  
723 - 0.278,  
724 - 0.278,  
725 - 0.500,  
726 - 0.500,  
727 - 0.350,  
728 - 0.556,  
729 - 1.000,  
730 - 0.333,  
731 - 1.000,  
732 - 0.556,  
733 - 0.333,  
734 - 0.944,  
735 - 0.350,  
736 - 0.500,  
737 - 0.667,  
738 - 0.278,  
739 - 0.333,  
740 - 0.556,  
741 - 0.556,  
742 - 0.556,  
743 - 0.556,  
744 - 0.280,  
745 - 0.556,  
746 - 0.333,  
747 - 0.737,  
748 - 0.370,  
749 - 0.556,  
750 - 0.584,  
751 - 0.333,  
752 - 0.737,  
753 - 0.333,  
754 - 0.400,  
755 - 0.584,  
756 - 0.333,  
757 - 0.333,  
758 - 0.333,  
759 - 0.611,  
760 - 0.556,  
761 - 0.278,  
762 - 0.333,  
763 - 0.333,  
764 - 0.365,  
765 - 0.556,  
766 - 0.834,  
767 - 0.834,  
768 - 0.834,  
769 - 0.611,  
770 - 0.722,  
771 - 0.722,  
772 - 0.722,  
773 - 0.722,  
774 - 0.722,  
775 - 0.722,  
776 - 1.000,  
777 - 0.722,  
778 - 0.667,  
779 - 0.667,  
780 - 0.667,  
781 - 0.667,  
782 - 0.278,  
783 - 0.278,  
784 - 0.278,  
785 - 0.278,  
786 - 0.722,  
787 - 0.722,  
788 - 0.778,  
789 - 0.778,  
790 - 0.778,  
791 - 0.778,  
792 - 0.778,  
793 - 0.584,  
794 - 0.778,  
795 - 0.722,  
796 - 0.722,  
797 - 0.722,  
798 - 0.722,  
799 - 0.667,  
800 - 0.667,  
801 - 0.611,  
802 - 0.556,  
803 - 0.556,  
804 - 0.556,  
805 - 0.556,  
806 - 0.556,  
807 - 0.556,  
808 - 0.889,  
809 - 0.556,  
810 - 0.556,  
811 - 0.556,  
812 - 0.556,  
813 - 0.556,  
814 - 0.278,  
815 - 0.278,  
816 - 0.278,  
817 - 0.278,  
818 - 0.611,  
819 - 0.611,  
820 - 0.611,  
821 - 0.611,  
822 - 0.611,  
823 - 0.611,  
824 - 0.611,  
825 - 0.584,  
826 - 0.611,  
827 - 0.611,  
828 - 0.611,  
829 - 0.611,  
830 - 0.611,  
831 - 0.556,  
832 - 0.611,  
833 - 0.556  
834 - ]); 63 + return PdfType1Font._create(pdfDocument, 'Helvetica-BoldOblique', 0.962,
  64 + -0.228, _helveticaBoldObliqueWidths);
835 } 65 }
836 66
837 factory PdfFont.helveticaOblique(PdfDocument pdfDocument) { 67 factory PdfFont.helveticaOblique(PdfDocument pdfDocument) {
838 - return PdfType1Font._create(  
839 - pdfDocument, 'Helvetica-Oblique', 0.931, -0.225, <double>[  
840 - 0.278,  
841 - 0.278,  
842 - 0.278,  
843 - 0.278,  
844 - 0.278,  
845 - 0.278,  
846 - 0.278,  
847 - 0.278,  
848 - 0.278,  
849 - 0.278,  
850 - 0.278,  
851 - 0.278,  
852 - 0.278,  
853 - 0.278,  
854 - 0.278,  
855 - 0.278,  
856 - 0.278,  
857 - 0.278,  
858 - 0.278,  
859 - 0.278,  
860 - 0.278,  
861 - 0.278,  
862 - 0.278,  
863 - 0.278,  
864 - 0.278,  
865 - 0.278,  
866 - 0.278,  
867 - 0.278,  
868 - 0.278,  
869 - 0.278,  
870 - 0.278,  
871 - 0.278,  
872 - 0.278,  
873 - 0.278,  
874 - 0.355,  
875 - 0.556,  
876 - 0.556,  
877 - 0.889,  
878 - 0.667,  
879 - 0.191,  
880 - 0.333,  
881 - 0.333,  
882 - 0.389,  
883 - 0.584,  
884 - 0.278,  
885 - 0.333,  
886 - 0.278,  
887 - 0.278,  
888 - 0.556,  
889 - 0.556,  
890 - 0.556,  
891 - 0.556,  
892 - 0.556,  
893 - 0.556,  
894 - 0.556,  
895 - 0.556,  
896 - 0.556,  
897 - 0.556,  
898 - 0.278,  
899 - 0.278,  
900 - 0.584,  
901 - 0.584,  
902 - 0.584,  
903 - 0.556,  
904 - 1.015,  
905 - 0.667,  
906 - 0.667,  
907 - 0.722,  
908 - 0.722,  
909 - 0.667,  
910 - 0.611,  
911 - 0.778,  
912 - 0.722,  
913 - 0.278,  
914 - 0.500,  
915 - 0.667,  
916 - 0.556,  
917 - 0.833,  
918 - 0.722,  
919 - 0.778,  
920 - 0.667,  
921 - 0.778,  
922 - 0.722,  
923 - 0.667,  
924 - 0.611,  
925 - 0.722,  
926 - 0.667,  
927 - 0.944,  
928 - 0.667,  
929 - 0.667,  
930 - 0.611,  
931 - 0.278,  
932 - 0.278,  
933 - 0.278,  
934 - 0.469,  
935 - 0.556,  
936 - 0.333,  
937 - 0.556,  
938 - 0.556,  
939 - 0.500,  
940 - 0.556,  
941 - 0.556,  
942 - 0.278,  
943 - 0.556,  
944 - 0.556,  
945 - 0.222,  
946 - 0.222,  
947 - 0.500,  
948 - 0.222,  
949 - 0.833,  
950 - 0.556,  
951 - 0.556,  
952 - 0.556,  
953 - 0.556,  
954 - 0.333,  
955 - 0.500,  
956 - 0.278,  
957 - 0.556,  
958 - 0.500,  
959 - 0.722,  
960 - 0.500,  
961 - 0.500,  
962 - 0.500,  
963 - 0.334,  
964 - 0.260,  
965 - 0.334,  
966 - 0.584,  
967 - 0.350,  
968 - 0.556,  
969 - 0.350,  
970 - 0.222,  
971 - 0.556,  
972 - 0.333,  
973 - 1.000,  
974 - 0.556,  
975 - 0.556,  
976 - 0.333,  
977 - 1.000,  
978 - 0.667,  
979 - 0.333,  
980 - 1.000,  
981 - 0.350,  
982 - 0.611,  
983 - 0.350,  
984 - 0.350,  
985 - 0.222,  
986 - 0.222,  
987 - 0.333,  
988 - 0.333,  
989 - 0.350,  
990 - 0.556,  
991 - 1.000,  
992 - 0.333,  
993 - 1.000,  
994 - 0.500,  
995 - 0.333,  
996 - 0.944,  
997 - 0.350,  
998 - 0.500,  
999 - 0.667,  
1000 - 0.278,  
1001 - 0.333,  
1002 - 0.556,  
1003 - 0.556,  
1004 - 0.556,  
1005 - 0.556,  
1006 - 0.260,  
1007 - 0.556,  
1008 - 0.333,  
1009 - 0.737,  
1010 - 0.370,  
1011 - 0.556,  
1012 - 0.584,  
1013 - 0.333,  
1014 - 0.737,  
1015 - 0.333,  
1016 - 0.400,  
1017 - 0.584,  
1018 - 0.333,  
1019 - 0.333,  
1020 - 0.333,  
1021 - 0.556,  
1022 - 0.537,  
1023 - 0.278,  
1024 - 0.333,  
1025 - 0.333,  
1026 - 0.365,  
1027 - 0.556,  
1028 - 0.834,  
1029 - 0.834,  
1030 - 0.834,  
1031 - 0.611,  
1032 - 0.667,  
1033 - 0.667,  
1034 - 0.667,  
1035 - 0.667,  
1036 - 0.667,  
1037 - 0.667,  
1038 - 1.000,  
1039 - 0.722,  
1040 - 0.667,  
1041 - 0.667,  
1042 - 0.667,  
1043 - 0.667,  
1044 - 0.278,  
1045 - 0.278,  
1046 - 0.278,  
1047 - 0.278,  
1048 - 0.722,  
1049 - 0.722,  
1050 - 0.778,  
1051 - 0.778,  
1052 - 0.778,  
1053 - 0.778,  
1054 - 0.778,  
1055 - 0.584,  
1056 - 0.778,  
1057 - 0.722,  
1058 - 0.722,  
1059 - 0.722,  
1060 - 0.722,  
1061 - 0.667,  
1062 - 0.667,  
1063 - 0.611,  
1064 - 0.556,  
1065 - 0.556,  
1066 - 0.556,  
1067 - 0.556,  
1068 - 0.556,  
1069 - 0.556,  
1070 - 0.889,  
1071 - 0.500,  
1072 - 0.556,  
1073 - 0.556,  
1074 - 0.556,  
1075 - 0.556,  
1076 - 0.278,  
1077 - 0.278,  
1078 - 0.278,  
1079 - 0.278,  
1080 - 0.556,  
1081 - 0.556,  
1082 - 0.556,  
1083 - 0.556,  
1084 - 0.556,  
1085 - 0.556,  
1086 - 0.556,  
1087 - 0.584,  
1088 - 0.611,  
1089 - 0.556,  
1090 - 0.556,  
1091 - 0.556,  
1092 - 0.556,  
1093 - 0.500,  
1094 - 0.556,  
1095 - 0.500  
1096 - ]); 68 + return PdfType1Font._create(pdfDocument, 'Helvetica-Oblique', 0.931, -0.225,
  69 + _helveticaObliqueWidths);
1097 } 70 }
1098 71
1099 factory PdfFont.times(PdfDocument pdfDocument) { 72 factory PdfFont.times(PdfDocument pdfDocument) {
1100 return PdfType1Font._create( 73 return PdfType1Font._create(
1101 - pdfDocument, 'Times-Roman', 0.898, -0.218, <double>[  
1102 - 0.250,  
1103 - 0.250,  
1104 - 0.250,  
1105 - 0.250,  
1106 - 0.250,  
1107 - 0.250,  
1108 - 0.250,  
1109 - 0.250,  
1110 - 0.250,  
1111 - 0.250,  
1112 - 0.250,  
1113 - 0.250,  
1114 - 0.250,  
1115 - 0.250,  
1116 - 0.250,  
1117 - 0.250,  
1118 - 0.250,  
1119 - 0.250,  
1120 - 0.250,  
1121 - 0.250,  
1122 - 0.250,  
1123 - 0.250,  
1124 - 0.250,  
1125 - 0.250,  
1126 - 0.250,  
1127 - 0.250,  
1128 - 0.250,  
1129 - 0.250,  
1130 - 0.250,  
1131 - 0.250,  
1132 - 0.250,  
1133 - 0.250,  
1134 - 0.250,  
1135 - 0.333,  
1136 - 0.408,  
1137 - 0.500,  
1138 - 0.500,  
1139 - 0.833,  
1140 - 0.778,  
1141 - 0.180,  
1142 - 0.333,  
1143 - 0.333,  
1144 - 0.500,  
1145 - 0.564,  
1146 - 0.250,  
1147 - 0.333,  
1148 - 0.250,  
1149 - 0.278,  
1150 - 0.500,  
1151 - 0.500,  
1152 - 0.500,  
1153 - 0.500,  
1154 - 0.500,  
1155 - 0.500,  
1156 - 0.500,  
1157 - 0.500,  
1158 - 0.500,  
1159 - 0.500,  
1160 - 0.278,  
1161 - 0.278,  
1162 - 0.564,  
1163 - 0.564,  
1164 - 0.564,  
1165 - 0.444,  
1166 - 0.921,  
1167 - 0.722,  
1168 - 0.667,  
1169 - 0.667,  
1170 - 0.722,  
1171 - 0.611,  
1172 - 0.556,  
1173 - 0.722,  
1174 - 0.722,  
1175 - 0.333,  
1176 - 0.389,  
1177 - 0.722,  
1178 - 0.611,  
1179 - 0.889,  
1180 - 0.722,  
1181 - 0.722,  
1182 - 0.556,  
1183 - 0.722,  
1184 - 0.667,  
1185 - 0.556,  
1186 - 0.611,  
1187 - 0.722,  
1188 - 0.722,  
1189 - 0.944,  
1190 - 0.722,  
1191 - 0.722,  
1192 - 0.611,  
1193 - 0.333,  
1194 - 0.278,  
1195 - 0.333,  
1196 - 0.469,  
1197 - 0.500,  
1198 - 0.333,  
1199 - 0.444,  
1200 - 0.500,  
1201 - 0.444,  
1202 - 0.500,  
1203 - 0.444,  
1204 - 0.333,  
1205 - 0.500,  
1206 - 0.500,  
1207 - 0.278,  
1208 - 0.278,  
1209 - 0.500,  
1210 - 0.278,  
1211 - 0.778,  
1212 - 0.500,  
1213 - 0.500,  
1214 - 0.500,  
1215 - 0.500,  
1216 - 0.333,  
1217 - 0.389,  
1218 - 0.278,  
1219 - 0.500,  
1220 - 0.500,  
1221 - 0.722,  
1222 - 0.500,  
1223 - 0.500,  
1224 - 0.444,  
1225 - 0.480,  
1226 - 0.200,  
1227 - 0.480,  
1228 - 0.541,  
1229 - 0.350,  
1230 - 0.500,  
1231 - 0.350,  
1232 - 0.333,  
1233 - 0.500,  
1234 - 0.444,  
1235 - 1.000,  
1236 - 0.500,  
1237 - 0.500,  
1238 - 0.333,  
1239 - 1.000,  
1240 - 0.556,  
1241 - 0.333,  
1242 - 0.889,  
1243 - 0.350,  
1244 - 0.611,  
1245 - 0.350,  
1246 - 0.350,  
1247 - 0.333,  
1248 - 0.333,  
1249 - 0.444,  
1250 - 0.444,  
1251 - 0.350,  
1252 - 0.500,  
1253 - 1.000,  
1254 - 0.333,  
1255 - 0.980,  
1256 - 0.389,  
1257 - 0.333,  
1258 - 0.722,  
1259 - 0.350,  
1260 - 0.444,  
1261 - 0.722,  
1262 - 0.250,  
1263 - 0.333,  
1264 - 0.500,  
1265 - 0.500,  
1266 - 0.500,  
1267 - 0.500,  
1268 - 0.200,  
1269 - 0.500,  
1270 - 0.333,  
1271 - 0.760,  
1272 - 0.276,  
1273 - 0.500,  
1274 - 0.564,  
1275 - 0.333,  
1276 - 0.760,  
1277 - 0.333,  
1278 - 0.400,  
1279 - 0.564,  
1280 - 0.300,  
1281 - 0.300,  
1282 - 0.333,  
1283 - 0.500,  
1284 - 0.453,  
1285 - 0.250,  
1286 - 0.333,  
1287 - 0.300,  
1288 - 0.310,  
1289 - 0.500,  
1290 - 0.750,  
1291 - 0.750,  
1292 - 0.750,  
1293 - 0.444,  
1294 - 0.722,  
1295 - 0.722,  
1296 - 0.722,  
1297 - 0.722,  
1298 - 0.722,  
1299 - 0.722,  
1300 - 0.889,  
1301 - 0.667,  
1302 - 0.611,  
1303 - 0.611,  
1304 - 0.611,  
1305 - 0.611,  
1306 - 0.333,  
1307 - 0.333,  
1308 - 0.333,  
1309 - 0.333,  
1310 - 0.722,  
1311 - 0.722,  
1312 - 0.722,  
1313 - 0.722,  
1314 - 0.722,  
1315 - 0.722,  
1316 - 0.722,  
1317 - 0.564,  
1318 - 0.722,  
1319 - 0.722,  
1320 - 0.722,  
1321 - 0.722,  
1322 - 0.722,  
1323 - 0.722,  
1324 - 0.556,  
1325 - 0.500,  
1326 - 0.444,  
1327 - 0.444,  
1328 - 0.444,  
1329 - 0.444,  
1330 - 0.444,  
1331 - 0.444,  
1332 - 0.667,  
1333 - 0.444,  
1334 - 0.444,  
1335 - 0.444,  
1336 - 0.444,  
1337 - 0.444,  
1338 - 0.278,  
1339 - 0.278,  
1340 - 0.278,  
1341 - 0.278,  
1342 - 0.500,  
1343 - 0.500,  
1344 - 0.500,  
1345 - 0.500,  
1346 - 0.500,  
1347 - 0.500,  
1348 - 0.500,  
1349 - 0.564,  
1350 - 0.500,  
1351 - 0.500,  
1352 - 0.500,  
1353 - 0.500,  
1354 - 0.500,  
1355 - 0.500,  
1356 - 0.500,  
1357 - 0.500  
1358 - ]); 74 + pdfDocument, 'Times-Roman', 0.898, -0.218, _timesWidths);
1359 } 75 }
1360 76
1361 factory PdfFont.timesBold(PdfDocument pdfDocument) { 77 factory PdfFont.timesBold(PdfDocument pdfDocument) {
1362 return PdfType1Font._create( 78 return PdfType1Font._create(
1363 - pdfDocument, 'Times-Bold', 0.935, -0.218, <double>[  
1364 - 0.250,  
1365 - 0.250,  
1366 - 0.250,  
1367 - 0.250,  
1368 - 0.250,  
1369 - 0.250,  
1370 - 0.250,  
1371 - 0.250,  
1372 - 0.250,  
1373 - 0.250,  
1374 - 0.250,  
1375 - 0.250,  
1376 - 0.250,  
1377 - 0.250,  
1378 - 0.250,  
1379 - 0.250,  
1380 - 0.250,  
1381 - 0.250,  
1382 - 0.250,  
1383 - 0.250,  
1384 - 0.250,  
1385 - 0.250,  
1386 - 0.250,  
1387 - 0.250,  
1388 - 0.250,  
1389 - 0.250,  
1390 - 0.250,  
1391 - 0.250,  
1392 - 0.250,  
1393 - 0.250,  
1394 - 0.250,  
1395 - 0.250,  
1396 - 0.250,  
1397 - 0.333,  
1398 - 0.555,  
1399 - 0.500,  
1400 - 0.500,  
1401 - 1.000,  
1402 - 0.833,  
1403 - 0.278,  
1404 - 0.333,  
1405 - 0.333,  
1406 - 0.500,  
1407 - 0.570,  
1408 - 0.250,  
1409 - 0.333,  
1410 - 0.250,  
1411 - 0.278,  
1412 - 0.500,  
1413 - 0.500,  
1414 - 0.500,  
1415 - 0.500,  
1416 - 0.500,  
1417 - 0.500,  
1418 - 0.500,  
1419 - 0.500,  
1420 - 0.500,  
1421 - 0.500,  
1422 - 0.333,  
1423 - 0.333,  
1424 - 0.570,  
1425 - 0.570,  
1426 - 0.570,  
1427 - 0.500,  
1428 - 0.930,  
1429 - 0.722,  
1430 - 0.667,  
1431 - 0.722,  
1432 - 0.722,  
1433 - 0.667,  
1434 - 0.611,  
1435 - 0.778,  
1436 - 0.778,  
1437 - 0.389,  
1438 - 0.500,  
1439 - 0.778,  
1440 - 0.667,  
1441 - 0.944,  
1442 - 0.722,  
1443 - 0.778,  
1444 - 0.611,  
1445 - 0.778,  
1446 - 0.722,  
1447 - 0.556,  
1448 - 0.667,  
1449 - 0.722,  
1450 - 0.722,  
1451 - 1.000,  
1452 - 0.722,  
1453 - 0.722,  
1454 - 0.667,  
1455 - 0.333,  
1456 - 0.278,  
1457 - 0.333,  
1458 - 0.581,  
1459 - 0.500,  
1460 - 0.333,  
1461 - 0.500,  
1462 - 0.556,  
1463 - 0.444,  
1464 - 0.556,  
1465 - 0.444,  
1466 - 0.333,  
1467 - 0.500,  
1468 - 0.556,  
1469 - 0.278,  
1470 - 0.333,  
1471 - 0.556,  
1472 - 0.278,  
1473 - 0.833,  
1474 - 0.556,  
1475 - 0.500,  
1476 - 0.556,  
1477 - 0.556,  
1478 - 0.444,  
1479 - 0.389,  
1480 - 0.333,  
1481 - 0.556,  
1482 - 0.500,  
1483 - 0.722,  
1484 - 0.500,  
1485 - 0.500,  
1486 - 0.444,  
1487 - 0.394,  
1488 - 0.220,  
1489 - 0.394,  
1490 - 0.520,  
1491 - 0.350,  
1492 - 0.500,  
1493 - 0.350,  
1494 - 0.333,  
1495 - 0.500,  
1496 - 0.500,  
1497 - 1.000,  
1498 - 0.500,  
1499 - 0.500,  
1500 - 0.333,  
1501 - 1.000,  
1502 - 0.556,  
1503 - 0.333,  
1504 - 1.000,  
1505 - 0.350,  
1506 - 0.667,  
1507 - 0.350,  
1508 - 0.350,  
1509 - 0.333,  
1510 - 0.333,  
1511 - 0.500,  
1512 - 0.500,  
1513 - 0.350,  
1514 - 0.500,  
1515 - 1.000,  
1516 - 0.333,  
1517 - 1.000,  
1518 - 0.389,  
1519 - 0.333,  
1520 - 0.722,  
1521 - 0.350,  
1522 - 0.444,  
1523 - 0.722,  
1524 - 0.250,  
1525 - 0.333,  
1526 - 0.500,  
1527 - 0.500,  
1528 - 0.500,  
1529 - 0.500,  
1530 - 0.220,  
1531 - 0.500,  
1532 - 0.333,  
1533 - 0.747,  
1534 - 0.300,  
1535 - 0.500,  
1536 - 0.570,  
1537 - 0.333,  
1538 - 0.747,  
1539 - 0.333,  
1540 - 0.400,  
1541 - 0.570,  
1542 - 0.300,  
1543 - 0.300,  
1544 - 0.333,  
1545 - 0.556,  
1546 - 0.540,  
1547 - 0.250,  
1548 - 0.333,  
1549 - 0.300,  
1550 - 0.330,  
1551 - 0.500,  
1552 - 0.750,  
1553 - 0.750,  
1554 - 0.750,  
1555 - 0.500,  
1556 - 0.722,  
1557 - 0.722,  
1558 - 0.722,  
1559 - 0.722,  
1560 - 0.722,  
1561 - 0.722,  
1562 - 1.000,  
1563 - 0.722,  
1564 - 0.667,  
1565 - 0.667,  
1566 - 0.667,  
1567 - 0.667,  
1568 - 0.389,  
1569 - 0.389,  
1570 - 0.389,  
1571 - 0.389,  
1572 - 0.722,  
1573 - 0.722,  
1574 - 0.778,  
1575 - 0.778,  
1576 - 0.778,  
1577 - 0.778,  
1578 - 0.778,  
1579 - 0.570,  
1580 - 0.778,  
1581 - 0.722,  
1582 - 0.722,  
1583 - 0.722,  
1584 - 0.722,  
1585 - 0.722,  
1586 - 0.611,  
1587 - 0.556,  
1588 - 0.500,  
1589 - 0.500,  
1590 - 0.500,  
1591 - 0.500,  
1592 - 0.500,  
1593 - 0.500,  
1594 - 0.722,  
1595 - 0.444,  
1596 - 0.444,  
1597 - 0.444,  
1598 - 0.444,  
1599 - 0.444,  
1600 - 0.278,  
1601 - 0.278,  
1602 - 0.278,  
1603 - 0.278,  
1604 - 0.500,  
1605 - 0.556,  
1606 - 0.500,  
1607 - 0.500,  
1608 - 0.500,  
1609 - 0.500,  
1610 - 0.500,  
1611 - 0.570,  
1612 - 0.500,  
1613 - 0.556,  
1614 - 0.556,  
1615 - 0.556,  
1616 - 0.556,  
1617 - 0.500,  
1618 - 0.556,  
1619 - 0.500  
1620 - ]); 79 + pdfDocument, 'Times-Bold', 0.935, -0.218, _timesBoldWidths);
1621 } 80 }
1622 81
1623 factory PdfFont.timesBoldItalic(PdfDocument pdfDocument) { 82 factory PdfFont.timesBoldItalic(PdfDocument pdfDocument) {
1624 return PdfType1Font._create( 83 return PdfType1Font._create(
1625 - pdfDocument, 'Times-BoldItalic', 0.921, -0.218, <double>[  
1626 - 0.250,  
1627 - 0.250,  
1628 - 0.250,  
1629 - 0.250,  
1630 - 0.250,  
1631 - 0.250,  
1632 - 0.250,  
1633 - 0.250,  
1634 - 0.250,  
1635 - 0.250,  
1636 - 0.250,  
1637 - 0.250,  
1638 - 0.250,  
1639 - 0.250,  
1640 - 0.250,  
1641 - 0.250,  
1642 - 0.250,  
1643 - 0.250,  
1644 - 0.250,  
1645 - 0.250,  
1646 - 0.250,  
1647 - 0.250,  
1648 - 0.250,  
1649 - 0.250,  
1650 - 0.250,  
1651 - 0.250,  
1652 - 0.250,  
1653 - 0.250,  
1654 - 0.250,  
1655 - 0.250,  
1656 - 0.250,  
1657 - 0.250,  
1658 - 0.250,  
1659 - 0.389,  
1660 - 0.555,  
1661 - 0.500,  
1662 - 0.500,  
1663 - 0.833,  
1664 - 0.778,  
1665 - 0.278,  
1666 - 0.333,  
1667 - 0.333,  
1668 - 0.500,  
1669 - 0.570,  
1670 - 0.250,  
1671 - 0.333,  
1672 - 0.250,  
1673 - 0.278,  
1674 - 0.500,  
1675 - 0.500,  
1676 - 0.500,  
1677 - 0.500,  
1678 - 0.500,  
1679 - 0.500,  
1680 - 0.500,  
1681 - 0.500,  
1682 - 0.500,  
1683 - 0.500,  
1684 - 0.333,  
1685 - 0.333,  
1686 - 0.570,  
1687 - 0.570,  
1688 - 0.570,  
1689 - 0.500,  
1690 - 0.832,  
1691 - 0.667,  
1692 - 0.667,  
1693 - 0.667,  
1694 - 0.722,  
1695 - 0.667,  
1696 - 0.667,  
1697 - 0.722,  
1698 - 0.778,  
1699 - 0.389,  
1700 - 0.500,  
1701 - 0.667,  
1702 - 0.611,  
1703 - 0.889,  
1704 - 0.722,  
1705 - 0.722,  
1706 - 0.611,  
1707 - 0.722,  
1708 - 0.667,  
1709 - 0.556,  
1710 - 0.611,  
1711 - 0.722,  
1712 - 0.667,  
1713 - 0.889,  
1714 - 0.667,  
1715 - 0.611,  
1716 - 0.611,  
1717 - 0.333,  
1718 - 0.278,  
1719 - 0.333,  
1720 - 0.570,  
1721 - 0.500,  
1722 - 0.333,  
1723 - 0.500,  
1724 - 0.500,  
1725 - 0.444,  
1726 - 0.500,  
1727 - 0.444,  
1728 - 0.333,  
1729 - 0.500,  
1730 - 0.556,  
1731 - 0.278,  
1732 - 0.278,  
1733 - 0.500,  
1734 - 0.278,  
1735 - 0.778,  
1736 - 0.556,  
1737 - 0.500,  
1738 - 0.500,  
1739 - 0.500,  
1740 - 0.389,  
1741 - 0.389,  
1742 - 0.278,  
1743 - 0.556,  
1744 - 0.444,  
1745 - 0.667,  
1746 - 0.500,  
1747 - 0.444,  
1748 - 0.389,  
1749 - 0.348,  
1750 - 0.220,  
1751 - 0.348,  
1752 - 0.570,  
1753 - 0.350,  
1754 - 0.500,  
1755 - 0.350,  
1756 - 0.333,  
1757 - 0.500,  
1758 - 0.500,  
1759 - 1.000,  
1760 - 0.500,  
1761 - 0.500,  
1762 - 0.333,  
1763 - 1.000,  
1764 - 0.556,  
1765 - 0.333,  
1766 - 0.944,  
1767 - 0.350,  
1768 - 0.611,  
1769 - 0.350,  
1770 - 0.350,  
1771 - 0.333,  
1772 - 0.333,  
1773 - 0.500,  
1774 - 0.500,  
1775 - 0.350,  
1776 - 0.500,  
1777 - 1.000,  
1778 - 0.333,  
1779 - 1.000,  
1780 - 0.389,  
1781 - 0.333,  
1782 - 0.722,  
1783 - 0.350,  
1784 - 0.389,  
1785 - 0.611,  
1786 - 0.250,  
1787 - 0.389,  
1788 - 0.500,  
1789 - 0.500,  
1790 - 0.500,  
1791 - 0.500,  
1792 - 0.220,  
1793 - 0.500,  
1794 - 0.333,  
1795 - 0.747,  
1796 - 0.266,  
1797 - 0.500,  
1798 - 0.606,  
1799 - 0.333,  
1800 - 0.747,  
1801 - 0.333,  
1802 - 0.400,  
1803 - 0.570,  
1804 - 0.300,  
1805 - 0.300,  
1806 - 0.333,  
1807 - 0.576,  
1808 - 0.500,  
1809 - 0.250,  
1810 - 0.333,  
1811 - 0.300,  
1812 - 0.300,  
1813 - 0.500,  
1814 - 0.750,  
1815 - 0.750,  
1816 - 0.750,  
1817 - 0.500,  
1818 - 0.667,  
1819 - 0.667,  
1820 - 0.667,  
1821 - 0.667,  
1822 - 0.667,  
1823 - 0.667,  
1824 - 0.944,  
1825 - 0.667,  
1826 - 0.667,  
1827 - 0.667,  
1828 - 0.667,  
1829 - 0.667,  
1830 - 0.389,  
1831 - 0.389,  
1832 - 0.389,  
1833 - 0.389,  
1834 - 0.722,  
1835 - 0.722,  
1836 - 0.722,  
1837 - 0.722,  
1838 - 0.722,  
1839 - 0.722,  
1840 - 0.722,  
1841 - 0.570,  
1842 - 0.722,  
1843 - 0.722,  
1844 - 0.722,  
1845 - 0.722,  
1846 - 0.722,  
1847 - 0.611,  
1848 - 0.611,  
1849 - 0.500,  
1850 - 0.500,  
1851 - 0.500,  
1852 - 0.500,  
1853 - 0.500,  
1854 - 0.500,  
1855 - 0.500,  
1856 - 0.722,  
1857 - 0.444,  
1858 - 0.444,  
1859 - 0.444,  
1860 - 0.444,  
1861 - 0.444,  
1862 - 0.278,  
1863 - 0.278,  
1864 - 0.278,  
1865 - 0.278,  
1866 - 0.500,  
1867 - 0.556,  
1868 - 0.500,  
1869 - 0.500,  
1870 - 0.500,  
1871 - 0.500,  
1872 - 0.500,  
1873 - 0.570,  
1874 - 0.500,  
1875 - 0.556,  
1876 - 0.556,  
1877 - 0.556,  
1878 - 0.556,  
1879 - 0.444,  
1880 - 0.500,  
1881 - 0.444  
1882 - ]); 84 + pdfDocument, 'Times-BoldItalic', 0.921, -0.218, _timesBoldItalicWidths);
1883 } 85 }
1884 86
1885 factory PdfFont.timesItalic(PdfDocument pdfDocument) { 87 factory PdfFont.timesItalic(PdfDocument pdfDocument) {
1886 return PdfType1Font._create( 88 return PdfType1Font._create(
1887 - pdfDocument, 'Times-Italic', 0.883, -0.217, <double>[  
1888 - 0.250,  
1889 - 0.250,  
1890 - 0.250,  
1891 - 0.250,  
1892 - 0.250,  
1893 - 0.250,  
1894 - 0.250,  
1895 - 0.250,  
1896 - 0.250,  
1897 - 0.250,  
1898 - 0.250,  
1899 - 0.250,  
1900 - 0.250,  
1901 - 0.250,  
1902 - 0.250,  
1903 - 0.250,  
1904 - 0.250,  
1905 - 0.250,  
1906 - 0.250,  
1907 - 0.250,  
1908 - 0.250,  
1909 - 0.250,  
1910 - 0.250,  
1911 - 0.250,  
1912 - 0.250,  
1913 - 0.250,  
1914 - 0.250,  
1915 - 0.250,  
1916 - 0.250,  
1917 - 0.250,  
1918 - 0.250,  
1919 - 0.250,  
1920 - 0.250,  
1921 - 0.333,  
1922 - 0.420,  
1923 - 0.500,  
1924 - 0.500,  
1925 - 0.833,  
1926 - 0.778,  
1927 - 0.214,  
1928 - 0.333,  
1929 - 0.333,  
1930 - 0.500,  
1931 - 0.675,  
1932 - 0.250,  
1933 - 0.333,  
1934 - 0.250,  
1935 - 0.278,  
1936 - 0.500,  
1937 - 0.500,  
1938 - 0.500,  
1939 - 0.500,  
1940 - 0.500,  
1941 - 0.500,  
1942 - 0.500,  
1943 - 0.500,  
1944 - 0.500,  
1945 - 0.500,  
1946 - 0.333,  
1947 - 0.333,  
1948 - 0.675,  
1949 - 0.675,  
1950 - 0.675,  
1951 - 0.500,  
1952 - 0.920,  
1953 - 0.611,  
1954 - 0.611,  
1955 - 0.667,  
1956 - 0.722,  
1957 - 0.611,  
1958 - 0.611,  
1959 - 0.722,  
1960 - 0.722,  
1961 - 0.333,  
1962 - 0.444,  
1963 - 0.667,  
1964 - 0.556,  
1965 - 0.833,  
1966 - 0.667,  
1967 - 0.722,  
1968 - 0.611,  
1969 - 0.722,  
1970 - 0.611,  
1971 - 0.500,  
1972 - 0.556,  
1973 - 0.722,  
1974 - 0.611,  
1975 - 0.833,  
1976 - 0.611,  
1977 - 0.556,  
1978 - 0.556,  
1979 - 0.389,  
1980 - 0.278,  
1981 - 0.389,  
1982 - 0.422,  
1983 - 0.500,  
1984 - 0.333,  
1985 - 0.500,  
1986 - 0.500,  
1987 - 0.444,  
1988 - 0.500,  
1989 - 0.444,  
1990 - 0.278,  
1991 - 0.500,  
1992 - 0.500,  
1993 - 0.278,  
1994 - 0.278,  
1995 - 0.444,  
1996 - 0.278,  
1997 - 0.722,  
1998 - 0.500,  
1999 - 0.500,  
2000 - 0.500,  
2001 - 0.500,  
2002 - 0.389,  
2003 - 0.389,  
2004 - 0.278,  
2005 - 0.500,  
2006 - 0.444,  
2007 - 0.667,  
2008 - 0.444,  
2009 - 0.444,  
2010 - 0.389,  
2011 - 0.400,  
2012 - 0.275,  
2013 - 0.400,  
2014 - 0.541,  
2015 - 0.350,  
2016 - 0.500,  
2017 - 0.350,  
2018 - 0.333,  
2019 - 0.500,  
2020 - 0.556,  
2021 - 0.889,  
2022 - 0.500,  
2023 - 0.500,  
2024 - 0.333,  
2025 - 1.000,  
2026 - 0.500,  
2027 - 0.333,  
2028 - 0.944,  
2029 - 0.350,  
2030 - 0.556,  
2031 - 0.350,  
2032 - 0.350,  
2033 - 0.333,  
2034 - 0.333,  
2035 - 0.556,  
2036 - 0.556,  
2037 - 0.350,  
2038 - 0.500,  
2039 - 0.889,  
2040 - 0.333,  
2041 - 0.980,  
2042 - 0.389,  
2043 - 0.333,  
2044 - 0.667,  
2045 - 0.350,  
2046 - 0.389,  
2047 - 0.556,  
2048 - 0.250,  
2049 - 0.389,  
2050 - 0.500,  
2051 - 0.500,  
2052 - 0.500,  
2053 - 0.500,  
2054 - 0.275,  
2055 - 0.500,  
2056 - 0.333,  
2057 - 0.760,  
2058 - 0.276,  
2059 - 0.500,  
2060 - 0.675,  
2061 - 0.333,  
2062 - 0.760,  
2063 - 0.333,  
2064 - 0.400,  
2065 - 0.675,  
2066 - 0.300,  
2067 - 0.300,  
2068 - 0.333,  
2069 - 0.500,  
2070 - 0.523,  
2071 - 0.250,  
2072 - 0.333,  
2073 - 0.300,  
2074 - 0.310,  
2075 - 0.500,  
2076 - 0.750,  
2077 - 0.750,  
2078 - 0.750,  
2079 - 0.500,  
2080 - 0.611,  
2081 - 0.611,  
2082 - 0.611,  
2083 - 0.611,  
2084 - 0.611,  
2085 - 0.611,  
2086 - 0.889,  
2087 - 0.667,  
2088 - 0.611,  
2089 - 0.611,  
2090 - 0.611,  
2091 - 0.611,  
2092 - 0.333,  
2093 - 0.333,  
2094 - 0.333,  
2095 - 0.333,  
2096 - 0.722,  
2097 - 0.667,  
2098 - 0.722,  
2099 - 0.722,  
2100 - 0.722,  
2101 - 0.722,  
2102 - 0.722,  
2103 - 0.675,  
2104 - 0.722,  
2105 - 0.722,  
2106 - 0.722,  
2107 - 0.722,  
2108 - 0.722,  
2109 - 0.556,  
2110 - 0.611,  
2111 - 0.500,  
2112 - 0.500,  
2113 - 0.500,  
2114 - 0.500,  
2115 - 0.500,  
2116 - 0.500,  
2117 - 0.500,  
2118 - 0.667,  
2119 - 0.444,  
2120 - 0.444,  
2121 - 0.444,  
2122 - 0.444,  
2123 - 0.444,  
2124 - 0.278,  
2125 - 0.278,  
2126 - 0.278,  
2127 - 0.278,  
2128 - 0.500,  
2129 - 0.500,  
2130 - 0.500,  
2131 - 0.500,  
2132 - 0.500,  
2133 - 0.500,  
2134 - 0.500,  
2135 - 0.675,  
2136 - 0.500,  
2137 - 0.500,  
2138 - 0.500,  
2139 - 0.500,  
2140 - 0.500,  
2141 - 0.444,  
2142 - 0.500,  
2143 - 0.444  
2144 - ]); 89 + pdfDocument, 'Times-Italic', 0.883, -0.217, _timesItalicWidths);
2145 } 90 }
2146 91
2147 factory PdfFont.symbol(PdfDocument pdfDocument) { 92 factory PdfFont.symbol(PdfDocument pdfDocument) {
2148 - return PdfType1Font._create(pdfDocument, 'Symbol', 1.010, -0.293, <double>[  
2149 - 0.587,  
2150 - 0.587,  
2151 - 0.587,  
2152 - 0.587,  
2153 - 0.587,  
2154 - 0.587,  
2155 - 0.587,  
2156 - 0.587,  
2157 - 0.587,  
2158 - 0.587,  
2159 - 0.587,  
2160 - 0.587,  
2161 - 0.587,  
2162 - 0.587,  
2163 - 0.587,  
2164 - 0.587,  
2165 - 0.587,  
2166 - 0.587,  
2167 - 0.587,  
2168 - 0.587,  
2169 - 0.587,  
2170 - 0.587,  
2171 - 0.587,  
2172 - 0.587,  
2173 - 0.587,  
2174 - 0.587,  
2175 - 0.587,  
2176 - 0.587,  
2177 - 0.587,  
2178 - 0.587,  
2179 - 0.587,  
2180 - 0.587,  
2181 - 0.250,  
2182 - 0.333,  
2183 - 0.713,  
2184 - 0.500,  
2185 - 0.549,  
2186 - 0.833,  
2187 - 0.778,  
2188 - 0.439,  
2189 - 0.333,  
2190 - 0.333,  
2191 - 0.500,  
2192 - 0.549,  
2193 - 0.250,  
2194 - 0.549,  
2195 - 0.250,  
2196 - 0.278,  
2197 - 0.500,  
2198 - 0.500,  
2199 - 0.500,  
2200 - 0.500,  
2201 - 0.500,  
2202 - 0.500,  
2203 - 0.500,  
2204 - 0.500,  
2205 - 0.500,  
2206 - 0.500,  
2207 - 0.278,  
2208 - 0.278,  
2209 - 0.549,  
2210 - 0.549,  
2211 - 0.549,  
2212 - 0.444,  
2213 - 0.549,  
2214 - 0.722,  
2215 - 0.667,  
2216 - 0.722,  
2217 - 0.612,  
2218 - 0.611,  
2219 - 0.763,  
2220 - 0.603,  
2221 - 0.722,  
2222 - 0.333,  
2223 - 0.631,  
2224 - 0.722,  
2225 - 0.686,  
2226 - 0.889,  
2227 - 0.722,  
2228 - 0.722,  
2229 - 0.768,  
2230 - 0.741,  
2231 - 0.556,  
2232 - 0.592,  
2233 - 0.611,  
2234 - 0.690,  
2235 - 0.439,  
2236 - 0.768,  
2237 - 0.645,  
2238 - 0.795,  
2239 - 0.611,  
2240 - 0.333,  
2241 - 0.863,  
2242 - 0.333,  
2243 - 0.658,  
2244 - 0.500,  
2245 - 0.500,  
2246 - 0.631,  
2247 - 0.549,  
2248 - 0.549,  
2249 - 0.494,  
2250 - 0.439,  
2251 - 0.521,  
2252 - 0.411,  
2253 - 0.603,  
2254 - 0.329,  
2255 - 0.603,  
2256 - 0.549,  
2257 - 0.549,  
2258 - 0.576,  
2259 - 0.521,  
2260 - 0.549,  
2261 - 0.549,  
2262 - 0.521,  
2263 - 0.549,  
2264 - 0.603,  
2265 - 0.439,  
2266 - 0.576,  
2267 - 0.713,  
2268 - 0.686,  
2269 - 0.493,  
2270 - 0.686,  
2271 - 0.494,  
2272 - 0.480,  
2273 - 0.200,  
2274 - 0.480,  
2275 - 0.549,  
2276 - 0.587,  
2277 - 0.587,  
2278 - 0.587,  
2279 - 0.587,  
2280 - 0.587,  
2281 - 0.587,  
2282 - 0.587,  
2283 - 0.587,  
2284 - 0.587,  
2285 - 0.587,  
2286 - 0.587,  
2287 - 0.587,  
2288 - 0.587,  
2289 - 0.587,  
2290 - 0.587,  
2291 - 0.587,  
2292 - 0.587,  
2293 - 0.587,  
2294 - 0.587,  
2295 - 0.587,  
2296 - 0.587,  
2297 - 0.587,  
2298 - 0.587,  
2299 - 0.587,  
2300 - 0.587,  
2301 - 0.587,  
2302 - 0.587,  
2303 - 0.587,  
2304 - 0.587,  
2305 - 0.587,  
2306 - 0.587,  
2307 - 0.587,  
2308 - 0.587,  
2309 - 0.750,  
2310 - 0.620,  
2311 - 0.247,  
2312 - 0.549,  
2313 - 0.167,  
2314 - 0.713,  
2315 - 0.500,  
2316 - 0.753,  
2317 - 0.753,  
2318 - 0.753,  
2319 - 0.753,  
2320 - 1.042,  
2321 - 0.987,  
2322 - 0.603,  
2323 - 0.987,  
2324 - 0.603,  
2325 - 0.400,  
2326 - 0.549,  
2327 - 0.411,  
2328 - 0.549,  
2329 - 0.549,  
2330 - 0.713,  
2331 - 0.494,  
2332 - 0.460,  
2333 - 0.549,  
2334 - 0.549,  
2335 - 0.549,  
2336 - 0.549,  
2337 - 1.000,  
2338 - 0.603,  
2339 - 1.000,  
2340 - 0.658,  
2341 - 0.823,  
2342 - 0.686,  
2343 - 0.795,  
2344 - 0.987,  
2345 - 0.768,  
2346 - 0.768,  
2347 - 0.823,  
2348 - 0.768,  
2349 - 0.768,  
2350 - 0.713,  
2351 - 0.713,  
2352 - 0.713,  
2353 - 0.713,  
2354 - 0.713,  
2355 - 0.713,  
2356 - 0.713,  
2357 - 0.768,  
2358 - 0.713,  
2359 - 0.790,  
2360 - 0.790,  
2361 - 0.890,  
2362 - 0.823,  
2363 - 0.549,  
2364 - 0.250,  
2365 - 0.713,  
2366 - 0.603,  
2367 - 0.603,  
2368 - 1.042,  
2369 - 0.987,  
2370 - 0.603,  
2371 - 0.987,  
2372 - 0.603,  
2373 - 0.494,  
2374 - 0.329,  
2375 - 0.790,  
2376 - 0.790,  
2377 - 0.786,  
2378 - 0.713,  
2379 - 0.384,  
2380 - 0.384,  
2381 - 0.384,  
2382 - 0.384,  
2383 - 0.384,  
2384 - 0.384,  
2385 - 0.494,  
2386 - 0.494,  
2387 - 0.494,  
2388 - 0.494,  
2389 - 0.587,  
2390 - 0.329,  
2391 - 0.274,  
2392 - 0.686,  
2393 - 0.686,  
2394 - 0.686,  
2395 - 0.384,  
2396 - 0.384,  
2397 - 0.384,  
2398 - 0.384,  
2399 - 0.384,  
2400 - 0.384,  
2401 - 0.494,  
2402 - 0.494,  
2403 - 0.494,  
2404 - 0.587  
2405 - ]); 93 + return PdfType1Font._create(
  94 + pdfDocument, 'Symbol', 1.010, -0.293, _symbolWidths);
2406 } 95 }
2407 96
2408 factory PdfFont.zapfDingbats(PdfDocument pdfDocument) { 97 factory PdfFont.zapfDingbats(PdfDocument pdfDocument) {
2409 return PdfType1Font._create( 98 return PdfType1Font._create(
2410 - pdfDocument, 'ZapfDingbats', 0.820, -0.143, <double>[  
2411 - 0.746,  
2412 - 0.746,  
2413 - 0.746,  
2414 - 0.746,  
2415 - 0.746,  
2416 - 0.746,  
2417 - 0.746,  
2418 - 0.746,  
2419 - 0.746,  
2420 - 0.746,  
2421 - 0.746,  
2422 - 0.746,  
2423 - 0.746,  
2424 - 0.746,  
2425 - 0.746,  
2426 - 0.746,  
2427 - 0.746,  
2428 - 0.746,  
2429 - 0.746,  
2430 - 0.746,  
2431 - 0.746,  
2432 - 0.746,  
2433 - 0.746,  
2434 - 0.746,  
2435 - 0.746,  
2436 - 0.746,  
2437 - 0.746,  
2438 - 0.746,  
2439 - 0.746,  
2440 - 0.746,  
2441 - 0.746,  
2442 - 0.746,  
2443 - 0.278,  
2444 - 0.974,  
2445 - 0.961,  
2446 - 0.974,  
2447 - 0.980,  
2448 - 0.719,  
2449 - 0.789,  
2450 - 0.790,  
2451 - 0.791,  
2452 - 0.690,  
2453 - 0.960,  
2454 - 0.939,  
2455 - 0.549,  
2456 - 0.855,  
2457 - 0.911,  
2458 - 0.933,  
2459 - 0.911,  
2460 - 0.945,  
2461 - 0.974,  
2462 - 0.755,  
2463 - 0.846,  
2464 - 0.762,  
2465 - 0.761,  
2466 - 0.571,  
2467 - 0.677,  
2468 - 0.763,  
2469 - 0.760,  
2470 - 0.759,  
2471 - 0.754,  
2472 - 0.494,  
2473 - 0.552,  
2474 - 0.537,  
2475 - 0.577,  
2476 - 0.692,  
2477 - 0.786,  
2478 - 0.788,  
2479 - 0.788,  
2480 - 0.790,  
2481 - 0.793,  
2482 - 0.794,  
2483 - 0.816,  
2484 - 0.823,  
2485 - 0.789,  
2486 - 0.841,  
2487 - 0.823,  
2488 - 0.833,  
2489 - 0.816,  
2490 - 0.831,  
2491 - 0.923,  
2492 - 0.744,  
2493 - 0.723,  
2494 - 0.749,  
2495 - 0.790,  
2496 - 0.792,  
2497 - 0.695,  
2498 - 0.776,  
2499 - 0.768,  
2500 - 0.792,  
2501 - 0.759,  
2502 - 0.707,  
2503 - 0.708,  
2504 - 0.682,  
2505 - 0.701,  
2506 - 0.826,  
2507 - 0.815,  
2508 - 0.789,  
2509 - 0.789,  
2510 - 0.707,  
2511 - 0.687,  
2512 - 0.696,  
2513 - 0.689,  
2514 - 0.786,  
2515 - 0.787,  
2516 - 0.713,  
2517 - 0.791,  
2518 - 0.785,  
2519 - 0.791,  
2520 - 0.873,  
2521 - 0.761,  
2522 - 0.762,  
2523 - 0.762,  
2524 - 0.759,  
2525 - 0.759,  
2526 - 0.892,  
2527 - 0.892,  
2528 - 0.788,  
2529 - 0.784,  
2530 - 0.438,  
2531 - 0.138,  
2532 - 0.277,  
2533 - 0.415,  
2534 - 0.392,  
2535 - 0.392,  
2536 - 0.668,  
2537 - 0.668,  
2538 - 0.746,  
2539 - 0.390,  
2540 - 0.390,  
2541 - 0.317,  
2542 - 0.317,  
2543 - 0.276,  
2544 - 0.276,  
2545 - 0.509,  
2546 - 0.509,  
2547 - 0.410,  
2548 - 0.410,  
2549 - 0.234,  
2550 - 0.234,  
2551 - 0.334,  
2552 - 0.334,  
2553 - 0.746,  
2554 - 0.746,  
2555 - 0.746,  
2556 - 0.746,  
2557 - 0.746,  
2558 - 0.746,  
2559 - 0.746,  
2560 - 0.746,  
2561 - 0.746,  
2562 - 0.746,  
2563 - 0.746,  
2564 - 0.746,  
2565 - 0.746,  
2566 - 0.746,  
2567 - 0.746,  
2568 - 0.746,  
2569 - 0.746,  
2570 - 0.746,  
2571 - 0.746,  
2572 - 0.732,  
2573 - 0.544,  
2574 - 0.544,  
2575 - 0.910,  
2576 - 0.667,  
2577 - 0.760,  
2578 - 0.760,  
2579 - 0.776,  
2580 - 0.595,  
2581 - 0.694,  
2582 - 0.626,  
2583 - 0.788,  
2584 - 0.788,  
2585 - 0.788,  
2586 - 0.788,  
2587 - 0.788,  
2588 - 0.788,  
2589 - 0.788,  
2590 - 0.788,  
2591 - 0.788,  
2592 - 0.788,  
2593 - 0.788,  
2594 - 0.788,  
2595 - 0.788,  
2596 - 0.788,  
2597 - 0.788,  
2598 - 0.788,  
2599 - 0.788,  
2600 - 0.788,  
2601 - 0.788,  
2602 - 0.788,  
2603 - 0.788,  
2604 - 0.788,  
2605 - 0.788,  
2606 - 0.788,  
2607 - 0.788,  
2608 - 0.788,  
2609 - 0.788,  
2610 - 0.788,  
2611 - 0.788,  
2612 - 0.788,  
2613 - 0.788,  
2614 - 0.788,  
2615 - 0.788,  
2616 - 0.788,  
2617 - 0.788,  
2618 - 0.788,  
2619 - 0.788,  
2620 - 0.788,  
2621 - 0.788,  
2622 - 0.788,  
2623 - 0.894,  
2624 - 0.838,  
2625 - 1.016,  
2626 - 0.458,  
2627 - 0.748,  
2628 - 0.924,  
2629 - 0.748,  
2630 - 0.918,  
2631 - 0.927,  
2632 - 0.928,  
2633 - 0.928,  
2634 - 0.834,  
2635 - 0.873,  
2636 - 0.828,  
2637 - 0.924,  
2638 - 0.924,  
2639 - 0.917,  
2640 - 0.930,  
2641 - 0.931,  
2642 - 0.463,  
2643 - 0.883,  
2644 - 0.836,  
2645 - 0.836,  
2646 - 0.867,  
2647 - 0.867,  
2648 - 0.696,  
2649 - 0.696,  
2650 - 0.874,  
2651 - 0.746,  
2652 - 0.874,  
2653 - 0.760,  
2654 - 0.946,  
2655 - 0.771,  
2656 - 0.865,  
2657 - 0.771,  
2658 - 0.888,  
2659 - 0.967,  
2660 - 0.888,  
2661 - 0.831,  
2662 - 0.873,  
2663 - 0.927,  
2664 - 0.970,  
2665 - 0.918,  
2666 - 0.746  
2667 - ]); 99 + pdfDocument, 'ZapfDingbats', 0.820, -0.143, _zapfDingbatsWidths);
2668 } 100 }
2669 101
2670 /// The df type of the font, usually /Type1 102 /// The df type of the font, usually /Type1
@@ -2674,6 +106,12 @@ class PdfFont extends PdfObject { @@ -2674,6 +106,12 @@ class PdfFont extends PdfObject {
2674 106
2675 String get fontName => null; 107 String get fontName => null;
2676 108
  109 + double get ascent => null;
  110 +
  111 + double get descent => null;
  112 +
  113 + static const double defaultGlyphWidth = 0.600;
  114 +
2677 /// @param os OutputStream to send the object to 115 /// @param os OutputStream to send the object to
2678 @override 116 @override
2679 void _prepare() { 117 void _prepare() {
@@ -2684,58 +122,35 @@ class PdfFont extends PdfObject { @@ -2684,58 +122,35 @@ class PdfFont extends PdfObject {
2684 params['/Encoding'] = PdfStream.string('/WinAnsiEncoding'); 122 params['/Encoding'] = PdfStream.string('/WinAnsiEncoding');
2685 } 123 }
2686 124
2687 - double glyphAdvance(int charCode) {  
2688 - return 0.454;  
2689 - } 125 + // Use glyphMetrics instead
  126 + @deprecated
  127 + double glyphAdvance(int charCode) => glyphMetrics(charCode).advanceWidth;
2690 128
2691 - PdfRect glyphBounds(int charCode) {  
2692 - return PdfRect(0.0, 0.0, glyphAdvance(charCode), 1.0);  
2693 - } 129 + PdfFontMetrics glyphMetrics(int charCode);
2694 130
2695 - PdfRect stringBounds(String s) {  
2696 - final Uint8List chars = latin1.encode(s); 131 + // Use glyphMetrics instead
  132 + @deprecated
  133 + PdfRect glyphBounds(int charCode) => glyphMetrics(charCode).toPdfRect();
2697 134
2698 - if (chars.isEmpty) {  
2699 - return const PdfRect(0.0, 0.0, 0.0, 0.0); 135 + PdfFontMetrics stringMetrics(String s) {
  136 + if (s.isEmpty) {
  137 + return PdfFontMetrics.zero;
2700 } 138 }
2701 139
2702 - int n = 0;  
2703 - int c = chars[n];  
2704 - PdfRect r = glyphBounds(c);  
2705 - final double x = r.x;  
2706 - double y = r.y;  
2707 - double h = r.height;  
2708 - double w = n == chars.length - 1 ? r.width : glyphAdvance(c);  
2709 -  
2710 - while (++n < chars.length) {  
2711 - c = chars[n];  
2712 - r = glyphBounds(c);  
2713 - if (r.y < y) {  
2714 - y = r.y;  
2715 - }  
2716 - if (r.height > h) {  
2717 - h = r.height;  
2718 - }  
2719 - w += n == chars.length - 1 ? r.width : glyphAdvance(c);  
2720 - }  
2721 -  
2722 - return PdfRect(x, y, w, h);  
2723 - }  
2724 -  
2725 - PdfPoint stringSize(String s) {  
2726 final Uint8List chars = latin1.encode(s); 140 final Uint8List chars = latin1.encode(s);
  141 + final Iterable<PdfFontMetrics> metrics = chars.map(glyphMetrics);
  142 + return PdfFontMetrics.append(metrics);
  143 + }
2727 144
2728 - double w = 0.0;  
2729 - double h = 0.0;  
2730 -  
2731 - for (int c in chars) {  
2732 - final PdfRect r = glyphBounds(c);  
2733 - if (r.height > h) {  
2734 - h = r.height;  
2735 - }  
2736 - w += glyphAdvance(c);  
2737 - } 145 + // Use stringMetrics instead
  146 + @deprecated
  147 + PdfRect stringBounds(String s) => stringMetrics(s).toPdfRect();
2738 148
2739 - return PdfPoint(w, h); 149 + PdfPoint stringSize(String s) {
  150 + final PdfFontMetrics metrics = stringMetrics(s);
  151 + return PdfPoint(metrics.width, metrics.height);
2740 } 152 }
  153 +
  154 + @override
  155 + String toString() => 'Font($fontName)';
2741 } 156 }
@@ -28,18 +28,18 @@ class PdfFontDescriptor extends PdfObject { @@ -28,18 +28,18 @@ class PdfFontDescriptor extends PdfObject {
28 void _prepare() { 28 void _prepare() {
29 super._prepare(); 29 super._prepare();
30 30
31 - params['/FontName'] = PdfStream.string(ttfFont.fontName); 31 + params['/FontName'] = PdfStream.string('/' + ttfFont.fontName);
32 params['/FontFile2'] = file.ref(); 32 params['/FontFile2'] = file.ref();
33 params['/Flags'] = PdfStream.intNum(32); 33 params['/Flags'] = PdfStream.intNum(32);
34 params['/FontBBox'] = PdfStream() 34 params['/FontBBox'] = PdfStream()
35 ..putIntArray(<int>[ 35 ..putIntArray(<int>[
36 - ttfFont.font.xMin,  
37 - ttfFont.font.yMin,  
38 - ttfFont.font.xMax,  
39 - ttfFont.font.yMax 36 + (ttfFont.font.xMin / ttfFont.font.unitsPerEm * 1000).toInt(),
  37 + (ttfFont.font.yMin / ttfFont.font.unitsPerEm * 1000).toInt(),
  38 + (ttfFont.font.xMax / ttfFont.font.unitsPerEm * 1000).toInt(),
  39 + (ttfFont.font.yMax / ttfFont.font.unitsPerEm * 1000).toInt()
40 ]); 40 ]);
41 - params['/Ascent'] = PdfStream.intNum(ttfFont.font.ascent);  
42 - params['/Descent'] = PdfStream.intNum(ttfFont.font.descent); 41 + params['/Ascent'] = PdfStream.intNum((ttfFont.ascent * 1000).toInt());
  42 + params['/Descent'] = PdfStream.intNum((ttfFont.descent * 1000).toInt());
43 params['/ItalicAngle'] = PdfStream.intNum(0); 43 params['/ItalicAngle'] = PdfStream.intNum(0);
44 params['/CapHeight'] = PdfStream.intNum(10); 44 params['/CapHeight'] = PdfStream.intNum(10);
45 params['/StemV'] = PdfStream.intNum(79); 45 params['/StemV'] = PdfStream.intNum(79);
  1 +/*
  2 + * Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +
  17 +part of pdf;
  18 +
  19 +@immutable
  20 +class PdfFontMetrics {
  21 + const PdfFontMetrics(
  22 + {@required this.left,
  23 + @required this.top,
  24 + @required this.right,
  25 + @required this.bottom,
  26 + double ascent,
  27 + double descent,
  28 + double advanceWidth})
  29 + : ascent = ascent ?? bottom,
  30 + descent = descent ?? top,
  31 + advanceWidth = advanceWidth ?? right - left,
  32 + assert(left != null),
  33 + assert(top != null),
  34 + assert(right != null),
  35 + assert(bottom != null),
  36 + assert(left <= right),
  37 + assert(top <= bottom),
  38 + assert((descent ?? top) <= (ascent ?? bottom));
  39 +
  40 + factory PdfFontMetrics.append(Iterable<PdfFontMetrics> metrics) {
  41 + if (metrics.isEmpty) {
  42 + return PdfFontMetrics.zero;
  43 + }
  44 +
  45 + double left;
  46 + double top;
  47 + double right = 0.0;
  48 + double bottom;
  49 + double ascent;
  50 + double descent;
  51 + double lastBearing;
  52 +
  53 + for (PdfFontMetrics metric in metrics) {
  54 + left ??= metric.left;
  55 + right += metric.advanceWidth;
  56 + lastBearing = metric.rightBearing;
  57 +
  58 + top = math.min(top ?? metric.top, metric.top);
  59 + bottom = math.max(bottom ?? metric.bottom, metric.bottom);
  60 + descent = math.min(descent ?? metric.descent, metric.descent);
  61 + ascent = math.max(ascent ?? metric.ascent, metric.ascent);
  62 + }
  63 +
  64 + return PdfFontMetrics(
  65 + left: left,
  66 + top: top,
  67 + right: right - lastBearing,
  68 + bottom: bottom,
  69 + ascent: ascent,
  70 + descent: descent,
  71 + advanceWidth: right);
  72 + }
  73 +
  74 + static const PdfFontMetrics zero =
  75 + PdfFontMetrics(left: 0.0, top: 0.0, right: 0.0, bottom: 0.0);
  76 +
  77 + final double left;
  78 +
  79 + final double top;
  80 +
  81 + final double bottom;
  82 +
  83 + final double right;
  84 +
  85 + final double ascent;
  86 +
  87 + final double descent;
  88 +
  89 + final double advanceWidth;
  90 +
  91 + double get width => right - left;
  92 +
  93 + double get height => bottom - top;
  94 +
  95 + double get maxHeight => ascent - descent;
  96 +
  97 + double get maxWidth =>
  98 + math.max(advanceWidth, right) + math.max(-leftBearing, 0.0);
  99 +
  100 + double get effectiveLeft => math.min(leftBearing, 0.0);
  101 +
  102 + double get leftBearing => left;
  103 +
  104 + double get rightBearing => advanceWidth - right;
  105 +
  106 + @override
  107 + String toString() =>
  108 + 'PdfFontMetrics(left:$left, top:$top, right:$right, bottom:$bottom, ascent:$ascent, descent:$descent, advanceWidth:$advanceWidth)';
  109 +
  110 + PdfFontMetrics copyWith(
  111 + {double left,
  112 + double top,
  113 + double right,
  114 + double bottom,
  115 + double ascent,
  116 + double descent,
  117 + double advanceWidth}) {
  118 + return PdfFontMetrics(
  119 + left: left ?? this.left,
  120 + top: top ?? this.top,
  121 + right: right ?? this.right,
  122 + bottom: bottom ?? this.bottom,
  123 + ascent: ascent ?? this.ascent,
  124 + descent: descent ?? this.descent,
  125 + advanceWidth: advanceWidth ?? this.advanceWidth);
  126 + }
  127 +
  128 + PdfFontMetrics operator *(double factor) {
  129 + return copyWith(
  130 + left: left * factor,
  131 + top: top * factor,
  132 + right: right * factor,
  133 + bottom: bottom * factor,
  134 + ascent: ascent * factor,
  135 + descent: descent * factor,
  136 + advanceWidth: advanceWidth * factor,
  137 + );
  138 + }
  139 +
  140 + PdfRect toPdfRect() => PdfRect.fromLTRB(left, top, right, bottom);
  141 +}
@@ -32,4 +32,7 @@ class PdfPoint { @@ -32,4 +32,7 @@ class PdfPoint {
32 32
33 @override 33 @override
34 String toString() => 'PdfPoint($x, $y)'; 34 String toString() => 'PdfPoint($x, $y)';
  35 +
  36 + PdfPoint translate(double offsetX, double offsetY) =>
  37 + PdfPoint(x + offsetX, y + offsetY);
35 } 38 }
@@ -27,7 +27,6 @@ class TtfParser { @@ -27,7 +27,6 @@ class TtfParser {
27 } 27 }
28 28
29 _parseFontName(); 29 _parseFontName();
30 - _parseHmtx();  
31 _parseCMap(); 30 _parseCMap();
32 _parseIndexes(); 31 _parseIndexes();
33 _parseGlyf(); 32 _parseGlyf();
@@ -45,10 +44,9 @@ class TtfParser { @@ -45,10 +44,9 @@ class TtfParser {
45 final ByteData bytes; 44 final ByteData bytes;
46 final Map<String, int> _tableOffsets = <String, int>{}; 45 final Map<String, int> _tableOffsets = <String, int>{};
47 String _fontName; 46 String _fontName;
48 - final List<double> advanceWidth = <double>[];  
49 final Map<int, int> charToGlyphIndexMap = <int, int>{}; 47 final Map<int, int> charToGlyphIndexMap = <int, int>{};
50 final List<int> glyphOffsets = <int>[]; 48 final List<int> glyphOffsets = <int>[];
51 - final Map<int, PdfRect> glyphInfoMap = <int, PdfRect>{}; 49 + final Map<int, PdfFontMetrics> glyphInfoMap = <int, PdfFontMetrics>{};
52 50
53 int get unitsPerEm => bytes.getUint16(_tableOffsets[_HEAD] + 18); 51 int get unitsPerEm => bytes.getUint16(_tableOffsets[_HEAD] + 18);
54 52
@@ -72,6 +70,7 @@ class TtfParser { @@ -72,6 +70,7 @@ class TtfParser {
72 70
73 String get fontName => _fontName; 71 String get fontName => _fontName;
74 72
  73 + // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html
75 void _parseFontName() { 74 void _parseFontName() {
76 final int basePosition = _tableOffsets[_NAME]; 75 final int basePosition = _tableOffsets[_NAME];
77 final int count = bytes.getUint16(basePosition + 2); 76 final int count = bytes.getUint16(basePosition + 2);
@@ -84,22 +83,27 @@ class TtfParser { @@ -84,22 +83,27 @@ class TtfParser {
84 final int offset = bytes.getUint16(pos + 10); 83 final int offset = bytes.getUint16(pos + 10);
85 pos += 12; 84 pos += 12;
86 if (platformID == 1 && nameID == 6) { 85 if (platformID == 1 && nameID == 6) {
87 - _fontName = utf8.decode(bytes.buffer  
88 - .asUint8List(basePosition + stringOffset + offset, length));  
89 - return; 86 + try {
  87 + _fontName = utf8.decode(bytes.buffer
  88 + .asUint8List(basePosition + stringOffset + offset, length));
  89 + return;
  90 + } catch (a) {
  91 + print('Error: $platformID $nameID $a');
  92 + }
  93 + }
  94 + if (platformID == 3 && nameID == 6) {
  95 + try {
  96 + _fontName = decodeUtf16(bytes.buffer
  97 + .asUint8List(basePosition + stringOffset + offset, length));
  98 + return;
  99 + } catch (a) {
  100 + print('Error: $platformID $nameID $a');
  101 + }
90 } 102 }
91 } 103 }
92 _fontName = hashCode.toString(); 104 _fontName = hashCode.toString();
93 } 105 }
94 106
95 - void _parseHmtx() {  
96 - final int offset = _tableOffsets[_HMTX];  
97 - final int unitsPerEm = this.unitsPerEm;  
98 - for (int i = 0; i < numOfLongHorMetrics; i++) {  
99 - advanceWidth.add(bytes.getInt16(offset + i * 4).toDouble() / unitsPerEm);  
100 - }  
101 - }  
102 -  
103 void _parseCMap() { 107 void _parseCMap() {
104 final int basePosition = _tableOffsets[_CMAP]; 108 final int basePosition = _tableOffsets[_CMAP];
105 final int numSubTables = bytes.getUint16(basePosition + 2); 109 final int numSubTables = bytes.getUint16(basePosition + 2);
@@ -199,8 +203,10 @@ class TtfParser { @@ -199,8 +203,10 @@ class TtfParser {
199 } 203 }
200 } 204 }
201 205
  206 + /// https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html
202 void _parseGlyf() { 207 void _parseGlyf() {
203 final int baseOffset = _tableOffsets[_GLYF]; 208 final int baseOffset = _tableOffsets[_GLYF];
  209 + final int hmtxOffset = _tableOffsets[_HMTX];
204 final int unitsPerEm = this.unitsPerEm; 210 final int unitsPerEm = this.unitsPerEm;
205 int glyphIndex = 0; 211 int glyphIndex = 0;
206 for (int offset in glyphOffsets) { 212 for (int offset in glyphOffsets) {
@@ -208,11 +214,17 @@ class TtfParser { @@ -208,11 +214,17 @@ class TtfParser {
208 final int yMin = bytes.getInt16(baseOffset + offset + 4); // 4 214 final int yMin = bytes.getInt16(baseOffset + offset + 4); // 4
209 final int xMax = bytes.getInt16(baseOffset + offset + 6); // 6 215 final int xMax = bytes.getInt16(baseOffset + offset + 6); // 6
210 final int yMax = bytes.getInt16(baseOffset + offset + 8); // 8 216 final int yMax = bytes.getInt16(baseOffset + offset + 8); // 8
211 - glyphInfoMap[glyphIndex] = PdfRect(  
212 - xMin.toDouble() / unitsPerEm,  
213 - yMin.toDouble() / unitsPerEm,  
214 - xMax.toDouble() / unitsPerEm,  
215 - yMax.toDouble() / unitsPerEm); 217 + final double advanceWidth = glyphIndex < numOfLongHorMetrics
  218 + ? bytes.getInt16(hmtxOffset + glyphIndex * 4).toDouble() / unitsPerEm
  219 + : null;
  220 + glyphInfoMap[glyphIndex] = PdfFontMetrics(
  221 + left: xMin.toDouble() / unitsPerEm,
  222 + top: yMin.toDouble() / unitsPerEm,
  223 + right: xMax.toDouble() / unitsPerEm,
  224 + bottom: yMax.toDouble() / unitsPerEm,
  225 + ascent: ascent.toDouble() / unitsPerEm,
  226 + descent: descent.toDouble() / unitsPerEm,
  227 + advanceWidth: advanceWidth);
216 glyphIndex++; 228 glyphIndex++;
217 } 229 }
218 } 230 }
@@ -29,8 +29,10 @@ class PdfTtfFont extends PdfFont { @@ -29,8 +29,10 @@ class PdfTtfFont extends PdfFont {
29 _charMin = 32; 29 _charMin = 32;
30 _charMax = 255; 30 _charMax = 255;
31 31
  32 + final List<String> widths = <String>[];
  33 +
32 for (int i = _charMin; i <= _charMax; i++) { 34 for (int i = _charMin; i <= _charMax; i++) {
33 - widths.add((glyphAdvance(i) * 1000.0).toString()); 35 + widths.add((glyphMetrics(i).advanceWidth * 1000.0).toInt().toString());
34 } 36 }
35 37
36 unicodeCMap = PdfObject(pdfDocument); 38 unicodeCMap = PdfObject(pdfDocument);
@@ -44,8 +46,6 @@ class PdfTtfFont extends PdfFont { @@ -44,8 +46,6 @@ class PdfTtfFont extends PdfFont {
44 46
45 PdfArrayObject widthsObject; 47 PdfArrayObject widthsObject;
46 48
47 - final List<String> widths = <String>[];  
48 -  
49 final TtfParser font; 49 final TtfParser font;
50 50
51 int _charMin; 51 int _charMin;
@@ -53,36 +53,30 @@ class PdfTtfFont extends PdfFont { @@ -53,36 +53,30 @@ class PdfTtfFont extends PdfFont {
53 int _charMax; 53 int _charMax;
54 54
55 @override 55 @override
56 - String get fontName => '/' + font.fontName.replaceAll(' ', ''); 56 + String get fontName => font.fontName;
57 57
58 @override 58 @override
59 - double glyphAdvance(int charCode) {  
60 - final int g = font.charToGlyphIndexMap[charCode];  
61 -  
62 - if (g == null) {  
63 - return super.glyphAdvance(charCode);  
64 - } 59 + double get ascent => font.ascent.toDouble() / font.unitsPerEm;
65 60
66 - return (g < font.advanceWidth.length ? font.advanceWidth[g] : null) ??  
67 - super.glyphAdvance(charCode);  
68 - } 61 + @override
  62 + double get descent => font.descent.toDouble() / font.unitsPerEm;
69 63
70 @override 64 @override
71 - PdfRect glyphBounds(int charCode) { 65 + PdfFontMetrics glyphMetrics(int charCode) {
72 final int g = font.charToGlyphIndexMap[charCode]; 66 final int g = font.charToGlyphIndexMap[charCode];
73 67
74 if (g == null) { 68 if (g == null) {
75 - return super.glyphBounds(charCode); 69 + return PdfFontMetrics.zero;
76 } 70 }
77 71
78 - return font.glyphInfoMap[g] ?? super.glyphBounds(charCode); 72 + return font.glyphInfoMap[g] ?? PdfFontMetrics.zero;
79 } 73 }
80 74
81 @override 75 @override
82 void _prepare() { 76 void _prepare() {
83 super._prepare(); 77 super._prepare();
84 78
85 - params['/BaseFont'] = PdfStream.string(fontName); 79 + params['/BaseFont'] = PdfStream.string('/' + fontName);
86 params['/FirstChar'] = PdfStream.intNum(_charMin); 80 params['/FirstChar'] = PdfStream.intNum(_charMin);
87 params['/LastChar'] = PdfStream.intNum(_charMax); 81 params['/LastChar'] = PdfStream.intNum(_charMax);
88 params['/Widths'] = widthsObject.ref(); 82 params['/Widths'] = widthsObject.ref();
@@ -26,8 +26,10 @@ class PdfType1Font extends PdfFont { @@ -26,8 +26,10 @@ class PdfType1Font extends PdfFont {
26 @override 26 @override
27 final String fontName; 27 final String fontName;
28 28
  29 + @override
29 final double ascent; 30 final double ascent;
30 31
  32 + @override
31 final double descent; 33 final double descent;
32 34
33 final List<double> widths; 35 final List<double> widths;
@@ -41,16 +43,13 @@ class PdfType1Font extends PdfFont { @@ -41,16 +43,13 @@ class PdfType1Font extends PdfFont {
41 } 43 }
42 44
43 @override 45 @override
44 - double glyphAdvance(int charCode) {  
45 - if (charCode > widths.length) {  
46 - return super.glyphAdvance(charCode);  
47 - }  
48 -  
49 - return widths[charCode];  
50 - }  
51 -  
52 - @override  
53 - PdfRect glyphBounds(int charCode) {  
54 - return PdfRect(0.0, descent, glyphAdvance(charCode), ascent); 46 + PdfFontMetrics glyphMetrics(int charCode) {
  47 + return PdfFontMetrics(
  48 + left: 0.0,
  49 + top: descent,
  50 + right: charCode < widths.length
  51 + ? widths[charCode]
  52 + : PdfFont.defaultGlyphWidth,
  53 + bottom: ascent);
55 } 54 }
56 } 55 }