combine_pdf 0.2.5 → 0.2.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +273 -27
- data/LICENSE.txt +2 -1
- data/README.md +69 -4
- data/lib/combine_pdf/api.rb +156 -153
- data/lib/combine_pdf/basic_writer.rb +41 -53
- data/lib/combine_pdf/decrypt.rb +238 -228
- data/lib/combine_pdf/exceptions.rb +4 -0
- data/lib/combine_pdf/filter.rb +79 -85
- data/lib/combine_pdf/fonts.rb +451 -462
- data/lib/combine_pdf/page_methods.rb +891 -946
- data/lib/combine_pdf/parser.rb +663 -531
- data/lib/combine_pdf/pdf_protected.rb +341 -126
- data/lib/combine_pdf/pdf_public.rb +492 -454
- data/lib/combine_pdf/renderer.rb +146 -141
- data/lib/combine_pdf/version.rb +1 -2
- data/lib/combine_pdf.rb +14 -18
- data/test/automated +132 -0
- data/test/console +4 -4
- data/test/named_dest +84 -0
- metadata +8 -5
- data/lib/combine_pdf/operations.rb +0 -416
data/lib/combine_pdf/fonts.rb
CHANGED
@@ -5,470 +5,459 @@
|
|
5
5
|
## is subject to the same license.
|
6
6
|
########################################################
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
8
|
module CombinePDF
|
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
|
-
end
|
71
|
-
end
|
9
|
+
#:nodoc: all
|
10
|
+
# @!visibility private
|
11
|
+
|
12
|
+
module Fonts
|
13
|
+
extend Renderer
|
14
|
+
|
15
|
+
protected
|
16
|
+
|
17
|
+
# @!visibility private
|
18
|
+
|
19
|
+
# the internal class for the Fonts model
|
20
|
+
#
|
21
|
+
# this is an internal class, used by PDFWriter and PDF. you don't normally need to use this.
|
22
|
+
class Font < Hash
|
23
|
+
# set/get the name of the font
|
24
|
+
attr_accessor :name
|
25
|
+
# set/get a character/Glyph mapping for the font (the equivilant of a CMap)
|
26
|
+
#
|
27
|
+
# the cmap is a Hash were each key is the unicode character code and the value is the glyph ID for the font.
|
28
|
+
attr_accessor :cmap
|
29
|
+
# get the metrics dictionary for the font
|
30
|
+
attr_reader :metrics
|
31
|
+
# set the metrics dictionary of the font, making sure the :missing value is set.
|
32
|
+
def metrics=(new_metrics)
|
33
|
+
@metrics = new_metrics
|
34
|
+
@metrics[:missing] = @metrics.first[1] unless @metrics[:missing]
|
35
|
+
end
|
36
|
+
|
37
|
+
# internelized a new Font object, setting it's name, it's metrics Hash and the object Hash.
|
38
|
+
# Optionally set a CMap, if the glyph ID and character codes aren't the same.
|
39
|
+
def initialize(name = nil, font_metrics = { 32 => { wx: 250, boundingbox: [0, 0, 0, 0] } }, object = nil, c_map = nil)
|
40
|
+
self.name = name
|
41
|
+
self.cmap = c_map
|
42
|
+
self.metrics = font_metrics
|
43
|
+
self[:is_reference_only] = true
|
44
|
+
self[:referenced_object] = object
|
45
|
+
end
|
46
|
+
|
47
|
+
# This function translate a unicode string, to a character glyph ID stream.
|
48
|
+
def encode(text)
|
49
|
+
# FIXME: embed RTL text convertion
|
50
|
+
return format_string_to_pdf(text) unless cmap
|
51
|
+
coded_array = text.chars.map do |c|
|
52
|
+
if cmap[c]
|
53
|
+
cmap[c]
|
54
|
+
else
|
55
|
+
warn "CombinePDF ERROR: couldn't encode string - characters not supported by the chosen font."
|
56
|
+
''
|
57
|
+
end
|
58
|
+
end
|
59
|
+
coded_array.unshift '<'
|
60
|
+
coded_array.push '>'
|
61
|
+
coded_array.join
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
72
65
|
end
|
73
66
|
|
74
|
-
|
75
|
-
|
76
67
|
module CombinePDF
|
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
|
-
symbol_metrics = {" "=>{:wx=>250, :boundingbox=>[0, 0, 0, 0]}, "!"=>{:wx=>333, :boundingbox=>[128, -17, 240, 672]}, "\""=>{:wx=>713, :boundingbox=>[31, 0, 681, 705]}, "#"=>{:wx=>500, :boundingbox=>[20, -16, 481, 673]}, "$"=>{:wx=>549, :boundingbox=>[25, 0, 478, 707]}, "%"=>{:wx=>833, :boundingbox=>[63, -36, 771, 655]}, "&"=>{:wx=>778, :boundingbox=>[41, -18, 750, 661]}, "'"=>{:wx=>439, :boundingbox=>[48, -17, 414, 500]}, "("=>{:wx=>333, :boundingbox=>[53, -191, 300, 673]}, ")"=>{:wx=>333, :boundingbox=>[30, -191, 277, 673]}, "*"=>{:wx=>500, :boundingbox=>[65, 134, 427, 551]}, "+"=>{:wx=>549, :boundingbox=>[10, 0, 539, 533]}, ","=>{:wx=>250, :boundingbox=>[56, -152, 194, 104]}, "-"=>{:wx=>549, :boundingbox=>[11, 233, 535, 288]}, "."=>{:wx=>250, :boundingbox=>[69, -17, 181, 95]}, "/"=>{:wx=>278, :boundingbox=>[0, -18, 254, 646]}, "0"=>{:wx=>500, :boundingbox=>[24, -14, 476, 685]}, "1"=>{:wx=>500, :boundingbox=>[117, 0, 390, 673]}, "2"=>{:wx=>500, :boundingbox=>[25, 0, 475, 685]}, "3"=>{:wx=>500, :boundingbox=>[43, -14, 435, 685]}, "4"=>{:wx=>500, :boundingbox=>[15, 0, 469, 685]}, "5"=>{:wx=>500, :boundingbox=>[32, -14, 445, 690]}, "6"=>{:wx=>500, :boundingbox=>[34, -14, 468, 685]}, "7"=>{:wx=>500, :boundingbox=>[24, -16, 448, 673]}, "8"=>{:wx=>500, :boundingbox=>[56, -14, 445, 685]}, "9"=>{:wx=>500, :boundingbox=>[30, -18, 459, 685]}, ":"=>{:wx=>278, :boundingbox=>[81, -17, 193, 460]}, ";"=>{:wx=>278, :boundingbox=>[83, -152, 221, 460]}, "<"=>{:wx=>549, :boundingbox=>[26, 0, 523, 522]}, "="=>{:wx=>549, :boundingbox=>[11, 141, 537, 390]}, ">"=>{:wx=>549, :boundingbox=>[26, 0, 523, 522]}, "?"=>{:wx=>444, :boundingbox=>[70, -17, 412, 686]}, "@"=>{:wx=>549, :boundingbox=>[11, 0, 537, 475]}, "A"=>{:wx=>722, :boundingbox=>[4, 0, 684, 673]}, "B"=>{:wx=>667, :boundingbox=>[29, 0, 592, 673]}, "C"=>{:wx=>722, :boundingbox=>[-9, 0, 704, 673]}, "D"=>{:wx=>612, :boundingbox=>[6, 0, 608, 688]}, "E"=>{:wx=>611, :boundingbox=>[32, 0, 617, 673]}, "F"=>{:wx=>763, :boundingbox=>[26, 0, 741, 673]}, "G"=>{:wx=>603, :boundingbox=>[24, 0, 609, 673]}, "H"=>{:wx=>722, :boundingbox=>[39, 0, 729, 673]}, "I"=>{:wx=>333, :boundingbox=>[32, 0, 316, 673]}, "J"=>{:wx=>631, :boundingbox=>[18, -18, 623, 689]}, "K"=>{:wx=>722, :boundingbox=>[35, 0, 722, 673]}, "L"=>{:wx=>686, :boundingbox=>[6, 0, 680, 688]}, "M"=>{:wx=>889, :boundingbox=>[28, 0, 887, 673]}, "N"=>{:wx=>722, :boundingbox=>[29, -8, 720, 673]}, "O"=>{:wx=>722, :boundingbox=>[41, -17, 715, 685]}, "P"=>{:wx=>768, :boundingbox=>[25, 0, 745, 673]}, "Q"=>{:wx=>741, :boundingbox=>[41, -17, 715, 685]}, "R"=>{:wx=>556, :boundingbox=>[28, 0, 563, 673]}, "S"=>{:wx=>592, :boundingbox=>[5, 0, 589, 673]}, "T"=>{:wx=>611, :boundingbox=>[33, 0, 607, 673]}, "U"=>{:wx=>690, :boundingbox=>[-8, 0, 694, 673]}, "V"=>{:wx=>439, :boundingbox=>[40, -233, 436, 500]}, "W"=>{:wx=>768, :boundingbox=>[34, 0, 736, 688]}, "X"=>{:wx=>645, :boundingbox=>[40, 0, 599, 673]}, "Y"=>{:wx=>795, :boundingbox=>[15, 0, 781, 684]}, "Z"=>{:wx=>611, :boundingbox=>[44, 0, 636, 673]}, "["=>{:wx=>333, :boundingbox=>[86, -155, 299, 674]}, "\\"=>{:wx=>863, :boundingbox=>[163, 0, 701, 487]}, "]"=>{:wx=>333, :boundingbox=>[33, -155, 246, 674]}, "^"=>{:wx=>658, :boundingbox=>[15, 0, 652, 674]}, "_"=>{:wx=>500, :boundingbox=>[-2, -125, 502, -75]}, "`"=>{:wx=>500, :boundingbox=>[480, 881, 1090, 917]}, "a"=>{:wx=>631, :boundingbox=>[41, -18, 622, 500]}, "b"=>{:wx=>549, :boundingbox=>[61, -223, 515, 741]}, "c"=>{:wx=>549, :boundingbox=>[12, -231, 522, 499]}, "d"=>{:wx=>494, :boundingbox=>[40, -19, 481, 740]}, "e"=>{:wx=>439, :boundingbox=>[22, -19, 427, 502]}, "f"=>{:wx=>521, :boundingbox=>[28, -224, 492, 673]}, "g"=>{:wx=>411, :boundingbox=>[5, -225, 484, 499]}, "h"=>{:wx=>603, :boundingbox=>[0, -202, 527, 514]}, "i"=>{:wx=>329, :boundingbox=>[0, -17, 301, 503]}, "j"=>{:wx=>603, :boundingbox=>[36, -224, 587, 499]}, "k"=>{:wx=>549, :boundingbox=>[33, 0, 558, 501]}, "l"=>{:wx=>549, :boundingbox=>[24, -17, 548, 739]}, "m"=>{:wx=>576, :boundingbox=>[33, -223, 567, 500]}, "n"=>{:wx=>521, :boundingbox=>[-9, -16, 475, 507]}, "o"=>{:wx=>549, :boundingbox=>[35, -19, 501, 499]}, "p"=>{:wx=>549, :boundingbox=>[10, -19, 530, 487]}, "q"=>{:wx=>521, :boundingbox=>[43, -17, 485, 690]}, "r"=>{:wx=>549, :boundingbox=>[50, -230, 490, 499]}, "s"=>{:wx=>603, :boundingbox=>[30, -21, 588, 500]}, "t"=>{:wx=>439, :boundingbox=>[10, -19, 418, 500]}, "u"=>{:wx=>576, :boundingbox=>[7, -18, 535, 507]}, "v"=>{:wx=>713, :boundingbox=>[12, -18, 671, 583]}, "w"=>{:wx=>686, :boundingbox=>[42, -17, 684, 500]}, "x"=>{:wx=>493, :boundingbox=>[27, -224, 469, 766]}, "y"=>{:wx=>686, :boundingbox=>[12, -228, 701, 500]}, "z"=>{:wx=>494, :boundingbox=>[60, -225, 467, 756]}, "{"=>{:wx=>480, :boundingbox=>[58, -183, 397, 673]}, "|"=>{:wx=>200, :boundingbox=>[65, -293, 135, 707]}, "}"=>{:wx=>480, :boundingbox=>[79, -183, 418, 673]}, "~"=>{:wx=>549, :boundingbox=>[17, 203, 529, 307]}, " "=>{:wx=>750, :boundingbox=>[20, -12, 714, 685]}, "¡"=>{:wx=>620, :boundingbox=>[-2, 0, 610, 685]}, "¢"=>{:wx=>247, :boundingbox=>[27, 459, 228, 735]}, "£"=>{:wx=>549, :boundingbox=>[29, 0, 526, 639]}, "¤"=>{:wx=>167, :boundingbox=>[-180, -12, 340, 677]}, "¥"=>{:wx=>713, :boundingbox=>[26, 124, 688, 404]}, "¦"=>{:wx=>500, :boundingbox=>[2, -193, 494, 686]}, "§"=>{:wx=>753, :boundingbox=>[86, -26, 660, 533]}, "¨"=>{:wx=>753, :boundingbox=>[142, -36, 600, 550]}, "©"=>{:wx=>753, :boundingbox=>[117, -33, 631, 532]}, "ª"=>{:wx=>753, :boundingbox=>[113, -36, 629, 548]}, "«"=>{:wx=>1042, :boundingbox=>[24, -15, 1024, 511]}, "¬"=>{:wx=>987, :boundingbox=>[32, -15, 942, 511]}, ""=>{:wx=>603, :boundingbox=>[45, 0, 571, 910]}, "®"=>{:wx=>987, :boundingbox=>[49, -15, 959, 511]}, "¯"=>{:wx=>603, :boundingbox=>[45, -22, 571, 888]}, "°"=>{:wx=>400, :boundingbox=>[50, 385, 350, 685]}, "±"=>{:wx=>549, :boundingbox=>[10, 0, 539, 645]}, "²"=>{:wx=>411, :boundingbox=>[20, 459, 413, 737]}, "³"=>{:wx=>549, :boundingbox=>[29, 0, 526, 639]}, "´"=>{:wx=>549, :boundingbox=>[17, 8, 533, 524]}, "µ"=>{:wx=>713, :boundingbox=>[27, 123, 639, 404]}, "¶"=>{:wx=>494, :boundingbox=>[26, -20, 462, 746]}, "·"=>{:wx=>460, :boundingbox=>[50, 113, 410, 473]}, "¸"=>{:wx=>549, :boundingbox=>[10, 71, 536, 456]}, "¹"=>{:wx=>549, :boundingbox=>[15, -25, 540, 549]}, "º"=>{:wx=>549, :boundingbox=>[14, 82, 538, 443]}, "»"=>{:wx=>549, :boundingbox=>[14, 135, 527, 394]}, "¼"=>{:wx=>1000, :boundingbox=>[111, -17, 889, 95]}, "½"=>{:wx=>603, :boundingbox=>[280, -120, 336, 1010]}, "¾"=>{:wx=>1000, :boundingbox=>[-60, 220, 1050, 276]}, "¿"=>{:wx=>658, :boundingbox=>[15, -16, 602, 629]}, "À"=>{:wx=>823, :boundingbox=>[175, -18, 661, 658]}, "Á"=>{:wx=>686, :boundingbox=>[10, -53, 578, 740]}, "Â"=>{:wx=>795, :boundingbox=>[26, -15, 759, 734]}, "Ã"=>{:wx=>987, :boundingbox=>[159, -211, 870, 573]}, "Ä"=>{:wx=>768, :boundingbox=>[43, -17, 733, 673]}, "Å"=>{:wx=>768, :boundingbox=>[43, -15, 733, 675]}, "Æ"=>{:wx=>823, :boundingbox=>[39, -24, 781, 719]}, "Ç"=>{:wx=>768, :boundingbox=>[40, 0, 732, 509]}, "È"=>{:wx=>768, :boundingbox=>[40, -17, 732, 492]}, "É"=>{:wx=>713, :boundingbox=>[20, 0, 673, 470]}, "Ê"=>{:wx=>713, :boundingbox=>[20, -125, 673, 470]}, "Ë"=>{:wx=>713, :boundingbox=>[36, -70, 690, 540]}, "Ì"=>{:wx=>713, :boundingbox=>[37, 0, 690, 470]}, "Í"=>{:wx=>713, :boundingbox=>[37, -125, 690, 470]}, "Î"=>{:wx=>713, :boundingbox=>[45, 0, 505, 468]}, "Ï"=>{:wx=>713, :boundingbox=>[45, -58, 505, 555]}, "Ð"=>{:wx=>768, :boundingbox=>[26, 0, 738, 673]}, "Ñ"=>{:wx=>713, :boundingbox=>[36, -19, 681, 718]}, "Ò"=>{:wx=>790, :boundingbox=>[50, -17, 740, 673]}, "Ó"=>{:wx=>790, :boundingbox=>[51, -15, 741, 675]}, "Ô"=>{:wx=>890, :boundingbox=>[18, 293, 855, 673]}, "Õ"=>{:wx=>823, :boundingbox=>[25, -101, 803, 751]}, "Ö"=>{:wx=>549, :boundingbox=>[10, -38, 515, 917]}, "×"=>{:wx=>250, :boundingbox=>[69, 210, 169, 310]}, "Ø"=>{:wx=>713, :boundingbox=>[15, 0, 680, 288]}, "Ù"=>{:wx=>603, :boundingbox=>[23, 0, 583, 454]}, "Ú"=>{:wx=>603, :boundingbox=>[30, 0, 578, 477]}, "Û"=>{:wx=>1042, :boundingbox=>[27, -20, 1023, 510]}, "Ü"=>{:wx=>987, :boundingbox=>[30, -15, 939, 513]}, "Ý"=>{:wx=>603, :boundingbox=>[39, 2, 567, 911]}, "Þ"=>{:wx=>987, :boundingbox=>[45, -20, 954, 508]}, "ß"=>{:wx=>603, :boundingbox=>[44, -19, 572, 890]}, "à"=>{:wx=>494, :boundingbox=>[18, 0, 466, 745]}, "á"=>{:wx=>329, :boundingbox=>[25, -198, 306, 746]}, "â"=>{:wx=>790, :boundingbox=>[50, -20, 740, 670]}, "ã"=>{:wx=>790, :boundingbox=>[49, -15, 739, 675]}, "ä"=>{:wx=>786, :boundingbox=>[5, 293, 725, 673]}, "å"=>{:wx=>713, :boundingbox=>[14, -108, 695, 752]}, "æ"=>{:wx=>384, :boundingbox=>[24, -293, 436, 926]}, "ç"=>{:wx=>384, :boundingbox=>[24, -85, 108, 925]}, "è"=>{:wx=>384, :boundingbox=>[24, -293, 436, 926]}, "é"=>{:wx=>384, :boundingbox=>[0, -80, 349, 926]}, "ê"=>{:wx=>384, :boundingbox=>[0, -79, 77, 925]}, "ë"=>{:wx=>384, :boundingbox=>[0, -80, 349, 926]}, "ì"=>{:wx=>494, :boundingbox=>[209, -85, 445, 925]}, "í"=>{:wx=>494, :boundingbox=>[20, -85, 284, 935]}, "î"=>{:wx=>494, :boundingbox=>[209, -75, 445, 935]}, "ï"=>{:wx=>494, :boundingbox=>[209, -85, 284, 935]}, "ñ"=>{:wx=>329, :boundingbox=>[21, -198, 302, 746]}, "ò"=>{:wx=>274, :boundingbox=>[2, -107, 291, 916]}, "ó"=>{:wx=>686, :boundingbox=>[308, -88, 675, 920]}, "ô"=>{:wx=>686, :boundingbox=>[308, -88, 378, 975]}, "õ"=>{:wx=>686, :boundingbox=>[11, -87, 378, 921]}, "ö"=>{:wx=>384, :boundingbox=>[54, -293, 466, 926]}, "÷"=>{:wx=>384, :boundingbox=>[382, -85, 466, 925]}, "ø"=>{:wx=>384, :boundingbox=>[54, -293, 466, 926]}, "ù"=>{:wx=>384, :boundingbox=>[22, -80, 371, 926]}, "ú"=>{:wx=>384, :boundingbox=>[294, -79, 371, 925]}, "û"=>{:wx=>384, :boundingbox=>[22, -80, 371, 926]}, "ü"=>{:wx=>494, :boundingbox=>[48, -85, 284, 925]}, "ý"=>{:wx=>494, :boundingbox=>[209, -85, 473, 935]}, "þ"=>{:wx=>494, :boundingbox=>[48, -75, 284, 935]}, "\xFF"=>{:wx=>790, :boundingbox=>[56, -3, 733, 808]}}
|
182
|
-
zapfdingbats_metrics = {" "=>{:wx=>278, :boundingbox=>[0, 0, 0, 0]}, "!"=>{:wx=>974, :boundingbox=>[35, 72, 939, 621]}, "\""=>{:wx=>961, :boundingbox=>[35, 81, 927, 611]}, "#"=>{:wx=>974, :boundingbox=>[35, 72, 939, 621]}, "$"=>{:wx=>980, :boundingbox=>[35, 0, 945, 692]}, "%"=>{:wx=>719, :boundingbox=>[34, 139, 685, 566]}, "&"=>{:wx=>789, :boundingbox=>[35, -14, 755, 705]}, "'"=>{:wx=>790, :boundingbox=>[35, -14, 755, 705]}, "("=>{:wx=>791, :boundingbox=>[35, -13, 761, 705]}, ")"=>{:wx=>690, :boundingbox=>[34, 138, 655, 553]}, "*"=>{:wx=>960, :boundingbox=>[35, 123, 925, 568]}, "+"=>{:wx=>939, :boundingbox=>[35, 134, 904, 559]}, ","=>{:wx=>549, :boundingbox=>[29, -11, 516, 705]}, "-"=>{:wx=>855, :boundingbox=>[34, 59, 820, 632]}, "."=>{:wx=>911, :boundingbox=>[35, 50, 876, 642]}, "/"=>{:wx=>933, :boundingbox=>[35, 139, 899, 550]}, "0"=>{:wx=>911, :boundingbox=>[35, 50, 876, 642]}, "1"=>{:wx=>945, :boundingbox=>[35, 139, 909, 553]}, "2"=>{:wx=>974, :boundingbox=>[35, 104, 938, 587]}, "3"=>{:wx=>755, :boundingbox=>[34, -13, 721, 705]}, "4"=>{:wx=>846, :boundingbox=>[36, -14, 811, 705]}, "5"=>{:wx=>762, :boundingbox=>[35, 0, 727, 692]}, "6"=>{:wx=>761, :boundingbox=>[35, 0, 727, 692]}, "7"=>{:wx=>571, :boundingbox=>[-1, -68, 571, 661]}, "8"=>{:wx=>677, :boundingbox=>[36, -13, 642, 705]}, "9"=>{:wx=>763, :boundingbox=>[35, 0, 728, 692]}, ":"=>{:wx=>760, :boundingbox=>[35, 0, 726, 692]}, ";"=>{:wx=>759, :boundingbox=>[35, 0, 725, 692]}, "<"=>{:wx=>754, :boundingbox=>[35, 0, 720, 692]}, "="=>{:wx=>494, :boundingbox=>[35, 0, 460, 692]}, ">"=>{:wx=>552, :boundingbox=>[35, 0, 517, 692]}, "?"=>{:wx=>537, :boundingbox=>[35, 0, 503, 692]}, "@"=>{:wx=>577, :boundingbox=>[35, 96, 542, 596]}, "A"=>{:wx=>692, :boundingbox=>[35, -14, 657, 705]}, "B"=>{:wx=>786, :boundingbox=>[35, -14, 751, 705]}, "C"=>{:wx=>788, :boundingbox=>[35, -14, 752, 705]}, "D"=>{:wx=>788, :boundingbox=>[35, -14, 753, 705]}, "E"=>{:wx=>790, :boundingbox=>[35, -14, 756, 705]}, "F"=>{:wx=>793, :boundingbox=>[35, -13, 759, 705]}, "G"=>{:wx=>794, :boundingbox=>[35, -13, 759, 705]}, "H"=>{:wx=>816, :boundingbox=>[35, -14, 782, 705]}, "I"=>{:wx=>823, :boundingbox=>[35, -14, 787, 705]}, "J"=>{:wx=>789, :boundingbox=>[35, -14, 754, 705]}, "K"=>{:wx=>841, :boundingbox=>[35, -14, 807, 705]}, "L"=>{:wx=>823, :boundingbox=>[35, -14, 789, 705]}, "M"=>{:wx=>833, :boundingbox=>[35, -14, 798, 705]}, "N"=>{:wx=>816, :boundingbox=>[35, -13, 782, 705]}, "O"=>{:wx=>831, :boundingbox=>[35, -14, 796, 705]}, "P"=>{:wx=>923, :boundingbox=>[35, -14, 888, 705]}, "Q"=>{:wx=>744, :boundingbox=>[35, 0, 710, 692]}, "R"=>{:wx=>723, :boundingbox=>[35, 0, 688, 692]}, "S"=>{:wx=>749, :boundingbox=>[35, 0, 714, 692]}, "T"=>{:wx=>790, :boundingbox=>[34, -14, 756, 705]}, "U"=>{:wx=>792, :boundingbox=>[35, -14, 758, 705]}, "V"=>{:wx=>695, :boundingbox=>[35, -14, 661, 706]}, "W"=>{:wx=>776, :boundingbox=>[35, -6, 741, 699]}, "X"=>{:wx=>768, :boundingbox=>[35, -7, 734, 699]}, "Y"=>{:wx=>792, :boundingbox=>[35, -14, 757, 705]}, "Z"=>{:wx=>759, :boundingbox=>[35, 0, 725, 692]}, "["=>{:wx=>707, :boundingbox=>[35, -13, 672, 704]}, "\\"=>{:wx=>708, :boundingbox=>[35, -14, 672, 705]}, "]"=>{:wx=>682, :boundingbox=>[35, -14, 647, 705]}, "^"=>{:wx=>701, :boundingbox=>[35, -14, 666, 705]}, "_"=>{:wx=>826, :boundingbox=>[35, -14, 791, 705]}, "`"=>{:wx=>815, :boundingbox=>[35, -14, 780, 705]}, "a"=>{:wx=>789, :boundingbox=>[35, -14, 754, 705]}, "b"=>{:wx=>789, :boundingbox=>[35, -14, 754, 705]}, "c"=>{:wx=>707, :boundingbox=>[34, -14, 673, 705]}, "d"=>{:wx=>687, :boundingbox=>[36, 0, 651, 692]}, "e"=>{:wx=>696, :boundingbox=>[35, 0, 661, 691]}, "f"=>{:wx=>689, :boundingbox=>[35, 0, 655, 692]}, "g"=>{:wx=>786, :boundingbox=>[34, -14, 751, 705]}, "h"=>{:wx=>787, :boundingbox=>[35, -14, 752, 705]}, "i"=>{:wx=>713, :boundingbox=>[35, -14, 678, 705]}, "j"=>{:wx=>791, :boundingbox=>[35, -14, 756, 705]}, "k"=>{:wx=>785, :boundingbox=>[36, -14, 751, 705]}, "l"=>{:wx=>791, :boundingbox=>[35, -14, 757, 705]}, "m"=>{:wx=>873, :boundingbox=>[35, -14, 838, 705]}, "n"=>{:wx=>761, :boundingbox=>[35, 0, 726, 692]}, "o"=>{:wx=>762, :boundingbox=>[35, 0, 727, 692]}, "p"=>{:wx=>762, :boundingbox=>[35, 0, 727, 692]}, "q"=>{:wx=>759, :boundingbox=>[35, 0, 725, 692]}, "r"=>{:wx=>759, :boundingbox=>[35, 0, 725, 692]}, "s"=>{:wx=>892, :boundingbox=>[35, 0, 858, 705]}, "t"=>{:wx=>892, :boundingbox=>[35, -14, 858, 692]}, "u"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "v"=>{:wx=>784, :boundingbox=>[35, -14, 749, 705]}, "w"=>{:wx=>438, :boundingbox=>[35, -14, 403, 705]}, "x"=>{:wx=>138, :boundingbox=>[35, 0, 104, 692]}, "y"=>{:wx=>277, :boundingbox=>[35, 0, 242, 692]}, "z"=>{:wx=>415, :boundingbox=>[35, 0, 380, 692]}, "{"=>{:wx=>392, :boundingbox=>[35, 263, 357, 705]}, "|"=>{:wx=>392, :boundingbox=>[34, 263, 357, 705]}, "}"=>{:wx=>668, :boundingbox=>[35, 263, 633, 705]}, "~"=>{:wx=>668, :boundingbox=>[36, 263, 634, 705]}, "\u0080"=>{:wx=>390, :boundingbox=>[35, -14, 356, 705]}, "\u0081"=>{:wx=>390, :boundingbox=>[35, -14, 355, 705]}, "\u0082"=>{:wx=>317, :boundingbox=>[35, 0, 283, 692]}, "\u0083"=>{:wx=>317, :boundingbox=>[35, 0, 283, 692]}, "\u0084"=>{:wx=>276, :boundingbox=>[35, 0, 242, 692]}, "
"=>{:wx=>276, :boundingbox=>[35, 0, 242, 692]}, "\u0086"=>{:wx=>509, :boundingbox=>[35, 0, 475, 692]}, "\u0087"=>{:wx=>509, :boundingbox=>[35, 0, 475, 692]}, "\u0088"=>{:wx=>410, :boundingbox=>[35, 0, 375, 692]}, "\u0089"=>{:wx=>410, :boundingbox=>[35, 0, 375, 692]}, "\u008A"=>{:wx=>234, :boundingbox=>[35, -14, 199, 705]}, "\u008B"=>{:wx=>234, :boundingbox=>[35, -14, 199, 705]}, "\u008C"=>{:wx=>334, :boundingbox=>[35, 0, 299, 692]}, "\u008D"=>{:wx=>334, :boundingbox=>[35, 0, 299, 692]}, "¡"=>{:wx=>732, :boundingbox=>[35, -143, 697, 806]}, "¢"=>{:wx=>544, :boundingbox=>[56, -14, 488, 706]}, "£"=>{:wx=>544, :boundingbox=>[34, -14, 508, 705]}, "¤"=>{:wx=>910, :boundingbox=>[35, 40, 875, 651]}, "¥"=>{:wx=>667, :boundingbox=>[35, -14, 633, 705]}, "¦"=>{:wx=>760, :boundingbox=>[35, -14, 726, 705]}, "§"=>{:wx=>760, :boundingbox=>[0, 121, 758, 569]}, "¨"=>{:wx=>776, :boundingbox=>[35, 0, 741, 705]}, "©"=>{:wx=>595, :boundingbox=>[34, -14, 560, 705]}, "ª"=>{:wx=>694, :boundingbox=>[35, -14, 659, 705]}, "«"=>{:wx=>626, :boundingbox=>[34, 0, 591, 705]}, "¬"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, ""=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "®"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "¯"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "°"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "±"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "²"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "³"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "´"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "µ"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "¶"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "·"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "¸"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "¹"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "º"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "»"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "¼"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "½"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "¾"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "¿"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "À"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Á"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Â"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ã"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ä"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Å"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Æ"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ç"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "È"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "É"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ê"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ë"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ì"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Í"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Î"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ï"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ð"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ñ"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ò"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ó"=>{:wx=>788, :boundingbox=>[35, -14, 754, 705]}, "Ô"=>{:wx=>894, :boundingbox=>[35, 58, 860, 634]}, "Õ"=>{:wx=>838, :boundingbox=>[35, 152, 803, 540]}, "Ö"=>{:wx=>1016, :boundingbox=>[34, 152, 981, 540]}, "×"=>{:wx=>458, :boundingbox=>[35, -127, 422, 820]}, "Ø"=>{:wx=>748, :boundingbox=>[35, 94, 698, 597]}, "Ù"=>{:wx=>924, :boundingbox=>[35, 140, 890, 552]}, "Ú"=>{:wx=>748, :boundingbox=>[35, 94, 698, 597]}, "Û"=>{:wx=>918, :boundingbox=>[35, 166, 884, 526]}, "Ü"=>{:wx=>927, :boundingbox=>[35, 32, 892, 660]}, "Ý"=>{:wx=>928, :boundingbox=>[35, 129, 891, 562]}, "Þ"=>{:wx=>928, :boundingbox=>[35, 128, 893, 563]}, "ß"=>{:wx=>834, :boundingbox=>[35, 155, 799, 537]}, "à"=>{:wx=>873, :boundingbox=>[35, 93, 838, 599]}, "á"=>{:wx=>828, :boundingbox=>[35, 104, 791, 588]}, "â"=>{:wx=>924, :boundingbox=>[35, 98, 889, 594]}, "ã"=>{:wx=>924, :boundingbox=>[35, 98, 889, 594]}, "ä"=>{:wx=>917, :boundingbox=>[35, 0, 882, 692]}, "å"=>{:wx=>930, :boundingbox=>[35, 84, 896, 608]}, "æ"=>{:wx=>931, :boundingbox=>[35, 84, 896, 608]}, "ç"=>{:wx=>463, :boundingbox=>[35, -99, 429, 791]}, "è"=>{:wx=>883, :boundingbox=>[35, 71, 848, 623]}, "é"=>{:wx=>836, :boundingbox=>[35, 44, 802, 648]}, "ê"=>{:wx=>836, :boundingbox=>[35, 44, 802, 648]}, "ë"=>{:wx=>867, :boundingbox=>[35, 101, 832, 591]}, "ì"=>{:wx=>867, :boundingbox=>[35, 101, 832, 591]}, "í"=>{:wx=>696, :boundingbox=>[35, 44, 661, 648]}, "î"=>{:wx=>696, :boundingbox=>[35, 44, 661, 648]}, "ï"=>{:wx=>874, :boundingbox=>[35, 77, 840, 619]}, "ñ"=>{:wx=>874, :boundingbox=>[35, 73, 840, 615]}, "ò"=>{:wx=>760, :boundingbox=>[35, 0, 725, 692]}, "ó"=>{:wx=>946, :boundingbox=>[35, 160, 911, 533]}, "ô"=>{:wx=>771, :boundingbox=>[34, 37, 736, 655]}, "õ"=>{:wx=>865, :boundingbox=>[35, 207, 830, 481]}, "ö"=>{:wx=>771, :boundingbox=>[34, 37, 736, 655]}, "÷"=>{:wx=>888, :boundingbox=>[34, -19, 853, 712]}, "ø"=>{:wx=>967, :boundingbox=>[35, 124, 932, 568]}, "ù"=>{:wx=>888, :boundingbox=>[34, -19, 853, 712]}, "ú"=>{:wx=>831, :boundingbox=>[35, 113, 796, 579]}, "û"=>{:wx=>873, :boundingbox=>[36, 118, 838, 578]}, "ü"=>{:wx=>927, :boundingbox=>[35, 150, 891, 542]}, "ý"=>{:wx=>970, :boundingbox=>[35, 76, 931, 616]}, "þ"=>{:wx=>918, :boundingbox=>[34, 99, 884, 593]}}
|
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
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
68
|
+
#:nodoc: all
|
69
|
+
|
70
|
+
# this is an internal module used to store the fonts used by PDFWriter. You dont need to use this module.
|
71
|
+
#
|
72
|
+
# In the future, this model will help to add unicode supports and fonts support,
|
73
|
+
# so that the page numbering and textbox features could be used with international fonts and types.
|
74
|
+
#
|
75
|
+
# this model will be used in the future for the add_font method which will be defined in CombinePDF or PDFWriter.
|
76
|
+
module Fonts
|
77
|
+
module_function
|
78
|
+
|
79
|
+
# returns a list containing the registered font names
|
80
|
+
def fonts_list
|
81
|
+
initiate_library
|
82
|
+
FONTS_LIBRARY.keys
|
83
|
+
end
|
84
|
+
|
85
|
+
# gets the original font object from the fonts library (this allows you to edit the font).
|
86
|
+
def get_original_font(name = :Helvetica)
|
87
|
+
initiate_library
|
88
|
+
FONTS_LIBRARY[name]
|
89
|
+
end
|
90
|
+
|
91
|
+
# gets a copy of the font object from the fonts library (this allows you to use the font as an object is a PDF file, without altering the original registered font).
|
92
|
+
def get_font(name = :Helvetica)
|
93
|
+
initiate_library
|
94
|
+
font = FONTS_LIBRARY[name]
|
95
|
+
return nil unless font
|
96
|
+
font = font.dup
|
97
|
+
font[:referenced_object] = font[:referenced_object].dup if font[:referenced_object]
|
98
|
+
font
|
99
|
+
end
|
100
|
+
|
101
|
+
# adds a correctly formatted font object to the font library.
|
102
|
+
# font_name:: a Symbol with the name of the font. if the fonts name exists, the font will be overwritten!
|
103
|
+
# font_metrics:: a Hash of ont metrics, of the format char => {wx: char_width, boundingbox: [left_x, buttom_y, right_x, top_y]} where i == character code (i.e. 32 for space). The Hash should contain a special value :missing for the metrics of missing characters. an optional :wy will be supported in the future, for up to down fonts.
|
104
|
+
# font_pdf_object:: a Hash in the internal format recognized by CombinePDF, that represents the font object.
|
105
|
+
# font_cmap:: a CMap dictionary Hash) which maps unicode characters to the hex CID for the font (i.e. {"a" => "61", "z" => "7a" }).
|
106
|
+
def register_font(font_name, font_metrics, font_pdf_object, font_cmap = nil)
|
107
|
+
new_font = Font.new
|
108
|
+
new_font.name = font_name
|
109
|
+
new_font.metrics = font_metrics
|
110
|
+
new_font.cmap = font_cmap
|
111
|
+
new_font[:is_reference_only] = true
|
112
|
+
new_font[:referenced_object] = font_pdf_object
|
113
|
+
FONTS_LIBRARY_MUTEX.synchronize do
|
114
|
+
FONTS_LIBRARY[new_font.name] = new_font
|
115
|
+
end
|
116
|
+
new_font
|
117
|
+
end
|
118
|
+
|
119
|
+
# gets the dimentions (width and height) of the text, as it will be printed in the PDF.
|
120
|
+
#
|
121
|
+
# text:: the text to measure
|
122
|
+
# fonts:: a font name or an Array of font names. Font names should be registered fonts. The 14 standard fonts are pre regitered with the font library.
|
123
|
+
# size:: the size of the font (defaults to 1000 points).
|
124
|
+
def dimensions_of(text, fonts, size = 1000)
|
125
|
+
fonts = [fonts] unless fonts.is_a? Array
|
126
|
+
merged_metrics = {}
|
127
|
+
# merge the metrics last to first (so that important fonts override secondary fonts)
|
128
|
+
fonts.length.downto(1).each do |i|
|
129
|
+
f = get_original_font(fonts[i - 1])
|
130
|
+
if f && f.metrics
|
131
|
+
merged_metrics.update(get_original_font(fonts[i - 1]).metrics)
|
132
|
+
else
|
133
|
+
warn 'metrics of font not found!'
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
metrics_array = []
|
138
|
+
text.each_char do |c|
|
139
|
+
metrics_array << (merged_metrics[c] || { wx: 0, boundingbox: [0, 0, 0, 0] })
|
140
|
+
end
|
141
|
+
height = metrics_array.map { |m| m ? m[:boundingbox][3] : 0 } .max
|
142
|
+
height -= (metrics_array.map { |m| m ? m[:boundingbox][1] : 0 }).min
|
143
|
+
width = 0.0
|
144
|
+
metrics_array.each do |m|
|
145
|
+
width += (m[:wx] || m[:wy])
|
146
|
+
end
|
147
|
+
return [height.to_f / 1000 * size, width.to_f / 1000 * size] if metrics_array[0][:wy]
|
148
|
+
[width.to_f / 1000 * size, height.to_f / 1000 * size]
|
149
|
+
end
|
150
|
+
|
151
|
+
# this function registers the 14 standard fonts to the library.
|
152
|
+
#
|
153
|
+
# it will be called when the module first requests a font from the library.
|
154
|
+
#
|
155
|
+
# if the 14 standard fonts are already registered, it will simply return false.
|
156
|
+
def initiate_library
|
157
|
+
# do nothing if the library is already initiated
|
158
|
+
return false if FONTS_LIBRARY.key? :Helvetica
|
159
|
+
# font metrics objects to be used
|
160
|
+
times_metrics = { "\u0000" => { wx: 250, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 333, boundingbox: [130, -9, 238, 676] }, '"' => { wx: 408, boundingbox: [77, 431, 331, 676] }, '#' => { wx: 500, boundingbox: [5, 0, 496, 662] }, '$' => { wx: 500, boundingbox: [44, -87, 457, 727] }, '%' => { wx: 833, boundingbox: [61, -13, 772, 676] }, '&' => { wx: 778, boundingbox: [42, -13, 750, 676] }, "'" => { wx: 333, boundingbox: [79, 433, 218, 676] }, '(' => { wx: 333, boundingbox: [48, -177, 304, 676] }, ')' => { wx: 333, boundingbox: [29, -177, 285, 676] }, '*' => { wx: 500, boundingbox: [69, 265, 432, 676] }, '+' => { wx: 564, boundingbox: [30, 0, 534, 506] }, ',' => { wx: 250, boundingbox: [56, -141, 195, 102] }, '-' => { wx: 333, boundingbox: [39, 194, 285, 257] }, '.' => { wx: 250, boundingbox: [70, -11, 181, 100] }, '/' => { wx: 278, boundingbox: [-9, -14, 287, 676] }, '0' => { wx: 500, boundingbox: [24, -14, 476, 676] }, '1' => { wx: 500, boundingbox: [111, 0, 394, 676] }, '2' => { wx: 500, boundingbox: [30, 0, 475, 676] }, '3' => { wx: 500, boundingbox: [43, -14, 431, 676] }, '4' => { wx: 500, boundingbox: [12, 0, 472, 676] }, '5' => { wx: 500, boundingbox: [32, -14, 438, 688] }, '6' => { wx: 500, boundingbox: [34, -14, 468, 684] }, '7' => { wx: 500, boundingbox: [20, -8, 449, 662] }, '8' => { wx: 500, boundingbox: [56, -14, 445, 676] }, '9' => { wx: 500, boundingbox: [30, -22, 459, 676] }, ':' => { wx: 278, boundingbox: [81, -11, 192, 459] }, ';' => { wx: 278, boundingbox: [80, -141, 219, 459] }, '<' => { wx: 564, boundingbox: [28, -8, 536, 514] }, '=' => { wx: 564, boundingbox: [30, 120, 534, 386] }, '>' => { wx: 564, boundingbox: [28, -8, 536, 514] }, '?' => { wx: 444, boundingbox: [68, -8, 414, 676] }, '@' => { wx: 921, boundingbox: [116, -14, 809, 676] }, 'A' => { wx: 722, boundingbox: [15, 0, 706, 674] }, 'B' => { wx: 667, boundingbox: [17, 0, 593, 662] }, 'C' => { wx: 667, boundingbox: [28, -14, 633, 676] }, 'D' => { wx: 722, boundingbox: [16, 0, 685, 662] }, 'E' => { wx: 611, boundingbox: [12, 0, 597, 662] }, 'F' => { wx: 556, boundingbox: [12, 0, 546, 662] }, 'G' => { wx: 722, boundingbox: [32, -14, 709, 676] }, 'H' => { wx: 722, boundingbox: [19, 0, 702, 662] }, 'I' => { wx: 333, boundingbox: [18, 0, 315, 662] }, 'J' => { wx: 389, boundingbox: [10, -14, 370, 662] }, 'K' => { wx: 722, boundingbox: [34, 0, 723, 662] }, 'L' => { wx: 611, boundingbox: [12, 0, 598, 662] }, 'M' => { wx: 889, boundingbox: [12, 0, 863, 662] }, 'N' => { wx: 722, boundingbox: [12, -11, 707, 662] }, 'O' => { wx: 722, boundingbox: [34, -14, 688, 676] }, 'P' => { wx: 556, boundingbox: [16, 0, 542, 662] }, 'Q' => { wx: 722, boundingbox: [34, -178, 701, 676] }, 'R' => { wx: 667, boundingbox: [17, 0, 659, 662] }, 'S' => { wx: 556, boundingbox: [42, -14, 491, 676] }, 'T' => { wx: 611, boundingbox: [17, 0, 593, 662] }, 'U' => { wx: 722, boundingbox: [14, -14, 705, 662] }, 'V' => { wx: 722, boundingbox: [16, -11, 697, 662] }, 'W' => { wx: 944, boundingbox: [5, -11, 932, 662] }, 'X' => { wx: 722, boundingbox: [10, 0, 704, 662] }, 'Y' => { wx: 722, boundingbox: [22, 0, 703, 662] }, 'Z' => { wx: 611, boundingbox: [9, 0, 597, 662] }, '[' => { wx: 333, boundingbox: [88, -156, 299, 662] }, '\\' => { wx: 278, boundingbox: [-9, -14, 287, 676] }, ']' => { wx: 333, boundingbox: [34, -156, 245, 662] }, '^' => { wx: 469, boundingbox: [24, 297, 446, 662] }, '_' => { wx: 500, boundingbox: [0, -125, 500, -75] }, '`' => { wx: 333, boundingbox: [115, 433, 254, 676] }, 'a' => { wx: 444, boundingbox: [37, -10, 442, 460] }, 'b' => { wx: 500, boundingbox: [3, -10, 468, 683] }, 'c' => { wx: 444, boundingbox: [25, -10, 412, 460] }, 'd' => { wx: 500, boundingbox: [27, -10, 491, 683] }, 'e' => { wx: 444, boundingbox: [25, -10, 424, 460] }, 'f' => { wx: 333, boundingbox: [20, 0, 383, 683] }, 'g' => { wx: 500, boundingbox: [28, -218, 470, 460] }, 'h' => { wx: 500, boundingbox: [9, 0, 487, 683] }, 'i' => { wx: 278, boundingbox: [16, 0, 253, 683] }, 'j' => { wx: 278, boundingbox: [-70, -218, 194, 683] }, 'k' => { wx: 500, boundingbox: [7, 0, 505, 683] }, 'l' => { wx: 278, boundingbox: [19, 0, 257, 683] }, 'm' => { wx: 778, boundingbox: [16, 0, 775, 460] }, 'n' => { wx: 500, boundingbox: [16, 0, 485, 460] }, 'o' => { wx: 500, boundingbox: [29, -10, 470, 460] }, 'p' => { wx: 500, boundingbox: [5, -217, 470, 460] }, 'q' => { wx: 500, boundingbox: [24, -217, 488, 460] }, 'r' => { wx: 333, boundingbox: [5, 0, 335, 460] }, 's' => { wx: 389, boundingbox: [51, -10, 348, 460] }, 't' => { wx: 278, boundingbox: [13, -10, 279, 579] }, 'u' => { wx: 500, boundingbox: [9, -10, 479, 450] }, 'v' => { wx: 500, boundingbox: [19, -14, 477, 450] }, 'w' => { wx: 722, boundingbox: [21, -14, 694, 450] }, 'x' => { wx: 500, boundingbox: [17, 0, 479, 450] }, 'y' => { wx: 500, boundingbox: [14, -218, 475, 450] }, 'z' => { wx: 444, boundingbox: [27, 0, 418, 450] }, '{' => { wx: 480, boundingbox: [100, -181, 350, 680] }, '|' => { wx: 200, boundingbox: [67, -218, 133, 782] }, '}' => { wx: 480, boundingbox: [130, -181, 380, 680] }, '~' => { wx: 541, boundingbox: [40, 183, 502, 323] }, "\u00A1" => { wx: 333, boundingbox: [97, -218, 205, 467] }, "\u00A2" => { wx: 500, boundingbox: [53, -138, 448, 579] }, "\u00A3" => { wx: 500, boundingbox: [12, -8, 490, 676] }, "\u00A4" => { wx: 167, boundingbox: [-168, -14, 331, 676] }, "\u00A5" => { wx: 500, boundingbox: [-53, 0, 512, 662] }, "\u00A6" => { wx: 500, boundingbox: [7, -189, 490, 676] }, "\u00A7" => { wx: 500, boundingbox: [70, -148, 426, 676] }, "\u00A8" => { wx: 500, boundingbox: [-22, 58, 522, 602] }, "\u00A9" => { wx: 180, boundingbox: [48, 431, 133, 676] }, "\u00AA" => { wx: 444, boundingbox: [43, 433, 414, 676] }, "\u00AB" => { wx: 500, boundingbox: [42, 33, 456, 416] }, "\u00AC" => { wx: 333, boundingbox: [63, 33, 285, 416] }, "\u00AD" => { wx: 333, boundingbox: [48, 33, 270, 416] }, "\u00AE" => { wx: 556, boundingbox: [31, 0, 521, 683] }, "\u00AF" => { wx: 556, boundingbox: [32, 0, 521, 683] }, "\u00B1" => { wx: 500, boundingbox: [0, 201, 500, 250] }, "\u00B2" => { wx: 500, boundingbox: [59, -149, 442, 676] }, "\u00B3" => { wx: 500, boundingbox: [58, -153, 442, 676] }, "\u00B4" => { wx: 250, boundingbox: [70, 199, 181, 310] }, "\u00B6" => { wx: 453, boundingbox: [-22, -154, 450, 662] }, "\u00B7" => { wx: 350, boundingbox: [40, 196, 310, 466] }, "\u00B8" => { wx: 333, boundingbox: [79, -141, 218, 102] }, "\u00B9" => { wx: 444, boundingbox: [45, -141, 416, 102] }, "\u00BA" => { wx: 444, boundingbox: [30, 433, 401, 676] }, "\u00BB" => { wx: 500, boundingbox: [44, 33, 458, 416] }, "\u00BC" => { wx: 1000, boundingbox: [111, -11, 888, 100] }, "\u00BD" => { wx: 1000, boundingbox: [7, -19, 994, 706] }, "\u00BF" => { wx: 444, boundingbox: [30, -218, 376, 466] }, "\u00C1" => { wx: 333, boundingbox: [19, 507, 242, 678] }, "\u00C2" => { wx: 333, boundingbox: [93, 507, 317, 678] }, "\u00C3" => { wx: 333, boundingbox: [11, 507, 322, 674] }, "\u00C4" => { wx: 333, boundingbox: [1, 532, 331, 638] }, "\u00C5" => { wx: 333, boundingbox: [11, 547, 322, 601] }, "\u00C6" => { wx: 333, boundingbox: [26, 507, 307, 664] }, "\u00C7" => { wx: 333, boundingbox: [118, 581, 216, 681] }, "\u00C8" => { wx: 333, boundingbox: [18, 581, 315, 681] }, "\u00CA" => { wx: 333, boundingbox: [67, 512, 266, 711] }, "\u00CB" => { wx: 333, boundingbox: [52, -215, 261, 0] }, "\u00CD" => { wx: 333, boundingbox: [-3, 507, 377, 678] }, "\u00CE" => { wx: 333, boundingbox: [62, -165, 243, 0] }, "\u00CF" => { wx: 333, boundingbox: [11, 507, 322, 674] }, "\u00D0" => { wx: 1000, boundingbox: [0, 201, 1000, 250] }, "\u00E1" => { wx: 889, boundingbox: [0, 0, 863, 662] }, "\u00E3" => { wx: 276, boundingbox: [4, 394, 270, 676] }, "\u00E8" => { wx: 611, boundingbox: [12, 0, 598, 662] }, "\u00E9" => { wx: 722, boundingbox: [34, -80, 688, 734] }, "\u00EA" => { wx: 889, boundingbox: [30, -6, 885, 668] }, "\u00EB" => { wx: 310, boundingbox: [6, 394, 304, 676] }, "\u00F1" => { wx: 667, boundingbox: [38, -10, 632, 460] }, "\u00F5" => { wx: 278, boundingbox: [16, 0, 253, 460] }, "\u00F8" => { wx: 278, boundingbox: [19, 0, 259, 683] }, "\u00F9" => { wx: 500, boundingbox: [29, -112, 470, 551] }, "\u00FA" => { wx: 722, boundingbox: [30, -10, 690, 460] }, "\u00FB" => { wx: 500, boundingbox: [12, -9, 468, 683] }, "\xFF" => { wx: 500, boundingbox: [0, 0, 0, 0] } }
|
161
|
+
times_bold_metrics = { ' ' => { wx: 250, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 333, boundingbox: [81, -13, 251, 691] }, '"' => { wx: 555, boundingbox: [83, 404, 472, 691] }, '#' => { wx: 500, boundingbox: [4, 0, 496, 700] }, '$' => { wx: 500, boundingbox: [29, -99, 472, 750] }, '%' => { wx: 1000, boundingbox: [124, -14, 877, 692] }, '&' => { wx: 833, boundingbox: [62, -16, 787, 691] }, "'" => { wx: 333, boundingbox: [79, 356, 263, 691] }, '(' => { wx: 333, boundingbox: [46, -168, 306, 694] }, ')' => { wx: 333, boundingbox: [27, -168, 287, 694] }, '*' => { wx: 500, boundingbox: [56, 255, 447, 691] }, '+' => { wx: 570, boundingbox: [33, 0, 537, 506] }, ',' => { wx: 250, boundingbox: [39, -180, 223, 155] }, '-' => { wx: 333, boundingbox: [44, 171, 287, 287] }, '.' => { wx: 250, boundingbox: [41, -13, 210, 156] }, '/' => { wx: 278, boundingbox: [-24, -19, 302, 691] }, '0' => { wx: 500, boundingbox: [24, -13, 476, 688] }, '1' => { wx: 500, boundingbox: [65, 0, 442, 688] }, '2' => { wx: 500, boundingbox: [17, 0, 478, 688] }, '3' => { wx: 500, boundingbox: [16, -14, 468, 688] }, '4' => { wx: 500, boundingbox: [19, 0, 475, 688] }, '5' => { wx: 500, boundingbox: [22, -8, 470, 676] }, '6' => { wx: 500, boundingbox: [28, -13, 475, 688] }, '7' => { wx: 500, boundingbox: [17, 0, 477, 676] }, '8' => { wx: 500, boundingbox: [28, -13, 472, 688] }, '9' => { wx: 500, boundingbox: [26, -13, 473, 688] }, ':' => { wx: 333, boundingbox: [82, -13, 251, 472] }, ';' => { wx: 333, boundingbox: [82, -180, 266, 472] }, '<' => { wx: 570, boundingbox: [31, -8, 539, 514] }, '=' => { wx: 570, boundingbox: [33, 107, 537, 399] }, '>' => { wx: 570, boundingbox: [31, -8, 539, 514] }, '?' => { wx: 500, boundingbox: [57, -13, 445, 689] }, '@' => { wx: 930, boundingbox: [108, -19, 822, 691] }, 'A' => { wx: 722, boundingbox: [9, 0, 689, 690] }, 'B' => { wx: 667, boundingbox: [16, 0, 619, 676] }, 'C' => { wx: 722, boundingbox: [49, -19, 687, 691] }, 'D' => { wx: 722, boundingbox: [14, 0, 690, 676] }, 'E' => { wx: 667, boundingbox: [16, 0, 641, 676] }, 'F' => { wx: 611, boundingbox: [16, 0, 583, 676] }, 'G' => { wx: 778, boundingbox: [37, -19, 755, 691] }, 'H' => { wx: 778, boundingbox: [21, 0, 759, 676] }, 'I' => { wx: 389, boundingbox: [20, 0, 370, 676] }, 'J' => { wx: 500, boundingbox: [3, -96, 479, 676] }, 'K' => { wx: 778, boundingbox: [30, 0, 769, 676] }, 'L' => { wx: 667, boundingbox: [19, 0, 638, 676] }, 'M' => { wx: 944, boundingbox: [14, 0, 921, 676] }, 'N' => { wx: 722, boundingbox: [16, -18, 701, 676] }, 'O' => { wx: 778, boundingbox: [35, -19, 743, 691] }, 'P' => { wx: 611, boundingbox: [16, 0, 600, 676] }, 'Q' => { wx: 778, boundingbox: [35, -176, 743, 691] }, 'R' => { wx: 722, boundingbox: [26, 0, 715, 676] }, 'S' => { wx: 556, boundingbox: [35, -19, 513, 692] }, 'T' => { wx: 667, boundingbox: [31, 0, 636, 676] }, 'U' => { wx: 722, boundingbox: [16, -19, 701, 676] }, 'V' => { wx: 722, boundingbox: [16, -18, 701, 676] }, 'W' => { wx: 1000, boundingbox: [19, -15, 981, 676] }, 'X' => { wx: 722, boundingbox: [16, 0, 699, 676] }, 'Y' => { wx: 722, boundingbox: [15, 0, 699, 676] }, 'Z' => { wx: 667, boundingbox: [28, 0, 634, 676] }, '[' => { wx: 333, boundingbox: [67, -149, 301, 678] }, '\\' => { wx: 278, boundingbox: [-25, -19, 303, 691] }, ']' => { wx: 333, boundingbox: [32, -149, 266, 678] }, '^' => { wx: 581, boundingbox: [73, 311, 509, 676] }, '_' => { wx: 500, boundingbox: [0, -125, 500, -75] }, '`' => { wx: 333, boundingbox: [70, 356, 254, 691] }, 'a' => { wx: 500, boundingbox: [25, -14, 488, 473] }, 'b' => { wx: 556, boundingbox: [17, -14, 521, 676] }, 'c' => { wx: 444, boundingbox: [25, -14, 430, 473] }, 'd' => { wx: 556, boundingbox: [25, -14, 534, 676] }, 'e' => { wx: 444, boundingbox: [25, -14, 426, 473] }, 'f' => { wx: 333, boundingbox: [14, 0, 389, 691] }, 'g' => { wx: 500, boundingbox: [28, -206, 483, 473] }, 'h' => { wx: 556, boundingbox: [16, 0, 534, 676] }, 'i' => { wx: 278, boundingbox: [16, 0, 255, 691] }, 'j' => { wx: 333, boundingbox: [-57, -203, 263, 691] }, 'k' => { wx: 556, boundingbox: [22, 0, 543, 676] }, 'l' => { wx: 278, boundingbox: [16, 0, 255, 676] }, 'm' => { wx: 833, boundingbox: [16, 0, 814, 473] }, 'n' => { wx: 556, boundingbox: [21, 0, 539, 473] }, 'o' => { wx: 500, boundingbox: [25, -14, 476, 473] }, 'p' => { wx: 556, boundingbox: [19, -205, 524, 473] }, 'q' => { wx: 556, boundingbox: [34, -205, 536, 473] }, 'r' => { wx: 444, boundingbox: [29, 0, 434, 473] }, 's' => { wx: 389, boundingbox: [25, -14, 361, 473] }, 't' => { wx: 333, boundingbox: [20, -12, 332, 630] }, 'u' => { wx: 556, boundingbox: [16, -14, 537, 461] }, 'v' => { wx: 500, boundingbox: [21, -14, 485, 461] }, 'w' => { wx: 722, boundingbox: [23, -14, 707, 461] }, 'x' => { wx: 500, boundingbox: [12, 0, 484, 461] }, 'y' => { wx: 500, boundingbox: [16, -205, 480, 461] }, 'z' => { wx: 444, boundingbox: [21, 0, 420, 461] }, '{' => { wx: 394, boundingbox: [22, -175, 340, 698] }, '|' => { wx: 220, boundingbox: [66, -218, 154, 782] }, '}' => { wx: 394, boundingbox: [54, -175, 372, 698] }, '~' => { wx: 520, boundingbox: [29, 173, 491, 333] }, "\u00A1" => { wx: 333, boundingbox: [82, -203, 252, 501] }, "\u00A2" => { wx: 500, boundingbox: [53, -140, 458, 588] }, "\u00A3" => { wx: 500, boundingbox: [21, -14, 477, 684] }, "\u00A4" => { wx: 167, boundingbox: [-168, -12, 329, 688] }, "\u00A5" => { wx: 500, boundingbox: [-64, 0, 547, 676] }, "\u00A6" => { wx: 500, boundingbox: [0, -155, 498, 706] }, "\u00A7" => { wx: 500, boundingbox: [57, -132, 443, 691] }, "\u00A8" => { wx: 500, boundingbox: [-26, 61, 526, 613] }, "\u00A9" => { wx: 278, boundingbox: [75, 404, 204, 691] }, "\u00AA" => { wx: 500, boundingbox: [32, 356, 486, 691] }, "\u00AB" => { wx: 500, boundingbox: [23, 36, 473, 415] }, "\u00AC" => { wx: 333, boundingbox: [51, 36, 305, 415] }, "\u00AD" => { wx: 333, boundingbox: [28, 36, 282, 415] }, "\u00AE" => { wx: 556, boundingbox: [14, 0, 536, 691] }, "\u00AF" => { wx: 556, boundingbox: [14, 0, 536, 691] }, "\u00B1" => { wx: 500, boundingbox: [0, 181, 500, 271] }, "\u00B2" => { wx: 500, boundingbox: [47, -134, 453, 691] }, "\u00B3" => { wx: 500, boundingbox: [45, -132, 456, 691] }, "\u00B4" => { wx: 250, boundingbox: [41, 248, 210, 417] }, "\u00B6" => { wx: 540, boundingbox: [0, -186, 519, 676] }, "\u00B7" => { wx: 350, boundingbox: [35, 198, 315, 478] }, "\u00B8" => { wx: 333, boundingbox: [79, -180, 263, 155] }, "\u00B9" => { wx: 500, boundingbox: [14, -180, 468, 155] }, "\u00BA" => { wx: 500, boundingbox: [14, 356, 468, 691] }, "\u00BB" => { wx: 500, boundingbox: [27, 36, 477, 415] }, "\u00BC" => { wx: 1000, boundingbox: [82, -13, 917, 156] }, "\u00BD" => { wx: 1000, boundingbox: [7, -29, 995, 706] }, "\u00BF" => { wx: 500, boundingbox: [55, -201, 443, 501] }, "\u00C1" => { wx: 333, boundingbox: [8, 528, 246, 713] }, "\u00C2" => { wx: 333, boundingbox: [86, 528, 324, 713] }, "\u00C3" => { wx: 333, boundingbox: [-2, 528, 335, 704] }, "\u00C4" => { wx: 333, boundingbox: [-16, 547, 349, 674] }, "\u00C5" => { wx: 333, boundingbox: [1, 565, 331, 637] }, "\u00C6" => { wx: 333, boundingbox: [15, 528, 318, 691] }, "\u00C7" => { wx: 333, boundingbox: [103, 536, 258, 691] }, "\u00C8" => { wx: 333, boundingbox: [-2, 537, 335, 667] }, "\u00CA" => { wx: 333, boundingbox: [60, 527, 273, 740] }, "\u00CB" => { wx: 333, boundingbox: [68, -218, 294, 0] }, "\u00CD" => { wx: 333, boundingbox: [-13, 528, 425, 713] }, "\u00CE" => { wx: 333, boundingbox: [90, -193, 319, 24] }, "\u00CF" => { wx: 333, boundingbox: [-2, 528, 335, 704] }, "\u00D0" => { wx: 1000, boundingbox: [0, 181, 1000, 271] }, "\u00E1" => { wx: 1000, boundingbox: [4, 0, 951, 676] }, "\u00E3" => { wx: 300, boundingbox: [-1, 397, 301, 688] }, "\u00E8" => { wx: 667, boundingbox: [19, 0, 638, 676] }, "\u00E9" => { wx: 778, boundingbox: [35, -74, 743, 737] }, "\u00EA" => { wx: 1000, boundingbox: [22, -5, 981, 684] }, "\u00EB" => { wx: 330, boundingbox: [18, 397, 312, 688] }, "\u00F1" => { wx: 722, boundingbox: [33, -14, 693, 473] }, "\u00F5" => { wx: 278, boundingbox: [16, 0, 255, 461] }, "\u00F8" => { wx: 278, boundingbox: [-22, 0, 303, 676] }, "\u00F9" => { wx: 500, boundingbox: [25, -92, 476, 549] }, "\u00FA" => { wx: 722, boundingbox: [22, -14, 696, 473] }, "\u00FB" => { wx: 556, boundingbox: [19, -12, 517, 691] }, "\xFF" => { wx: 500, boundingbox: [0, 0, 0, 0] } }
|
162
|
+
times_italic_metrics = { ' ' => { wx: 250, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 333, boundingbox: [39, -11, 302, 667] }, '"' => { wx: 420, boundingbox: [144, 421, 432, 666] }, '#' => { wx: 500, boundingbox: [2, 0, 540, 676] }, '$' => { wx: 500, boundingbox: [31, -89, 497, 731] }, '%' => { wx: 833, boundingbox: [79, -13, 790, 676] }, '&' => { wx: 778, boundingbox: [76, -18, 723, 666] }, "'" => { wx: 333, boundingbox: [151, 436, 290, 666] }, '(' => { wx: 333, boundingbox: [42, -181, 315, 669] }, ')' => { wx: 333, boundingbox: [16, -180, 289, 669] }, '*' => { wx: 500, boundingbox: [128, 255, 492, 666] }, '+' => { wx: 675, boundingbox: [86, 0, 590, 506] }, ',' => { wx: 250, boundingbox: [-4, -129, 135, 101] }, '-' => { wx: 333, boundingbox: [49, 192, 282, 255] }, '.' => { wx: 250, boundingbox: [27, -11, 138, 100] }, '/' => { wx: 278, boundingbox: [-65, -18, 386, 666] }, '0' => { wx: 500, boundingbox: [32, -7, 497, 676] }, '1' => { wx: 500, boundingbox: [49, 0, 409, 676] }, '2' => { wx: 500, boundingbox: [12, 0, 452, 676] }, '3' => { wx: 500, boundingbox: [15, -7, 465, 676] }, '4' => { wx: 500, boundingbox: [1, 0, 479, 676] }, '5' => { wx: 500, boundingbox: [15, -7, 491, 666] }, '6' => { wx: 500, boundingbox: [30, -7, 521, 686] }, '7' => { wx: 500, boundingbox: [75, -8, 537, 666] }, '8' => { wx: 500, boundingbox: [30, -7, 493, 676] }, '9' => { wx: 500, boundingbox: [23, -17, 492, 676] }, ':' => { wx: 333, boundingbox: [50, -11, 261, 441] }, ';' => { wx: 333, boundingbox: [27, -129, 261, 441] }, '<' => { wx: 675, boundingbox: [84, -8, 592, 514] }, '=' => { wx: 675, boundingbox: [86, 120, 590, 386] }, '>' => { wx: 675, boundingbox: [84, -8, 592, 514] }, '?' => { wx: 500, boundingbox: [132, -12, 472, 664] }, '@' => { wx: 920, boundingbox: [118, -18, 806, 666] }, 'A' => { wx: 611, boundingbox: [-51, 0, 564, 668] }, 'B' => { wx: 611, boundingbox: [-8, 0, 588, 653] }, 'C' => { wx: 667, boundingbox: [66, -18, 689, 666] }, 'D' => { wx: 722, boundingbox: [-8, 0, 700, 653] }, 'E' => { wx: 611, boundingbox: [-1, 0, 634, 653] }, 'F' => { wx: 611, boundingbox: [8, 0, 645, 653] }, 'G' => { wx: 722, boundingbox: [52, -18, 722, 666] }, 'H' => { wx: 722, boundingbox: [-8, 0, 767, 653] }, 'I' => { wx: 333, boundingbox: [-8, 0, 384, 653] }, 'J' => { wx: 444, boundingbox: [-6, -18, 491, 653] }, 'K' => { wx: 667, boundingbox: [7, 0, 722, 653] }, 'L' => { wx: 556, boundingbox: [-8, 0, 559, 653] }, 'M' => { wx: 833, boundingbox: [-18, 0, 873, 653] }, 'N' => { wx: 667, boundingbox: [-20, -15, 727, 653] }, 'O' => { wx: 722, boundingbox: [60, -18, 699, 666] }, 'P' => { wx: 611, boundingbox: [0, 0, 605, 653] }, 'Q' => { wx: 722, boundingbox: [59, -182, 699, 666] }, 'R' => { wx: 611, boundingbox: [-13, 0, 588, 653] }, 'S' => { wx: 500, boundingbox: [17, -18, 508, 667] }, 'T' => { wx: 556, boundingbox: [59, 0, 633, 653] }, 'U' => { wx: 722, boundingbox: [102, -18, 765, 653] }, 'V' => { wx: 611, boundingbox: [76, -18, 688, 653] }, 'W' => { wx: 833, boundingbox: [71, -18, 906, 653] }, 'X' => { wx: 611, boundingbox: [-29, 0, 655, 653] }, 'Y' => { wx: 556, boundingbox: [78, 0, 633, 653] }, 'Z' => { wx: 556, boundingbox: [-6, 0, 606, 653] }, '[' => { wx: 389, boundingbox: [21, -153, 391, 663] }, '\\' => { wx: 278, boundingbox: [-41, -18, 319, 666] }, ']' => { wx: 389, boundingbox: [12, -153, 382, 663] }, '^' => { wx: 422, boundingbox: [0, 301, 422, 666] }, '_' => { wx: 500, boundingbox: [0, -125, 500, -75] }, '`' => { wx: 333, boundingbox: [171, 436, 310, 666] }, 'a' => { wx: 500, boundingbox: [17, -11, 476, 441] }, 'b' => { wx: 500, boundingbox: [23, -11, 473, 683] }, 'c' => { wx: 444, boundingbox: [30, -11, 425, 441] }, 'd' => { wx: 500, boundingbox: [15, -13, 527, 683] }, 'e' => { wx: 444, boundingbox: [31, -11, 412, 441] }, 'f' => { wx: 278, boundingbox: [-147, -207, 424, 678] }, 'g' => { wx: 500, boundingbox: [8, -206, 472, 441] }, 'h' => { wx: 500, boundingbox: [19, -9, 478, 683] }, 'i' => { wx: 278, boundingbox: [49, -11, 264, 654] }, 'j' => { wx: 278, boundingbox: [-124, -207, 276, 654] }, 'k' => { wx: 444, boundingbox: [14, -11, 461, 683] }, 'l' => { wx: 278, boundingbox: [41, -11, 279, 683] }, 'm' => { wx: 722, boundingbox: [12, -9, 704, 441] }, 'n' => { wx: 500, boundingbox: [14, -9, 474, 441] }, 'o' => { wx: 500, boundingbox: [27, -11, 468, 441] }, 'p' => { wx: 500, boundingbox: [-75, -205, 469, 441] }, 'q' => { wx: 500, boundingbox: [25, -209, 483, 441] }, 'r' => { wx: 389, boundingbox: [45, 0, 412, 441] }, 's' => { wx: 389, boundingbox: [16, -13, 366, 442] }, 't' => { wx: 278, boundingbox: [37, -11, 296, 546] }, 'u' => { wx: 500, boundingbox: [42, -11, 475, 441] }, 'v' => { wx: 444, boundingbox: [21, -18, 426, 441] }, 'w' => { wx: 667, boundingbox: [16, -18, 648, 441] }, 'x' => { wx: 444, boundingbox: [-27, -11, 447, 441] }, 'y' => { wx: 444, boundingbox: [-24, -206, 426, 441] }, 'z' => { wx: 389, boundingbox: [-2, -81, 380, 428] }, '{' => { wx: 400, boundingbox: [51, -177, 407, 687] }, '|' => { wx: 275, boundingbox: [105, -217, 171, 783] }, '}' => { wx: 400, boundingbox: [-7, -177, 349, 687] }, '~' => { wx: 541, boundingbox: [40, 183, 502, 323] }, "\u00A1" => { wx: 389, boundingbox: [59, -205, 322, 473] }, "\u00A2" => { wx: 500, boundingbox: [77, -143, 472, 560] }, "\u00A3" => { wx: 500, boundingbox: [10, -6, 517, 670] }, "\u00A4" => { wx: 167, boundingbox: [-169, -10, 337, 676] }, "\u00A5" => { wx: 500, boundingbox: [27, 0, 603, 653] }, "\u00A6" => { wx: 500, boundingbox: [25, -182, 507, 682] }, "\u00A7" => { wx: 500, boundingbox: [53, -162, 461, 666] }, "\u00A8" => { wx: 500, boundingbox: [-22, 53, 522, 597] }, "\u00A9" => { wx: 214, boundingbox: [132, 421, 241, 666] }, "\u00AA" => { wx: 556, boundingbox: [166, 436, 514, 666] }, "\u00AB" => { wx: 500, boundingbox: [53, 37, 445, 403] }, "\u00AC" => { wx: 333, boundingbox: [51, 37, 281, 403] }, "\u00AD" => { wx: 333, boundingbox: [52, 37, 282, 403] }, "\u00AE" => { wx: 500, boundingbox: [-141, -207, 481, 681] }, "\u00AF" => { wx: 500, boundingbox: [-141, -204, 518, 682] }, "\u00B1" => { wx: 500, boundingbox: [-6, 197, 505, 243] }, "\u00B2" => { wx: 500, boundingbox: [101, -159, 488, 666] }, "\u00B3" => { wx: 500, boundingbox: [22, -143, 491, 666] }, "\u00B4" => { wx: 250, boundingbox: [70, 199, 181, 310] }, "\u00B6" => { wx: 523, boundingbox: [55, -123, 616, 653] }, "\u00B7" => { wx: 350, boundingbox: [40, 191, 310, 461] }, "\u00B8" => { wx: 333, boundingbox: [44, -129, 183, 101] }, "\u00B9" => { wx: 556, boundingbox: [57, -129, 405, 101] }, "\u00BA" => { wx: 556, boundingbox: [151, 436, 499, 666] }, "\u00BB" => { wx: 500, boundingbox: [55, 37, 447, 403] }, "\u00BC" => { wx: 889, boundingbox: [57, -11, 762, 100] }, "\u00BD" => { wx: 1000, boundingbox: [25, -19, 1010, 706] }, "\u00BF" => { wx: 500, boundingbox: [28, -205, 368, 471] }, "\u00C1" => { wx: 333, boundingbox: [121, 492, 311, 664] }, "\u00C2" => { wx: 333, boundingbox: [180, 494, 403, 664] }, "\u00C3" => { wx: 333, boundingbox: [91, 492, 385, 661] }, "\u00C4" => { wx: 333, boundingbox: [100, 517, 427, 624] }, "\u00C5" => { wx: 333, boundingbox: [99, 532, 411, 583] }, "\u00C6" => { wx: 333, boundingbox: [117, 492, 418, 650] }, "\u00C7" => { wx: 333, boundingbox: [207, 548, 305, 646] }, "\u00C8" => { wx: 333, boundingbox: [107, 548, 405, 646] }, "\u00CA" => { wx: 333, boundingbox: [155, 492, 355, 691] }, "\u00CB" => { wx: 333, boundingbox: [-30, -217, 182, 0] }, "\u00CD" => { wx: 333, boundingbox: [93, 494, 486, 664] }, "\u00CE" => { wx: 333, boundingbox: [20, -169, 203, 40] }, "\u00CF" => { wx: 333, boundingbox: [121, 492, 426, 661] }, "\u00D0" => { wx: 889, boundingbox: [-6, 197, 894, 243] }, "\u00E1" => { wx: 889, boundingbox: [-27, 0, 911, 653] }, "\u00E3" => { wx: 276, boundingbox: [42, 406, 352, 676] }, "\u00E8" => { wx: 556, boundingbox: [-8, 0, 559, 653] }, "\u00E9" => { wx: 722, boundingbox: [60, -105, 699, 722] }, "\u00EA" => { wx: 944, boundingbox: [49, -8, 964, 666] }, "\u00EB" => { wx: 310, boundingbox: [67, 406, 362, 676] }, "\u00F1" => { wx: 667, boundingbox: [23, -11, 640, 441] }, "\u00F5" => { wx: 278, boundingbox: [49, -11, 235, 441] }, "\u00F8" => { wx: 278, boundingbox: [41, -11, 312, 683] }, "\u00F9" => { wx: 500, boundingbox: [28, -135, 469, 554] }, "\u00FA" => { wx: 667, boundingbox: [20, -12, 646, 441] }, "\u00FB" => { wx: 500, boundingbox: [-168, -207, 493, 679] }, "\xFF" => { wx: 500, boundingbox: [0, 0, 0, 0] } }
|
163
|
+
times_bolditalic_metrics = { ' ' => { wx: 250, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 389, boundingbox: [67, -13, 370, 684] }, '"' => { wx: 555, boundingbox: [136, 398, 536, 685] }, '#' => { wx: 500, boundingbox: [-33, 0, 533, 700] }, '$' => { wx: 500, boundingbox: [-20, -100, 497, 733] }, '%' => { wx: 833, boundingbox: [39, -10, 793, 692] }, '&' => { wx: 778, boundingbox: [5, -19, 699, 682] }, "'" => { wx: 333, boundingbox: [98, 369, 302, 685] }, '(' => { wx: 333, boundingbox: [28, -179, 344, 685] }, ')' => { wx: 333, boundingbox: [-44, -179, 271, 685] }, '*' => { wx: 500, boundingbox: [65, 249, 456, 685] }, '+' => { wx: 570, boundingbox: [33, 0, 537, 506] }, ',' => { wx: 250, boundingbox: [-60, -182, 144, 134] }, '-' => { wx: 333, boundingbox: [2, 166, 271, 282] }, '.' => { wx: 250, boundingbox: [-9, -13, 139, 135] }, '/' => { wx: 278, boundingbox: [-64, -18, 342, 685] }, '0' => { wx: 500, boundingbox: [17, -14, 477, 683] }, '1' => { wx: 500, boundingbox: [5, 0, 419, 683] }, '2' => { wx: 500, boundingbox: [-27, 0, 446, 683] }, '3' => { wx: 500, boundingbox: [-15, -13, 450, 683] }, '4' => { wx: 500, boundingbox: [-15, 0, 503, 683] }, '5' => { wx: 500, boundingbox: [-11, -13, 487, 669] }, '6' => { wx: 500, boundingbox: [23, -15, 509, 679] }, '7' => { wx: 500, boundingbox: [52, 0, 525, 669] }, '8' => { wx: 500, boundingbox: [3, -13, 476, 683] }, '9' => { wx: 500, boundingbox: [-12, -10, 475, 683] }, ':' => { wx: 333, boundingbox: [23, -13, 264, 459] }, ';' => { wx: 333, boundingbox: [-25, -183, 264, 459] }, '<' => { wx: 570, boundingbox: [31, -8, 539, 514] }, '=' => { wx: 570, boundingbox: [33, 107, 537, 399] }, '>' => { wx: 570, boundingbox: [31, -8, 539, 514] }, '?' => { wx: 500, boundingbox: [79, -13, 470, 684] }, '@' => { wx: 832, boundingbox: [63, -18, 770, 685] }, 'A' => { wx: 667, boundingbox: [-67, 0, 593, 683] }, 'B' => { wx: 667, boundingbox: [-24, 0, 624, 669] }, 'C' => { wx: 667, boundingbox: [32, -18, 677, 685] }, 'D' => { wx: 722, boundingbox: [-46, 0, 685, 669] }, 'E' => { wx: 667, boundingbox: [-27, 0, 653, 669] }, 'F' => { wx: 667, boundingbox: [-13, 0, 660, 669] }, 'G' => { wx: 722, boundingbox: [21, -18, 706, 685] }, 'H' => { wx: 778, boundingbox: [-24, 0, 799, 669] }, 'I' => { wx: 389, boundingbox: [-32, 0, 406, 669] }, 'J' => { wx: 500, boundingbox: [-46, -99, 524, 669] }, 'K' => { wx: 667, boundingbox: [-21, 0, 702, 669] }, 'L' => { wx: 611, boundingbox: [-22, 0, 590, 669] }, 'M' => { wx: 889, boundingbox: [-29, -12, 917, 669] }, 'N' => { wx: 722, boundingbox: [-27, -15, 748, 669] }, 'O' => { wx: 722, boundingbox: [27, -18, 691, 685] }, 'P' => { wx: 611, boundingbox: [-27, 0, 613, 669] }, 'Q' => { wx: 722, boundingbox: [27, -208, 691, 685] }, 'R' => { wx: 667, boundingbox: [-29, 0, 623, 669] }, 'S' => { wx: 556, boundingbox: [2, -18, 526, 685] }, 'T' => { wx: 611, boundingbox: [50, 0, 650, 669] }, 'U' => { wx: 722, boundingbox: [67, -18, 744, 669] }, 'V' => { wx: 667, boundingbox: [65, -18, 715, 669] }, 'W' => { wx: 889, boundingbox: [65, -18, 940, 669] }, 'X' => { wx: 667, boundingbox: [-24, 0, 694, 669] }, 'Y' => { wx: 611, boundingbox: [73, 0, 659, 669] }, 'Z' => { wx: 611, boundingbox: [-11, 0, 590, 669] }, '[' => { wx: 333, boundingbox: [-37, -159, 362, 674] }, '\\' => { wx: 278, boundingbox: [-1, -18, 279, 685] }, ']' => { wx: 333, boundingbox: [-56, -157, 343, 674] }, '^' => { wx: 570, boundingbox: [67, 304, 503, 669] }, '_' => { wx: 500, boundingbox: [0, -125, 500, -75] }, '`' => { wx: 333, boundingbox: [128, 369, 332, 685] }, 'a' => { wx: 500, boundingbox: [-21, -14, 455, 462] }, 'b' => { wx: 500, boundingbox: [-14, -13, 444, 699] }, 'c' => { wx: 444, boundingbox: [-5, -13, 392, 462] }, 'd' => { wx: 500, boundingbox: [-21, -13, 517, 699] }, 'e' => { wx: 444, boundingbox: [5, -13, 398, 462] }, 'f' => { wx: 333, boundingbox: [-169, -205, 446, 698] }, 'g' => { wx: 500, boundingbox: [-52, -203, 478, 462] }, 'h' => { wx: 556, boundingbox: [-13, -9, 498, 699] }, 'i' => { wx: 278, boundingbox: [2, -9, 263, 684] }, 'j' => { wx: 278, boundingbox: [-189, -207, 279, 684] }, 'k' => { wx: 500, boundingbox: [-23, -8, 483, 699] }, 'l' => { wx: 278, boundingbox: [2, -9, 290, 699] }, 'm' => { wx: 778, boundingbox: [-14, -9, 722, 462] }, 'n' => { wx: 556, boundingbox: [-6, -9, 493, 462] }, 'o' => { wx: 500, boundingbox: [-3, -13, 441, 462] }, 'p' => { wx: 500, boundingbox: [-120, -205, 446, 462] }, 'q' => { wx: 500, boundingbox: [1, -205, 471, 462] }, 'r' => { wx: 389, boundingbox: [-21, 0, 389, 462] }, 's' => { wx: 389, boundingbox: [-19, -13, 333, 462] }, 't' => { wx: 278, boundingbox: [-11, -9, 281, 594] }, 'u' => { wx: 556, boundingbox: [15, -9, 492, 462] }, 'v' => { wx: 444, boundingbox: [16, -13, 401, 462] }, 'w' => { wx: 667, boundingbox: [16, -13, 614, 462] }, 'x' => { wx: 500, boundingbox: [-46, -13, 469, 462] }, 'y' => { wx: 444, boundingbox: [-94, -205, 392, 462] }, 'z' => { wx: 389, boundingbox: [-43, -78, 368, 449] }, '{' => { wx: 348, boundingbox: [5, -187, 436, 686] }, '|' => { wx: 220, boundingbox: [66, -218, 154, 782] }, '}' => { wx: 348, boundingbox: [-129, -187, 302, 686] }, '~' => { wx: 570, boundingbox: [54, 173, 516, 333] }, "\u00A1" => { wx: 389, boundingbox: [19, -205, 322, 492] }, "\u00A2" => { wx: 500, boundingbox: [42, -143, 439, 576] }, "\u00A3" => { wx: 500, boundingbox: [-32, -12, 510, 683] }, "\u00A4" => { wx: 167, boundingbox: [-169, -14, 324, 683] }, "\u00A5" => { wx: 500, boundingbox: [33, 0, 628, 669] }, "\u00A6" => { wx: 500, boundingbox: [-87, -156, 537, 707] }, "\u00A7" => { wx: 500, boundingbox: [36, -143, 459, 685] }, "\u00A8" => { wx: 500, boundingbox: [-26, 34, 526, 586] }, "\u00A9" => { wx: 278, boundingbox: [128, 398, 268, 685] }, "\u00AA" => { wx: 500, boundingbox: [53, 369, 513, 685] }, "\u00AB" => { wx: 500, boundingbox: [12, 32, 468, 415] }, "\u00AC" => { wx: 333, boundingbox: [32, 32, 303, 415] }, "\u00AD" => { wx: 333, boundingbox: [10, 32, 281, 415] }, "\u00AE" => { wx: 556, boundingbox: [-188, -205, 514, 703] }, "\u00AF" => { wx: 556, boundingbox: [-186, -205, 553, 704] }, "\u00B1" => { wx: 500, boundingbox: [-40, 178, 477, 269] }, "\u00B2" => { wx: 500, boundingbox: [91, -145, 494, 685] }, "\u00B3" => { wx: 500, boundingbox: [10, -139, 493, 685] }, "\u00B4" => { wx: 250, boundingbox: [51, 257, 199, 405] }, "\u00B6" => { wx: 500, boundingbox: [-57, -193, 562, 669] }, "\u00B7" => { wx: 350, boundingbox: [0, 175, 350, 525] }, "\u00B8" => { wx: 333, boundingbox: [-5, -182, 199, 134] }, "\u00B9" => { wx: 500, boundingbox: [-57, -182, 403, 134] }, "\u00BA" => { wx: 500, boundingbox: [53, 369, 513, 685] }, "\u00BB" => { wx: 500, boundingbox: [12, 32, 468, 415] }, "\u00BC" => { wx: 1000, boundingbox: [40, -13, 852, 135] }, "\u00BD" => { wx: 1000, boundingbox: [7, -29, 996, 706] }, "\u00BF" => { wx: 500, boundingbox: [30, -205, 421, 492] }, "\u00C1" => { wx: 333, boundingbox: [85, 516, 297, 697] }, "\u00C2" => { wx: 333, boundingbox: [139, 516, 379, 697] }, "\u00C3" => { wx: 333, boundingbox: [40, 516, 367, 690] }, "\u00C4" => { wx: 333, boundingbox: [48, 536, 407, 655] }, "\u00C5" => { wx: 333, boundingbox: [51, 553, 393, 623] }, "\u00C6" => { wx: 333, boundingbox: [71, 516, 387, 678] }, "\u00C7" => { wx: 333, boundingbox: [163, 550, 298, 684] }, "\u00C8" => { wx: 333, boundingbox: [55, 550, 402, 684] }, "\u00CA" => { wx: 333, boundingbox: [127, 516, 340, 729] }, "\u00CB" => { wx: 333, boundingbox: [-80, -218, 156, 5] }, "\u00CD" => { wx: 333, boundingbox: [69, 516, 498, 697] }, "\u00CE" => { wx: 333, boundingbox: [15, -183, 244, 34] }, "\u00CF" => { wx: 333, boundingbox: [79, 516, 411, 690] }, "\u00D0" => { wx: 1000, boundingbox: [-40, 178, 977, 269] }, "\u00E1" => { wx: 944, boundingbox: [-64, 0, 918, 669] }, "\u00E3" => { wx: 266, boundingbox: [16, 399, 330, 685] }, "\u00E8" => { wx: 611, boundingbox: [-22, 0, 590, 669] }, "\u00E9" => { wx: 722, boundingbox: [27, -125, 691, 764] }, "\u00EA" => { wx: 944, boundingbox: [23, -8, 946, 677] }, "\u00EB" => { wx: 300, boundingbox: [56, 400, 347, 685] }, "\u00F1" => { wx: 722, boundingbox: [-5, -13, 673, 462] }, "\u00F5" => { wx: 278, boundingbox: [2, -9, 238, 462] }, "\u00F8" => { wx: 278, boundingbox: [-7, -9, 307, 699] }, "\u00F9" => { wx: 500, boundingbox: [-3, -119, 441, 560] }, "\u00FA" => { wx: 722, boundingbox: [6, -13, 674, 462] }, "\u00FB" => { wx: 500, boundingbox: [-200, -200, 473, 705] }, "\xFF" => { wx: 500, boundingbox: [0, 0, 0, 0] } }
|
164
|
+
helvetica_metrics = { ' ' => { wx: 278, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 278, boundingbox: [90, 0, 187, 718] }, '"' => { wx: 355, boundingbox: [70, 463, 285, 718] }, '#' => { wx: 556, boundingbox: [28, 0, 529, 688] }, '$' => { wx: 556, boundingbox: [32, -115, 520, 775] }, '%' => { wx: 889, boundingbox: [39, -19, 850, 703] }, '&' => { wx: 667, boundingbox: [44, -15, 645, 718] }, "'" => { wx: 222, boundingbox: [53, 463, 157, 718] }, '(' => { wx: 333, boundingbox: [68, -207, 299, 733] }, ')' => { wx: 333, boundingbox: [34, -207, 265, 733] }, '*' => { wx: 389, boundingbox: [39, 431, 349, 718] }, '+' => { wx: 584, boundingbox: [39, 0, 545, 505] }, ',' => { wx: 278, boundingbox: [87, -147, 191, 106] }, '-' => { wx: 333, boundingbox: [44, 232, 289, 322] }, '.' => { wx: 278, boundingbox: [87, 0, 191, 106] }, '/' => { wx: 278, boundingbox: [-17, -19, 295, 737] }, '0' => { wx: 556, boundingbox: [37, -19, 519, 703] }, '1' => { wx: 556, boundingbox: [101, 0, 359, 703] }, '2' => { wx: 556, boundingbox: [26, 0, 507, 703] }, '3' => { wx: 556, boundingbox: [34, -19, 522, 703] }, '4' => { wx: 556, boundingbox: [25, 0, 523, 703] }, '5' => { wx: 556, boundingbox: [32, -19, 514, 688] }, '6' => { wx: 556, boundingbox: [38, -19, 518, 703] }, '7' => { wx: 556, boundingbox: [37, 0, 523, 688] }, '8' => { wx: 556, boundingbox: [38, -19, 517, 703] }, '9' => { wx: 556, boundingbox: [42, -19, 514, 703] }, ':' => { wx: 278, boundingbox: [87, 0, 191, 516] }, ';' => { wx: 278, boundingbox: [87, -147, 191, 516] }, '<' => { wx: 584, boundingbox: [48, 11, 536, 495] }, '=' => { wx: 584, boundingbox: [39, 115, 545, 390] }, '>' => { wx: 584, boundingbox: [48, 11, 536, 495] }, '?' => { wx: 556, boundingbox: [56, 0, 492, 727] }, '@' => { wx: 1015, boundingbox: [147, -19, 868, 737] }, 'A' => { wx: 667, boundingbox: [14, 0, 654, 718] }, 'B' => { wx: 667, boundingbox: [74, 0, 627, 718] }, 'C' => { wx: 722, boundingbox: [44, -19, 681, 737] }, 'D' => { wx: 722, boundingbox: [81, 0, 674, 718] }, 'E' => { wx: 667, boundingbox: [86, 0, 616, 718] }, 'F' => { wx: 611, boundingbox: [86, 0, 583, 718] }, 'G' => { wx: 778, boundingbox: [48, -19, 704, 737] }, 'H' => { wx: 722, boundingbox: [77, 0, 646, 718] }, 'I' => { wx: 278, boundingbox: [91, 0, 188, 718] }, 'J' => { wx: 500, boundingbox: [17, -19, 428, 718] }, 'K' => { wx: 667, boundingbox: [76, 0, 663, 718] }, 'L' => { wx: 556, boundingbox: [76, 0, 537, 718] }, 'M' => { wx: 833, boundingbox: [73, 0, 761, 718] }, 'N' => { wx: 722, boundingbox: [76, 0, 646, 718] }, 'O' => { wx: 778, boundingbox: [39, -19, 739, 737] }, 'P' => { wx: 667, boundingbox: [86, 0, 622, 718] }, 'Q' => { wx: 778, boundingbox: [39, -56, 739, 737] }, 'R' => { wx: 722, boundingbox: [88, 0, 684, 718] }, 'S' => { wx: 667, boundingbox: [49, -19, 620, 737] }, 'T' => { wx: 611, boundingbox: [14, 0, 597, 718] }, 'U' => { wx: 722, boundingbox: [79, -19, 644, 718] }, 'V' => { wx: 667, boundingbox: [20, 0, 647, 718] }, 'W' => { wx: 944, boundingbox: [16, 0, 928, 718] }, 'X' => { wx: 667, boundingbox: [19, 0, 648, 718] }, 'Y' => { wx: 667, boundingbox: [14, 0, 653, 718] }, 'Z' => { wx: 611, boundingbox: [23, 0, 588, 718] }, '[' => { wx: 278, boundingbox: [63, -196, 250, 722] }, '\\' => { wx: 278, boundingbox: [-17, -19, 295, 737] }, ']' => { wx: 278, boundingbox: [28, -196, 215, 722] }, '^' => { wx: 469, boundingbox: [-14, 264, 483, 688] }, '_' => { wx: 556, boundingbox: [0, -125, 556, -75] }, '`' => { wx: 222, boundingbox: [65, 470, 169, 725] }, 'a' => { wx: 556, boundingbox: [36, -15, 530, 538] }, 'b' => { wx: 556, boundingbox: [58, -15, 517, 718] }, 'c' => { wx: 500, boundingbox: [30, -15, 477, 538] }, 'd' => { wx: 556, boundingbox: [35, -15, 499, 718] }, 'e' => { wx: 556, boundingbox: [40, -15, 516, 538] }, 'f' => { wx: 278, boundingbox: [14, 0, 262, 728] }, 'g' => { wx: 556, boundingbox: [40, -220, 499, 538] }, 'h' => { wx: 556, boundingbox: [65, 0, 491, 718] }, 'i' => { wx: 222, boundingbox: [67, 0, 155, 718] }, 'j' => { wx: 222, boundingbox: [-16, -210, 155, 718] }, 'k' => { wx: 500, boundingbox: [67, 0, 501, 718] }, 'l' => { wx: 222, boundingbox: [67, 0, 155, 718] }, 'm' => { wx: 833, boundingbox: [65, 0, 769, 538] }, 'n' => { wx: 556, boundingbox: [65, 0, 491, 538] }, 'o' => { wx: 556, boundingbox: [35, -14, 521, 538] }, 'p' => { wx: 556, boundingbox: [58, -207, 517, 538] }, 'q' => { wx: 556, boundingbox: [35, -207, 494, 538] }, 'r' => { wx: 333, boundingbox: [77, 0, 332, 538] }, 's' => { wx: 500, boundingbox: [32, -15, 464, 538] }, 't' => { wx: 278, boundingbox: [14, -7, 257, 669] }, 'u' => { wx: 556, boundingbox: [68, -15, 489, 523] }, 'v' => { wx: 500, boundingbox: [8, 0, 492, 523] }, 'w' => { wx: 722, boundingbox: [14, 0, 709, 523] }, 'x' => { wx: 500, boundingbox: [11, 0, 490, 523] }, 'y' => { wx: 500, boundingbox: [11, -214, 489, 523] }, 'z' => { wx: 500, boundingbox: [31, 0, 469, 523] }, '{' => { wx: 334, boundingbox: [42, -196, 292, 722] }, '|' => { wx: 260, boundingbox: [94, -225, 167, 775] }, '}' => { wx: 334, boundingbox: [42, -196, 292, 722] }, '~' => { wx: 584, boundingbox: [61, 180, 523, 326] }, "\u00A1" => { wx: 333, boundingbox: [118, -195, 215, 523] }, "\u00A2" => { wx: 556, boundingbox: [51, -115, 513, 623] }, "\u00A3" => { wx: 556, boundingbox: [33, -16, 539, 718] }, "\u00A4" => { wx: 167, boundingbox: [-166, -19, 333, 703] }, "\u00A5" => { wx: 556, boundingbox: [3, 0, 553, 688] }, "\u00A6" => { wx: 556, boundingbox: [-11, -207, 501, 737] }, "\u00A7" => { wx: 556, boundingbox: [43, -191, 512, 737] }, "\u00A8" => { wx: 556, boundingbox: [28, 99, 528, 603] }, "\u00A9" => { wx: 191, boundingbox: [59, 463, 132, 718] }, "\u00AA" => { wx: 333, boundingbox: [38, 470, 307, 725] }, "\u00AB" => { wx: 556, boundingbox: [97, 108, 459, 446] }, "\u00AC" => { wx: 333, boundingbox: [88, 108, 245, 446] }, "\u00AD" => { wx: 333, boundingbox: [88, 108, 245, 446] }, "\u00AE" => { wx: 500, boundingbox: [14, 0, 434, 728] }, "\u00AF" => { wx: 500, boundingbox: [14, 0, 432, 728] }, "\u00B1" => { wx: 556, boundingbox: [0, 240, 556, 313] }, "\u00B2" => { wx: 556, boundingbox: [43, -159, 514, 718] }, "\u00B3" => { wx: 556, boundingbox: [43, -159, 514, 718] }, "\u00B4" => { wx: 278, boundingbox: [77, 190, 202, 315] }, "\u00B6" => { wx: 537, boundingbox: [18, -173, 497, 718] }, "\u00B7" => { wx: 350, boundingbox: [18, 202, 333, 517] }, "\u00B8" => { wx: 222, boundingbox: [53, -149, 157, 106] }, "\u00B9" => { wx: 333, boundingbox: [26, -149, 295, 106] }, "\u00BA" => { wx: 333, boundingbox: [26, 463, 295, 718] }, "\u00BB" => { wx: 556, boundingbox: [97, 108, 459, 446] }, "\u00BC" => { wx: 1000, boundingbox: [115, 0, 885, 106] }, "\u00BD" => { wx: 1000, boundingbox: [7, -19, 994, 703] }, "\u00BF" => { wx: 611, boundingbox: [91, -201, 527, 525] }, "\u00C1" => { wx: 333, boundingbox: [14, 593, 211, 734] }, "\u00C2" => { wx: 333, boundingbox: [122, 593, 319, 734] }, "\u00C3" => { wx: 333, boundingbox: [21, 593, 312, 734] }, "\u00C4" => { wx: 333, boundingbox: [-4, 606, 337, 722] }, "\u00C5" => { wx: 333, boundingbox: [10, 627, 323, 684] }, "\u00C6" => { wx: 333, boundingbox: [13, 595, 321, 731] }, "\u00C7" => { wx: 333, boundingbox: [121, 604, 212, 706] }, "\u00C8" => { wx: 333, boundingbox: [40, 604, 293, 706] }, "\u00CA" => { wx: 333, boundingbox: [75, 572, 259, 756] }, "\u00CB" => { wx: 333, boundingbox: [45, -225, 259, 0] }, "\u00CD" => { wx: 333, boundingbox: [31, 593, 409, 734] }, "\u00CE" => { wx: 333, boundingbox: [73, -225, 287, 0] }, "\u00CF" => { wx: 333, boundingbox: [21, 593, 312, 734] }, "\u00D0" => { wx: 1000, boundingbox: [0, 240, 1000, 313] }, "\u00E1" => { wx: 1000, boundingbox: [8, 0, 951, 718] }, "\u00E3" => { wx: 370, boundingbox: [24, 405, 346, 737] }, "\u00E8" => { wx: 556, boundingbox: [-20, 0, 537, 718] }, "\u00E9" => { wx: 778, boundingbox: [39, -19, 740, 737] }, "\u00EA" => { wx: 1000, boundingbox: [36, -19, 965, 737] }, "\u00EB" => { wx: 365, boundingbox: [25, 405, 341, 737] }, "\u00F1" => { wx: 889, boundingbox: [36, -15, 847, 538] }, "\u00F5" => { wx: 278, boundingbox: [95, 0, 183, 523] }, "\u00F8" => { wx: 222, boundingbox: [-20, 0, 242, 718] }, "\u00F9" => { wx: 611, boundingbox: [28, -22, 537, 545] }, "\u00FA" => { wx: 944, boundingbox: [35, -15, 902, 538] }, "\u00FB" => { wx: 611, boundingbox: [67, -15, 571, 728] }, "\xFF" => { wx: 556, boundingbox: [0, 0, 0, 0] } }
|
165
|
+
helvetica_bold_metrics = { ' ' => { wx: 278, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 333, boundingbox: [90, 0, 244, 718] }, '"' => { wx: 474, boundingbox: [98, 447, 376, 718] }, '#' => { wx: 556, boundingbox: [18, 0, 538, 698] }, '$' => { wx: 556, boundingbox: [30, -115, 523, 775] }, '%' => { wx: 889, boundingbox: [28, -19, 861, 710] }, '&' => { wx: 722, boundingbox: [54, -19, 701, 718] }, "'" => { wx: 278, boundingbox: [69, 445, 209, 718] }, '(' => { wx: 333, boundingbox: [35, -208, 314, 734] }, ')' => { wx: 333, boundingbox: [19, -208, 298, 734] }, '*' => { wx: 389, boundingbox: [27, 387, 362, 718] }, '+' => { wx: 584, boundingbox: [40, 0, 544, 506] }, ',' => { wx: 278, boundingbox: [64, -168, 214, 146] }, '-' => { wx: 333, boundingbox: [27, 215, 306, 345] }, '.' => { wx: 278, boundingbox: [64, 0, 214, 146] }, '/' => { wx: 278, boundingbox: [-33, -19, 311, 737] }, '0' => { wx: 556, boundingbox: [32, -19, 524, 710] }, '1' => { wx: 556, boundingbox: [69, 0, 378, 710] }, '2' => { wx: 556, boundingbox: [26, 0, 511, 710] }, '3' => { wx: 556, boundingbox: [27, -19, 516, 710] }, '4' => { wx: 556, boundingbox: [27, 0, 526, 710] }, '5' => { wx: 556, boundingbox: [27, -19, 516, 698] }, '6' => { wx: 556, boundingbox: [31, -19, 520, 710] }, '7' => { wx: 556, boundingbox: [25, 0, 528, 698] }, '8' => { wx: 556, boundingbox: [32, -19, 524, 710] }, '9' => { wx: 556, boundingbox: [30, -19, 522, 710] }, ':' => { wx: 333, boundingbox: [92, 0, 242, 512] }, ';' => { wx: 333, boundingbox: [92, -168, 242, 512] }, '<' => { wx: 584, boundingbox: [38, -8, 546, 514] }, '=' => { wx: 584, boundingbox: [40, 87, 544, 419] }, '>' => { wx: 584, boundingbox: [38, -8, 546, 514] }, '?' => { wx: 611, boundingbox: [60, 0, 556, 727] }, '@' => { wx: 975, boundingbox: [118, -19, 856, 737] }, 'A' => { wx: 722, boundingbox: [20, 0, 702, 718] }, 'B' => { wx: 722, boundingbox: [76, 0, 669, 718] }, 'C' => { wx: 722, boundingbox: [44, -19, 684, 737] }, 'D' => { wx: 722, boundingbox: [76, 0, 685, 718] }, 'E' => { wx: 667, boundingbox: [76, 0, 621, 718] }, 'F' => { wx: 611, boundingbox: [76, 0, 587, 718] }, 'G' => { wx: 778, boundingbox: [44, -19, 713, 737] }, 'H' => { wx: 722, boundingbox: [71, 0, 651, 718] }, 'I' => { wx: 278, boundingbox: [64, 0, 214, 718] }, 'J' => { wx: 556, boundingbox: [22, -18, 484, 718] }, 'K' => { wx: 722, boundingbox: [87, 0, 722, 718] }, 'L' => { wx: 611, boundingbox: [76, 0, 583, 718] }, 'M' => { wx: 833, boundingbox: [69, 0, 765, 718] }, 'N' => { wx: 722, boundingbox: [69, 0, 654, 718] }, 'O' => { wx: 778, boundingbox: [44, -19, 734, 737] }, 'P' => { wx: 667, boundingbox: [76, 0, 627, 718] }, 'Q' => { wx: 778, boundingbox: [44, -52, 737, 737] }, 'R' => { wx: 722, boundingbox: [76, 0, 677, 718] }, 'S' => { wx: 667, boundingbox: [39, -19, 629, 737] }, 'T' => { wx: 611, boundingbox: [14, 0, 598, 718] }, 'U' => { wx: 722, boundingbox: [72, -19, 651, 718] }, 'V' => { wx: 667, boundingbox: [19, 0, 648, 718] }, 'W' => { wx: 944, boundingbox: [16, 0, 929, 718] }, 'X' => { wx: 667, boundingbox: [14, 0, 653, 718] }, 'Y' => { wx: 667, boundingbox: [15, 0, 653, 718] }, 'Z' => { wx: 611, boundingbox: [25, 0, 586, 718] }, '[' => { wx: 333, boundingbox: [63, -196, 309, 722] }, '\\' => { wx: 278, boundingbox: [-33, -19, 311, 737] }, ']' => { wx: 333, boundingbox: [24, -196, 270, 722] }, '^' => { wx: 584, boundingbox: [62, 323, 522, 698] }, '_' => { wx: 556, boundingbox: [0, -125, 556, -75] }, '`' => { wx: 278, boundingbox: [69, 454, 209, 727] }, 'a' => { wx: 556, boundingbox: [29, -14, 527, 546] }, 'b' => { wx: 611, boundingbox: [61, -14, 578, 718] }, 'c' => { wx: 556, boundingbox: [34, -14, 524, 546] }, 'd' => { wx: 611, boundingbox: [34, -14, 551, 718] }, 'e' => { wx: 556, boundingbox: [23, -14, 528, 546] }, 'f' => { wx: 333, boundingbox: [10, 0, 318, 727] }, 'g' => { wx: 611, boundingbox: [40, -217, 553, 546] }, 'h' => { wx: 611, boundingbox: [65, 0, 546, 718] }, 'i' => { wx: 278, boundingbox: [69, 0, 209, 725] }, 'j' => { wx: 278, boundingbox: [3, -214, 209, 725] }, 'k' => { wx: 556, boundingbox: [69, 0, 562, 718] }, 'l' => { wx: 278, boundingbox: [69, 0, 209, 718] }, 'm' => { wx: 889, boundingbox: [64, 0, 826, 546] }, 'n' => { wx: 611, boundingbox: [65, 0, 546, 546] }, 'o' => { wx: 611, boundingbox: [34, -14, 578, 546] }, 'p' => { wx: 611, boundingbox: [62, -207, 578, 546] }, 'q' => { wx: 611, boundingbox: [34, -207, 552, 546] }, 'r' => { wx: 389, boundingbox: [64, 0, 373, 546] }, 's' => { wx: 556, boundingbox: [30, -14, 519, 546] }, 't' => { wx: 333, boundingbox: [10, -6, 309, 676] }, 'u' => { wx: 611, boundingbox: [66, -14, 545, 532] }, 'v' => { wx: 556, boundingbox: [13, 0, 543, 532] }, 'w' => { wx: 778, boundingbox: [10, 0, 769, 532] }, 'x' => { wx: 556, boundingbox: [15, 0, 541, 532] }, 'y' => { wx: 556, boundingbox: [10, -214, 539, 532] }, 'z' => { wx: 500, boundingbox: [20, 0, 480, 532] }, '{' => { wx: 389, boundingbox: [48, -196, 365, 722] }, '|' => { wx: 280, boundingbox: [84, -225, 196, 775] }, '}' => { wx: 389, boundingbox: [24, -196, 341, 722] }, '~' => { wx: 584, boundingbox: [61, 163, 523, 343] }, "\u00A1" => { wx: 333, boundingbox: [90, -186, 244, 532] }, "\u00A2" => { wx: 556, boundingbox: [34, -118, 524, 628] }, "\u00A3" => { wx: 556, boundingbox: [28, -16, 541, 718] }, "\u00A4" => { wx: 167, boundingbox: [-170, -19, 336, 710] }, "\u00A5" => { wx: 556, boundingbox: [-9, 0, 565, 698] }, "\u00A6" => { wx: 556, boundingbox: [-10, -210, 516, 737] }, "\u00A7" => { wx: 556, boundingbox: [34, -184, 522, 727] }, "\u00A8" => { wx: 556, boundingbox: [-3, 76, 559, 636] }, "\u00A9" => { wx: 238, boundingbox: [70, 447, 168, 718] }, "\u00AA" => { wx: 500, boundingbox: [64, 454, 436, 727] }, "\u00AB" => { wx: 556, boundingbox: [88, 76, 468, 484] }, "\u00AC" => { wx: 333, boundingbox: [83, 76, 250, 484] }, "\u00AD" => { wx: 333, boundingbox: [83, 76, 250, 484] }, "\u00AE" => { wx: 611, boundingbox: [10, 0, 542, 727] }, "\u00AF" => { wx: 611, boundingbox: [10, 0, 542, 727] }, "\u00B1" => { wx: 556, boundingbox: [0, 227, 556, 333] }, "\u00B2" => { wx: 556, boundingbox: [36, -171, 520, 718] }, "\u00B3" => { wx: 556, boundingbox: [36, -171, 520, 718] }, "\u00B4" => { wx: 278, boundingbox: [58, 172, 220, 334] }, "\u00B6" => { wx: 556, boundingbox: [-8, -191, 539, 700] }, "\u00B7" => { wx: 350, boundingbox: [10, 194, 340, 524] }, "\u00B8" => { wx: 278, boundingbox: [69, -146, 209, 127] }, "\u00B9" => { wx: 500, boundingbox: [64, -146, 436, 127] }, "\u00BA" => { wx: 500, boundingbox: [64, 445, 436, 718] }, "\u00BB" => { wx: 556, boundingbox: [88, 76, 468, 484] }, "\u00BC" => { wx: 1000, boundingbox: [92, 0, 908, 146] }, "\u00BD" => { wx: 1000, boundingbox: [-3, -19, 1003, 710] }, "\u00BF" => { wx: 611, boundingbox: [55, -195, 551, 532] }, "\u00C1" => { wx: 333, boundingbox: [-23, 604, 225, 750] }, "\u00C2" => { wx: 333, boundingbox: [108, 604, 356, 750] }, "\u00C3" => { wx: 333, boundingbox: [-10, 604, 343, 750] }, "\u00C4" => { wx: 333, boundingbox: [-17, 610, 350, 737] }, "\u00C5" => { wx: 333, boundingbox: [-6, 604, 339, 678] }, "\u00C6" => { wx: 333, boundingbox: [-2, 604, 335, 750] }, "\u00C7" => { wx: 333, boundingbox: [104, 614, 230, 729] }, "\u00C8" => { wx: 333, boundingbox: [6, 614, 327, 729] }, "\u00CA" => { wx: 333, boundingbox: [59, 568, 275, 776] }, "\u00CB" => { wx: 333, boundingbox: [6, -228, 245, 0] }, "\u00CD" => { wx: 333, boundingbox: [9, 604, 486, 750] }, "\u00CE" => { wx: 333, boundingbox: [71, -228, 304, 0] }, "\u00CF" => { wx: 333, boundingbox: [-10, 604, 343, 750] }, "\u00D0" => { wx: 1000, boundingbox: [0, 227, 1000, 333] }, "\u00E1" => { wx: 1000, boundingbox: [5, 0, 954, 718] }, "\u00E3" => { wx: 370, boundingbox: [22, 401, 347, 737] }, "\u00E8" => { wx: 611, boundingbox: [-20, 0, 583, 718] }, "\u00E9" => { wx: 778, boundingbox: [33, -27, 744, 745] }, "\u00EA" => { wx: 1000, boundingbox: [37, -19, 961, 737] }, "\u00EB" => { wx: 365, boundingbox: [6, 401, 360, 737] }, "\u00F1" => { wx: 889, boundingbox: [29, -14, 858, 546] }, "\u00F5" => { wx: 278, boundingbox: [69, 0, 209, 532] }, "\u00F8" => { wx: 278, boundingbox: [-18, 0, 296, 718] }, "\u00F9" => { wx: 611, boundingbox: [22, -29, 589, 560] }, "\u00FA" => { wx: 944, boundingbox: [34, -14, 912, 546] }, "\u00FB" => { wx: 611, boundingbox: [69, -14, 579, 731] }, "\xFF" => { wx: 556, boundingbox: [0, 0, 0, 0] } }
|
166
|
+
helvetica_oblique_metrics = { ' ' => { wx: 278, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 278, boundingbox: [90, 0, 340, 718] }, '"' => { wx: 355, boundingbox: [168, 463, 438, 718] }, '#' => { wx: 556, boundingbox: [73, 0, 631, 688] }, '$' => { wx: 556, boundingbox: [69, -115, 617, 775] }, '%' => { wx: 889, boundingbox: [147, -19, 889, 703] }, '&' => { wx: 667, boundingbox: [77, -15, 647, 718] }, "'" => { wx: 222, boundingbox: [151, 463, 310, 718] }, '(' => { wx: 333, boundingbox: [108, -207, 454, 733] }, ')' => { wx: 333, boundingbox: [-9, -207, 337, 733] }, '*' => { wx: 389, boundingbox: [165, 431, 475, 718] }, '+' => { wx: 584, boundingbox: [85, 0, 606, 505] }, ',' => { wx: 278, boundingbox: [56, -147, 214, 106] }, '-' => { wx: 333, boundingbox: [93, 232, 357, 322] }, '.' => { wx: 278, boundingbox: [87, 0, 214, 106] }, '/' => { wx: 278, boundingbox: [-21, -19, 452, 737] }, '0' => { wx: 556, boundingbox: [93, -19, 608, 703] }, '1' => { wx: 556, boundingbox: [207, 0, 508, 703] }, '2' => { wx: 556, boundingbox: [26, 0, 617, 703] }, '3' => { wx: 556, boundingbox: [75, -19, 610, 703] }, '4' => { wx: 556, boundingbox: [61, 0, 576, 703] }, '5' => { wx: 556, boundingbox: [68, -19, 621, 688] }, '6' => { wx: 556, boundingbox: [91, -19, 615, 703] }, '7' => { wx: 556, boundingbox: [137, 0, 669, 688] }, '8' => { wx: 556, boundingbox: [74, -19, 607, 703] }, '9' => { wx: 556, boundingbox: [82, -19, 609, 703] }, ':' => { wx: 278, boundingbox: [87, 0, 301, 516] }, ';' => { wx: 278, boundingbox: [56, -147, 301, 516] }, '<' => { wx: 584, boundingbox: [94, 11, 641, 495] }, '=' => { wx: 584, boundingbox: [63, 115, 628, 390] }, '>' => { wx: 584, boundingbox: [50, 11, 597, 495] }, '?' => { wx: 556, boundingbox: [161, 0, 610, 727] }, '@' => { wx: 1015, boundingbox: [215, -19, 965, 737] }, 'A' => { wx: 667, boundingbox: [14, 0, 654, 718] }, 'B' => { wx: 667, boundingbox: [74, 0, 712, 718] }, 'C' => { wx: 722, boundingbox: [108, -19, 782, 737] }, 'D' => { wx: 722, boundingbox: [81, 0, 764, 718] }, 'E' => { wx: 667, boundingbox: [86, 0, 762, 718] }, 'F' => { wx: 611, boundingbox: [86, 0, 736, 718] }, 'G' => { wx: 778, boundingbox: [111, -19, 799, 737] }, 'H' => { wx: 722, boundingbox: [77, 0, 799, 718] }, 'I' => { wx: 278, boundingbox: [91, 0, 341, 718] }, 'J' => { wx: 500, boundingbox: [47, -19, 581, 718] }, 'K' => { wx: 667, boundingbox: [76, 0, 808, 718] }, 'L' => { wx: 556, boundingbox: [76, 0, 555, 718] }, 'M' => { wx: 833, boundingbox: [73, 0, 914, 718] }, 'N' => { wx: 722, boundingbox: [76, 0, 799, 718] }, 'O' => { wx: 778, boundingbox: [105, -19, 826, 737] }, 'P' => { wx: 667, boundingbox: [86, 0, 737, 718] }, 'Q' => { wx: 778, boundingbox: [105, -56, 826, 737] }, 'R' => { wx: 722, boundingbox: [88, 0, 773, 718] }, 'S' => { wx: 667, boundingbox: [90, -19, 713, 737] }, 'T' => { wx: 611, boundingbox: [148, 0, 750, 718] }, 'U' => { wx: 722, boundingbox: [123, -19, 797, 718] }, 'V' => { wx: 667, boundingbox: [173, 0, 800, 718] }, 'W' => { wx: 944, boundingbox: [169, 0, 1081, 718] }, 'X' => { wx: 667, boundingbox: [19, 0, 790, 718] }, 'Y' => { wx: 667, boundingbox: [167, 0, 806, 718] }, 'Z' => { wx: 611, boundingbox: [23, 0, 741, 718] }, '[' => { wx: 278, boundingbox: [21, -196, 403, 722] }, '\\' => { wx: 278, boundingbox: [140, -19, 291, 737] }, ']' => { wx: 278, boundingbox: [-14, -196, 368, 722] }, '^' => { wx: 469, boundingbox: [42, 264, 539, 688] }, '_' => { wx: 556, boundingbox: [-27, -125, 540, -75] }, '`' => { wx: 222, boundingbox: [165, 470, 323, 725] }, 'a' => { wx: 556, boundingbox: [61, -15, 559, 538] }, 'b' => { wx: 556, boundingbox: [58, -15, 584, 718] }, 'c' => { wx: 500, boundingbox: [74, -15, 553, 538] }, 'd' => { wx: 556, boundingbox: [84, -15, 652, 718] }, 'e' => { wx: 556, boundingbox: [84, -15, 578, 538] }, 'f' => { wx: 278, boundingbox: [86, 0, 416, 728] }, 'g' => { wx: 556, boundingbox: [42, -220, 610, 538] }, 'h' => { wx: 556, boundingbox: [65, 0, 573, 718] }, 'i' => { wx: 222, boundingbox: [67, 0, 308, 718] }, 'j' => { wx: 222, boundingbox: [-60, -210, 308, 718] }, 'k' => { wx: 500, boundingbox: [67, 0, 600, 718] }, 'l' => { wx: 222, boundingbox: [67, 0, 308, 718] }, 'm' => { wx: 833, boundingbox: [65, 0, 852, 538] }, 'n' => { wx: 556, boundingbox: [65, 0, 573, 538] }, 'o' => { wx: 556, boundingbox: [83, -14, 585, 538] }, 'p' => { wx: 556, boundingbox: [14, -207, 584, 538] }, 'q' => { wx: 556, boundingbox: [84, -207, 605, 538] }, 'r' => { wx: 333, boundingbox: [77, 0, 446, 538] }, 's' => { wx: 500, boundingbox: [63, -15, 529, 538] }, 't' => { wx: 278, boundingbox: [102, -7, 368, 669] }, 'u' => { wx: 556, boundingbox: [94, -15, 600, 523] }, 'v' => { wx: 500, boundingbox: [119, 0, 603, 523] }, 'w' => { wx: 722, boundingbox: [125, 0, 820, 523] }, 'x' => { wx: 500, boundingbox: [11, 0, 594, 523] }, 'y' => { wx: 500, boundingbox: [15, -214, 600, 523] }, 'z' => { wx: 500, boundingbox: [31, 0, 571, 523] }, '{' => { wx: 334, boundingbox: [92, -196, 445, 722] }, '|' => { wx: 260, boundingbox: [46, -225, 332, 775] }, '}' => { wx: 334, boundingbox: [0, -196, 354, 722] }, '~' => { wx: 584, boundingbox: [111, 180, 580, 326] }, "\u00A1" => { wx: 333, boundingbox: [77, -195, 326, 523] }, "\u00A2" => { wx: 556, boundingbox: [95, -115, 584, 623] }, "\u00A3" => { wx: 556, boundingbox: [49, -16, 634, 718] }, "\u00A4" => { wx: 167, boundingbox: [-170, -19, 482, 703] }, "\u00A5" => { wx: 556, boundingbox: [81, 0, 699, 688] }, "\u00A6" => { wx: 556, boundingbox: [-52, -207, 654, 737] }, "\u00A7" => { wx: 556, boundingbox: [76, -191, 584, 737] }, "\u00A8" => { wx: 556, boundingbox: [60, 99, 646, 603] }, "\u00A9" => { wx: 191, boundingbox: [157, 463, 285, 718] }, "\u00AA" => { wx: 333, boundingbox: [138, 470, 461, 725] }, "\u00AB" => { wx: 556, boundingbox: [146, 108, 554, 446] }, "\u00AC" => { wx: 333, boundingbox: [137, 108, 340, 446] }, "\u00AD" => { wx: 333, boundingbox: [111, 108, 314, 446] }, "\u00AE" => { wx: 500, boundingbox: [86, 0, 587, 728] }, "\u00AF" => { wx: 500, boundingbox: [86, 0, 585, 728] }, "\u00B1" => { wx: 556, boundingbox: [51, 240, 623, 313] }, "\u00B2" => { wx: 556, boundingbox: [135, -159, 622, 718] }, "\u00B3" => { wx: 556, boundingbox: [52, -159, 623, 718] }, "\u00B4" => { wx: 278, boundingbox: [129, 190, 257, 315] }, "\u00B6" => { wx: 537, boundingbox: [126, -173, 650, 718] }, "\u00B7" => { wx: 350, boundingbox: [91, 202, 413, 517] }, "\u00B8" => { wx: 222, boundingbox: [21, -149, 180, 106] }, "\u00B9" => { wx: 333, boundingbox: [-6, -149, 318, 106] }, "\u00BA" => { wx: 333, boundingbox: [124, 463, 448, 718] }, "\u00BB" => { wx: 556, boundingbox: [120, 108, 528, 446] }, "\u00BC" => { wx: 1000, boundingbox: [115, 0, 908, 106] }, "\u00BD" => { wx: 1000, boundingbox: [88, -19, 1029, 703] }, "\u00BF" => { wx: 611, boundingbox: [85, -201, 534, 525] }, "\u00C1" => { wx: 333, boundingbox: [170, 593, 337, 734] }, "\u00C2" => { wx: 333, boundingbox: [248, 593, 475, 734] }, "\u00C3" => { wx: 333, boundingbox: [147, 593, 438, 734] }, "\u00C4" => { wx: 333, boundingbox: [125, 606, 490, 722] }, "\u00C5" => { wx: 333, boundingbox: [143, 627, 468, 684] }, "\u00C6" => { wx: 333, boundingbox: [167, 595, 476, 731] }, "\u00C7" => { wx: 333, boundingbox: [249, 604, 362, 706] }, "\u00C8" => { wx: 333, boundingbox: [168, 604, 443, 706] }, "\u00CA" => { wx: 333, boundingbox: [214, 572, 402, 756] }, "\u00CB" => { wx: 333, boundingbox: [2, -225, 232, 0] }, "\u00CD" => { wx: 333, boundingbox: [157, 593, 565, 734] }, "\u00CE" => { wx: 333, boundingbox: [43, -225, 249, 0] }, "\u00CF" => { wx: 333, boundingbox: [177, 593, 468, 734] }, "\u00D0" => { wx: 1000, boundingbox: [51, 240, 1067, 313] }, "\u00E1" => { wx: 1000, boundingbox: [8, 0, 1097, 718] }, "\u00E3" => { wx: 370, boundingbox: [127, 405, 449, 737] }, "\u00E8" => { wx: 556, boundingbox: [41, 0, 555, 718] }, "\u00E9" => { wx: 778, boundingbox: [43, -19, 890, 737] }, "\u00EA" => { wx: 1000, boundingbox: [98, -19, 1116, 737] }, "\u00EB" => { wx: 365, boundingbox: [141, 405, 468, 737] }, "\u00F1" => { wx: 889, boundingbox: [61, -15, 909, 538] }, "\u00F5" => { wx: 278, boundingbox: [95, 0, 294, 523] }, "\u00F8" => { wx: 222, boundingbox: [41, 0, 347, 718] }, "\u00F9" => { wx: 611, boundingbox: [29, -22, 647, 545] }, "\u00FA" => { wx: 944, boundingbox: [83, -15, 964, 538] }, "\u00FB" => { wx: 611, boundingbox: [67, -15, 658, 728] }, "\xFF" => { wx: 556, boundingbox: [0, 0, 0, 0] } }
|
167
|
+
helvetica_oblique_metrics = { ' ' => { wx: 278, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 278, boundingbox: [90, 0, 340, 718] }, '"' => { wx: 355, boundingbox: [168, 463, 438, 718] }, '#' => { wx: 556, boundingbox: [73, 0, 631, 688] }, '$' => { wx: 556, boundingbox: [69, -115, 617, 775] }, '%' => { wx: 889, boundingbox: [147, -19, 889, 703] }, '&' => { wx: 667, boundingbox: [77, -15, 647, 718] }, "'" => { wx: 222, boundingbox: [151, 463, 310, 718] }, '(' => { wx: 333, boundingbox: [108, -207, 454, 733] }, ')' => { wx: 333, boundingbox: [-9, -207, 337, 733] }, '*' => { wx: 389, boundingbox: [165, 431, 475, 718] }, '+' => { wx: 584, boundingbox: [85, 0, 606, 505] }, ',' => { wx: 278, boundingbox: [56, -147, 214, 106] }, '-' => { wx: 333, boundingbox: [93, 232, 357, 322] }, '.' => { wx: 278, boundingbox: [87, 0, 214, 106] }, '/' => { wx: 278, boundingbox: [-21, -19, 452, 737] }, '0' => { wx: 556, boundingbox: [93, -19, 608, 703] }, '1' => { wx: 556, boundingbox: [207, 0, 508, 703] }, '2' => { wx: 556, boundingbox: [26, 0, 617, 703] }, '3' => { wx: 556, boundingbox: [75, -19, 610, 703] }, '4' => { wx: 556, boundingbox: [61, 0, 576, 703] }, '5' => { wx: 556, boundingbox: [68, -19, 621, 688] }, '6' => { wx: 556, boundingbox: [91, -19, 615, 703] }, '7' => { wx: 556, boundingbox: [137, 0, 669, 688] }, '8' => { wx: 556, boundingbox: [74, -19, 607, 703] }, '9' => { wx: 556, boundingbox: [82, -19, 609, 703] }, ':' => { wx: 278, boundingbox: [87, 0, 301, 516] }, ';' => { wx: 278, boundingbox: [56, -147, 301, 516] }, '<' => { wx: 584, boundingbox: [94, 11, 641, 495] }, '=' => { wx: 584, boundingbox: [63, 115, 628, 390] }, '>' => { wx: 584, boundingbox: [50, 11, 597, 495] }, '?' => { wx: 556, boundingbox: [161, 0, 610, 727] }, '@' => { wx: 1015, boundingbox: [215, -19, 965, 737] }, 'A' => { wx: 667, boundingbox: [14, 0, 654, 718] }, 'B' => { wx: 667, boundingbox: [74, 0, 712, 718] }, 'C' => { wx: 722, boundingbox: [108, -19, 782, 737] }, 'D' => { wx: 722, boundingbox: [81, 0, 764, 718] }, 'E' => { wx: 667, boundingbox: [86, 0, 762, 718] }, 'F' => { wx: 611, boundingbox: [86, 0, 736, 718] }, 'G' => { wx: 778, boundingbox: [111, -19, 799, 737] }, 'H' => { wx: 722, boundingbox: [77, 0, 799, 718] }, 'I' => { wx: 278, boundingbox: [91, 0, 341, 718] }, 'J' => { wx: 500, boundingbox: [47, -19, 581, 718] }, 'K' => { wx: 667, boundingbox: [76, 0, 808, 718] }, 'L' => { wx: 556, boundingbox: [76, 0, 555, 718] }, 'M' => { wx: 833, boundingbox: [73, 0, 914, 718] }, 'N' => { wx: 722, boundingbox: [76, 0, 799, 718] }, 'O' => { wx: 778, boundingbox: [105, -19, 826, 737] }, 'P' => { wx: 667, boundingbox: [86, 0, 737, 718] }, 'Q' => { wx: 778, boundingbox: [105, -56, 826, 737] }, 'R' => { wx: 722, boundingbox: [88, 0, 773, 718] }, 'S' => { wx: 667, boundingbox: [90, -19, 713, 737] }, 'T' => { wx: 611, boundingbox: [148, 0, 750, 718] }, 'U' => { wx: 722, boundingbox: [123, -19, 797, 718] }, 'V' => { wx: 667, boundingbox: [173, 0, 800, 718] }, 'W' => { wx: 944, boundingbox: [169, 0, 1081, 718] }, 'X' => { wx: 667, boundingbox: [19, 0, 790, 718] }, 'Y' => { wx: 667, boundingbox: [167, 0, 806, 718] }, 'Z' => { wx: 611, boundingbox: [23, 0, 741, 718] }, '[' => { wx: 278, boundingbox: [21, -196, 403, 722] }, '\\' => { wx: 278, boundingbox: [140, -19, 291, 737] }, ']' => { wx: 278, boundingbox: [-14, -196, 368, 722] }, '^' => { wx: 469, boundingbox: [42, 264, 539, 688] }, '_' => { wx: 556, boundingbox: [-27, -125, 540, -75] }, '`' => { wx: 222, boundingbox: [165, 470, 323, 725] }, 'a' => { wx: 556, boundingbox: [61, -15, 559, 538] }, 'b' => { wx: 556, boundingbox: [58, -15, 584, 718] }, 'c' => { wx: 500, boundingbox: [74, -15, 553, 538] }, 'd' => { wx: 556, boundingbox: [84, -15, 652, 718] }, 'e' => { wx: 556, boundingbox: [84, -15, 578, 538] }, 'f' => { wx: 278, boundingbox: [86, 0, 416, 728] }, 'g' => { wx: 556, boundingbox: [42, -220, 610, 538] }, 'h' => { wx: 556, boundingbox: [65, 0, 573, 718] }, 'i' => { wx: 222, boundingbox: [67, 0, 308, 718] }, 'j' => { wx: 222, boundingbox: [-60, -210, 308, 718] }, 'k' => { wx: 500, boundingbox: [67, 0, 600, 718] }, 'l' => { wx: 222, boundingbox: [67, 0, 308, 718] }, 'm' => { wx: 833, boundingbox: [65, 0, 852, 538] }, 'n' => { wx: 556, boundingbox: [65, 0, 573, 538] }, 'o' => { wx: 556, boundingbox: [83, -14, 585, 538] }, 'p' => { wx: 556, boundingbox: [14, -207, 584, 538] }, 'q' => { wx: 556, boundingbox: [84, -207, 605, 538] }, 'r' => { wx: 333, boundingbox: [77, 0, 446, 538] }, 's' => { wx: 500, boundingbox: [63, -15, 529, 538] }, 't' => { wx: 278, boundingbox: [102, -7, 368, 669] }, 'u' => { wx: 556, boundingbox: [94, -15, 600, 523] }, 'v' => { wx: 500, boundingbox: [119, 0, 603, 523] }, 'w' => { wx: 722, boundingbox: [125, 0, 820, 523] }, 'x' => { wx: 500, boundingbox: [11, 0, 594, 523] }, 'y' => { wx: 500, boundingbox: [15, -214, 600, 523] }, 'z' => { wx: 500, boundingbox: [31, 0, 571, 523] }, '{' => { wx: 334, boundingbox: [92, -196, 445, 722] }, '|' => { wx: 260, boundingbox: [46, -225, 332, 775] }, '}' => { wx: 334, boundingbox: [0, -196, 354, 722] }, '~' => { wx: 584, boundingbox: [111, 180, 580, 326] }, "\u00A1" => { wx: 333, boundingbox: [77, -195, 326, 523] }, "\u00A2" => { wx: 556, boundingbox: [95, -115, 584, 623] }, "\u00A3" => { wx: 556, boundingbox: [49, -16, 634, 718] }, "\u00A4" => { wx: 167, boundingbox: [-170, -19, 482, 703] }, "\u00A5" => { wx: 556, boundingbox: [81, 0, 699, 688] }, "\u00A6" => { wx: 556, boundingbox: [-52, -207, 654, 737] }, "\u00A7" => { wx: 556, boundingbox: [76, -191, 584, 737] }, "\u00A8" => { wx: 556, boundingbox: [60, 99, 646, 603] }, "\u00A9" => { wx: 191, boundingbox: [157, 463, 285, 718] }, "\u00AA" => { wx: 333, boundingbox: [138, 470, 461, 725] }, "\u00AB" => { wx: 556, boundingbox: [146, 108, 554, 446] }, "\u00AC" => { wx: 333, boundingbox: [137, 108, 340, 446] }, "\u00AD" => { wx: 333, boundingbox: [111, 108, 314, 446] }, "\u00AE" => { wx: 500, boundingbox: [86, 0, 587, 728] }, "\u00AF" => { wx: 500, boundingbox: [86, 0, 585, 728] }, "\u00B1" => { wx: 556, boundingbox: [51, 240, 623, 313] }, "\u00B2" => { wx: 556, boundingbox: [135, -159, 622, 718] }, "\u00B3" => { wx: 556, boundingbox: [52, -159, 623, 718] }, "\u00B4" => { wx: 278, boundingbox: [129, 190, 257, 315] }, "\u00B6" => { wx: 537, boundingbox: [126, -173, 650, 718] }, "\u00B7" => { wx: 350, boundingbox: [91, 202, 413, 517] }, "\u00B8" => { wx: 222, boundingbox: [21, -149, 180, 106] }, "\u00B9" => { wx: 333, boundingbox: [-6, -149, 318, 106] }, "\u00BA" => { wx: 333, boundingbox: [124, 463, 448, 718] }, "\u00BB" => { wx: 556, boundingbox: [120, 108, 528, 446] }, "\u00BC" => { wx: 1000, boundingbox: [115, 0, 908, 106] }, "\u00BD" => { wx: 1000, boundingbox: [88, -19, 1029, 703] }, "\u00BF" => { wx: 611, boundingbox: [85, -201, 534, 525] }, "\u00C1" => { wx: 333, boundingbox: [170, 593, 337, 734] }, "\u00C2" => { wx: 333, boundingbox: [248, 593, 475, 734] }, "\u00C3" => { wx: 333, boundingbox: [147, 593, 438, 734] }, "\u00C4" => { wx: 333, boundingbox: [125, 606, 490, 722] }, "\u00C5" => { wx: 333, boundingbox: [143, 627, 468, 684] }, "\u00C6" => { wx: 333, boundingbox: [167, 595, 476, 731] }, "\u00C7" => { wx: 333, boundingbox: [249, 604, 362, 706] }, "\u00C8" => { wx: 333, boundingbox: [168, 604, 443, 706] }, "\u00CA" => { wx: 333, boundingbox: [214, 572, 402, 756] }, "\u00CB" => { wx: 333, boundingbox: [2, -225, 232, 0] }, "\u00CD" => { wx: 333, boundingbox: [157, 593, 565, 734] }, "\u00CE" => { wx: 333, boundingbox: [43, -225, 249, 0] }, "\u00CF" => { wx: 333, boundingbox: [177, 593, 468, 734] }, "\u00D0" => { wx: 1000, boundingbox: [51, 240, 1067, 313] }, "\u00E1" => { wx: 1000, boundingbox: [8, 0, 1097, 718] }, "\u00E3" => { wx: 370, boundingbox: [127, 405, 449, 737] }, "\u00E8" => { wx: 556, boundingbox: [41, 0, 555, 718] }, "\u00E9" => { wx: 778, boundingbox: [43, -19, 890, 737] }, "\u00EA" => { wx: 1000, boundingbox: [98, -19, 1116, 737] }, "\u00EB" => { wx: 365, boundingbox: [141, 405, 468, 737] }, "\u00F1" => { wx: 889, boundingbox: [61, -15, 909, 538] }, "\u00F5" => { wx: 278, boundingbox: [95, 0, 294, 523] }, "\u00F8" => { wx: 222, boundingbox: [41, 0, 347, 718] }, "\u00F9" => { wx: 611, boundingbox: [29, -22, 647, 545] }, "\u00FA" => { wx: 944, boundingbox: [83, -15, 964, 538] }, "\u00FB" => { wx: 611, boundingbox: [67, -15, 658, 728] }, "\xFF" => { wx: 556, boundingbox: [0, 0, 0, 0] } }
|
168
|
+
courier_metrics = { ' ' => { wx: 600, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 600, boundingbox: [236, -15, 364, 572] }, '"' => { wx: 600, boundingbox: [187, 328, 413, 562] }, '#' => { wx: 600, boundingbox: [93, -32, 507, 639] }, '$' => { wx: 600, boundingbox: [105, -126, 496, 662] }, '%' => { wx: 600, boundingbox: [81, -15, 518, 622] }, '&' => { wx: 600, boundingbox: [63, -15, 538, 543] }, "'" => { wx: 600, boundingbox: [213, 328, 376, 562] }, '(' => { wx: 600, boundingbox: [269, -108, 440, 622] }, ')' => { wx: 600, boundingbox: [160, -108, 331, 622] }, '*' => { wx: 600, boundingbox: [116, 257, 484, 607] }, '+' => { wx: 600, boundingbox: [80, 44, 520, 470] }, ',' => { wx: 600, boundingbox: [181, -112, 344, 122] }, '-' => { wx: 600, boundingbox: [103, 231, 497, 285] }, '.' => { wx: 600, boundingbox: [229, -15, 371, 109] }, '/' => { wx: 600, boundingbox: [125, -80, 475, 629] }, '0' => { wx: 600, boundingbox: [106, -15, 494, 622] }, '1' => { wx: 600, boundingbox: [96, 0, 505, 622] }, '2' => { wx: 600, boundingbox: [70, 0, 471, 622] }, '3' => { wx: 600, boundingbox: [75, -15, 466, 622] }, '4' => { wx: 600, boundingbox: [78, 0, 500, 622] }, '5' => { wx: 600, boundingbox: [92, -15, 497, 607] }, '6' => { wx: 600, boundingbox: [111, -15, 497, 622] }, '7' => { wx: 600, boundingbox: [82, 0, 483, 607] }, '8' => { wx: 600, boundingbox: [102, -15, 498, 622] }, '9' => { wx: 600, boundingbox: [96, -15, 489, 622] }, ':' => { wx: 600, boundingbox: [229, -15, 371, 385] }, ';' => { wx: 600, boundingbox: [181, -112, 371, 385] }, '<' => { wx: 600, boundingbox: [41, 42, 519, 472] }, '=' => { wx: 600, boundingbox: [80, 138, 520, 376] }, '>' => { wx: 600, boundingbox: [66, 42, 544, 472] }, '?' => { wx: 600, boundingbox: [129, -15, 492, 572] }, '@' => { wx: 600, boundingbox: [77, -15, 533, 622] }, 'A' => { wx: 600, boundingbox: [3, 0, 597, 562] }, 'B' => { wx: 600, boundingbox: [43, 0, 559, 562] }, 'C' => { wx: 600, boundingbox: [41, -18, 540, 580] }, 'D' => { wx: 600, boundingbox: [43, 0, 574, 562] }, 'E' => { wx: 600, boundingbox: [53, 0, 550, 562] }, 'F' => { wx: 600, boundingbox: [53, 0, 545, 562] }, 'G' => { wx: 600, boundingbox: [31, -18, 575, 580] }, 'H' => { wx: 600, boundingbox: [32, 0, 568, 562] }, 'I' => { wx: 600, boundingbox: [96, 0, 504, 562] }, 'J' => { wx: 600, boundingbox: [34, -18, 566, 562] }, 'K' => { wx: 600, boundingbox: [38, 0, 582, 562] }, 'L' => { wx: 600, boundingbox: [47, 0, 554, 562] }, 'M' => { wx: 600, boundingbox: [4, 0, 596, 562] }, 'N' => { wx: 600, boundingbox: [7, -13, 593, 562] }, 'O' => { wx: 600, boundingbox: [43, -18, 557, 580] }, 'P' => { wx: 600, boundingbox: [79, 0, 558, 562] }, 'Q' => { wx: 600, boundingbox: [43, -138, 557, 580] }, 'R' => { wx: 600, boundingbox: [38, 0, 588, 562] }, 'S' => { wx: 600, boundingbox: [72, -20, 529, 580] }, 'T' => { wx: 600, boundingbox: [38, 0, 563, 562] }, 'U' => { wx: 600, boundingbox: [17, -18, 583, 562] }, 'V' => { wx: 600, boundingbox: [-4, -13, 604, 562] }, 'W' => { wx: 600, boundingbox: [-3, -13, 603, 562] }, 'X' => { wx: 600, boundingbox: [23, 0, 577, 562] }, 'Y' => { wx: 600, boundingbox: [24, 0, 576, 562] }, 'Z' => { wx: 600, boundingbox: [86, 0, 514, 562] }, '[' => { wx: 600, boundingbox: [269, -108, 442, 622] }, '\\' => { wx: 600, boundingbox: [118, -80, 482, 629] }, ']' => { wx: 600, boundingbox: [158, -108, 331, 622] }, '^' => { wx: 600, boundingbox: [94, 354, 506, 622] }, '_' => { wx: 600, boundingbox: [0, -125, 600, -75] }, '`' => { wx: 600, boundingbox: [224, 328, 387, 562] }, 'a' => { wx: 600, boundingbox: [53, -15, 559, 441] }, 'b' => { wx: 600, boundingbox: [14, -15, 575, 629] }, 'c' => { wx: 600, boundingbox: [66, -15, 529, 441] }, 'd' => { wx: 600, boundingbox: [45, -15, 591, 629] }, 'e' => { wx: 600, boundingbox: [66, -15, 548, 441] }, 'f' => { wx: 600, boundingbox: [114, 0, 531, 629] }, 'g' => { wx: 600, boundingbox: [45, -157, 566, 441] }, 'h' => { wx: 600, boundingbox: [18, 0, 582, 629] }, 'i' => { wx: 600, boundingbox: [95, 0, 505, 657] }, 'j' => { wx: 600, boundingbox: [82, -157, 410, 657] }, 'k' => { wx: 600, boundingbox: [43, 0, 580, 629] }, 'l' => { wx: 600, boundingbox: [95, 0, 505, 629] }, 'm' => { wx: 600, boundingbox: [-5, 0, 605, 441] }, 'n' => { wx: 600, boundingbox: [26, 0, 575, 441] }, 'o' => { wx: 600, boundingbox: [62, -15, 538, 441] }, 'p' => { wx: 600, boundingbox: [9, -157, 555, 441] }, 'q' => { wx: 600, boundingbox: [45, -157, 591, 441] }, 'r' => { wx: 600, boundingbox: [60, 0, 559, 441] }, 's' => { wx: 600, boundingbox: [80, -15, 513, 441] }, 't' => { wx: 600, boundingbox: [87, -15, 530, 561] }, 'u' => { wx: 600, boundingbox: [21, -15, 562, 426] }, 'v' => { wx: 600, boundingbox: [10, -10, 590, 426] }, 'w' => { wx: 600, boundingbox: [-4, -10, 604, 426] }, 'x' => { wx: 600, boundingbox: [20, 0, 580, 426] }, 'y' => { wx: 600, boundingbox: [7, -157, 592, 426] }, 'z' => { wx: 600, boundingbox: [99, 0, 502, 426] }, '{' => { wx: 600, boundingbox: [182, -108, 437, 622] }, '|' => { wx: 600, boundingbox: [275, -250, 326, 750] }, '}' => { wx: 600, boundingbox: [163, -108, 418, 622] }, '~' => { wx: 600, boundingbox: [63, 197, 540, 320] }, "\u00A1" => { wx: 600, boundingbox: [236, -157, 364, 430] }, "\u00A2" => { wx: 600, boundingbox: [96, -49, 500, 614] }, "\u00A3" => { wx: 600, boundingbox: [84, -21, 521, 611] }, "\u00A4" => { wx: 600, boundingbox: [92, -57, 509, 665] }, "\u00A5" => { wx: 600, boundingbox: [26, 0, 574, 562] }, "\u00A6" => { wx: 600, boundingbox: [4, -143, 539, 622] }, "\u00A7" => { wx: 600, boundingbox: [113, -78, 488, 580] }, "\u00A8" => { wx: 600, boundingbox: [73, 58, 527, 506] }, "\u00A9" => { wx: 600, boundingbox: [259, 328, 341, 562] }, "\u00AA" => { wx: 600, boundingbox: [143, 328, 471, 562] }, "\u00AB" => { wx: 600, boundingbox: [37, 70, 563, 446] }, "\u00AC" => { wx: 600, boundingbox: [149, 70, 451, 446] }, "\u00AD" => { wx: 600, boundingbox: [149, 70, 451, 446] }, "\u00AE" => { wx: 600, boundingbox: [3, 0, 597, 629] }, "\u00AF" => { wx: 600, boundingbox: [3, 0, 597, 629] }, "\u00B1" => { wx: 600, boundingbox: [75, 231, 525, 285] }, "\u00B2" => { wx: 600, boundingbox: [141, -78, 459, 580] }, "\u00B3" => { wx: 600, boundingbox: [141, -78, 459, 580] }, "\u00B4" => { wx: 600, boundingbox: [222, 189, 378, 327] }, "\u00B6" => { wx: 600, boundingbox: [50, -78, 511, 562] }, "\u00B7" => { wx: 600, boundingbox: [172, 130, 428, 383] }, "\u00B8" => { wx: 600, boundingbox: [213, -134, 376, 100] }, "\u00B9" => { wx: 600, boundingbox: [143, -134, 457, 100] }, "\u00BA" => { wx: 600, boundingbox: [143, 328, 457, 562] }, "\u00BB" => { wx: 600, boundingbox: [37, 70, 563, 446] }, "\u00BC" => { wx: 600, boundingbox: [37, -15, 563, 111] }, "\u00BD" => { wx: 600, boundingbox: [3, -15, 600, 622] }, "\u00BF" => { wx: 600, boundingbox: [108, -157, 471, 430] }, "\u00C1" => { wx: 600, boundingbox: [151, 497, 378, 672] }, "\u00C2" => { wx: 600, boundingbox: [242, 497, 469, 672] }, "\u00C3" => { wx: 600, boundingbox: [124, 477, 476, 654] }, "\u00C4" => { wx: 600, boundingbox: [105, 489, 503, 606] }, "\u00C5" => { wx: 600, boundingbox: [120, 525, 480, 565] }, "\u00C6" => { wx: 600, boundingbox: [153, 501, 447, 609] }, "\u00C7" => { wx: 600, boundingbox: [249, 537, 352, 640] }, "\u00C8" => { wx: 600, boundingbox: [148, 537, 453, 640] }, "\u00CA" => { wx: 600, boundingbox: [218, 463, 382, 627] }, "\u00CB" => { wx: 600, boundingbox: [224, -151, 362, 10] }, "\u00CD" => { wx: 600, boundingbox: [133, 497, 540, 672] }, "\u00CE" => { wx: 600, boundingbox: [211, -172, 407, 4] }, "\u00CF" => { wx: 600, boundingbox: [124, 492, 476, 669] }, "\u00D0" => { wx: 600, boundingbox: [0, 231, 600, 285] }, "\u00E1" => { wx: 600, boundingbox: [3, 0, 550, 562] }, "\u00E3" => { wx: 600, boundingbox: [156, 249, 442, 580] }, "\u00E8" => { wx: 600, boundingbox: [47, 0, 554, 562] }, "\u00E9" => { wx: 600, boundingbox: [43, -80, 557, 629] }, "\u00EA" => { wx: 600, boundingbox: [7, 0, 567, 562] }, "\u00EB" => { wx: 600, boundingbox: [157, 249, 443, 580] }, "\u00F1" => { wx: 600, boundingbox: [19, -15, 570, 441] }, "\u00F5" => { wx: 600, boundingbox: [95, 0, 505, 426] }, "\u00F8" => { wx: 600, boundingbox: [95, 0, 505, 629] }, "\u00F9" => { wx: 600, boundingbox: [62, -80, 538, 506] }, "\u00FA" => { wx: 600, boundingbox: [19, -15, 559, 441] }, "\u00FB" => { wx: 600, boundingbox: [48, -15, 588, 629] }, "\xFF" => { wx: 600, boundingbox: [0, 0, 0, 0] } }
|
169
|
+
courier_bold_metrics = { ' ' => { wx: 600, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 600, boundingbox: [202, -15, 398, 572] }, '"' => { wx: 600, boundingbox: [135, 277, 465, 562] }, '#' => { wx: 600, boundingbox: [56, -45, 544, 651] }, '$' => { wx: 600, boundingbox: [82, -126, 519, 666] }, '%' => { wx: 600, boundingbox: [5, -15, 595, 616] }, '&' => { wx: 600, boundingbox: [36, -15, 546, 543] }, "'" => { wx: 600, boundingbox: [171, 277, 423, 562] }, '(' => { wx: 600, boundingbox: [219, -102, 461, 616] }, ')' => { wx: 600, boundingbox: [139, -102, 381, 616] }, '*' => { wx: 600, boundingbox: [91, 219, 509, 601] }, '+' => { wx: 600, boundingbox: [71, 39, 529, 478] }, ',' => { wx: 600, boundingbox: [123, -111, 393, 174] }, '-' => { wx: 600, boundingbox: [100, 203, 500, 313] }, '.' => { wx: 600, boundingbox: [192, -15, 408, 171] }, '/' => { wx: 600, boundingbox: [98, -77, 502, 626] }, '0' => { wx: 600, boundingbox: [87, -15, 513, 616] }, '1' => { wx: 600, boundingbox: [81, 0, 539, 616] }, '2' => { wx: 600, boundingbox: [61, 0, 499, 616] }, '3' => { wx: 600, boundingbox: [63, -15, 501, 616] }, '4' => { wx: 600, boundingbox: [53, 0, 507, 616] }, '5' => { wx: 600, boundingbox: [70, -15, 521, 601] }, '6' => { wx: 600, boundingbox: [90, -15, 521, 616] }, '7' => { wx: 600, boundingbox: [55, 0, 494, 601] }, '8' => { wx: 600, boundingbox: [83, -15, 517, 616] }, '9' => { wx: 600, boundingbox: [79, -15, 510, 616] }, ':' => { wx: 600, boundingbox: [191, -15, 407, 425] }, ';' => { wx: 600, boundingbox: [123, -111, 408, 425] }, '<' => { wx: 600, boundingbox: [66, 15, 523, 501] }, '=' => { wx: 600, boundingbox: [71, 118, 529, 398] }, '>' => { wx: 600, boundingbox: [77, 15, 534, 501] }, '?' => { wx: 600, boundingbox: [98, -14, 501, 580] }, '@' => { wx: 600, boundingbox: [16, -15, 584, 616] }, 'A' => { wx: 600, boundingbox: [-9, 0, 609, 562] }, 'B' => { wx: 600, boundingbox: [30, 0, 573, 562] }, 'C' => { wx: 600, boundingbox: [22, -18, 560, 580] }, 'D' => { wx: 600, boundingbox: [30, 0, 594, 562] }, 'E' => { wx: 600, boundingbox: [25, 0, 560, 562] }, 'F' => { wx: 600, boundingbox: [39, 0, 570, 562] }, 'G' => { wx: 600, boundingbox: [22, -18, 594, 580] }, 'H' => { wx: 600, boundingbox: [20, 0, 580, 562] }, 'I' => { wx: 600, boundingbox: [77, 0, 523, 562] }, 'J' => { wx: 600, boundingbox: [37, -18, 601, 562] }, 'K' => { wx: 600, boundingbox: [21, 0, 599, 562] }, 'L' => { wx: 600, boundingbox: [39, 0, 578, 562] }, 'M' => { wx: 600, boundingbox: [-2, 0, 602, 562] }, 'N' => { wx: 600, boundingbox: [8, -12, 610, 562] }, 'O' => { wx: 600, boundingbox: [22, -18, 578, 580] }, 'P' => { wx: 600, boundingbox: [48, 0, 559, 562] }, 'Q' => { wx: 600, boundingbox: [32, -138, 578, 580] }, 'R' => { wx: 600, boundingbox: [24, 0, 599, 562] }, 'S' => { wx: 600, boundingbox: [47, -22, 553, 582] }, 'T' => { wx: 600, boundingbox: [21, 0, 579, 562] }, 'U' => { wx: 600, boundingbox: [4, -18, 596, 562] }, 'V' => { wx: 600, boundingbox: [-13, 0, 613, 562] }, 'W' => { wx: 600, boundingbox: [-18, 0, 618, 562] }, 'X' => { wx: 600, boundingbox: [12, 0, 588, 562] }, 'Y' => { wx: 600, boundingbox: [12, 0, 589, 562] }, 'Z' => { wx: 600, boundingbox: [62, 0, 539, 562] }, '[' => { wx: 600, boundingbox: [245, -102, 475, 616] }, '\\' => { wx: 600, boundingbox: [99, -77, 503, 626] }, ']' => { wx: 600, boundingbox: [125, -102, 355, 616] }, '^' => { wx: 600, boundingbox: [108, 250, 492, 616] }, '_' => { wx: 600, boundingbox: [0, -125, 600, -75] }, '`' => { wx: 600, boundingbox: [178, 277, 428, 562] }, 'a' => { wx: 600, boundingbox: [35, -15, 570, 454] }, 'b' => { wx: 600, boundingbox: [0, -15, 584, 626] }, 'c' => { wx: 600, boundingbox: [40, -15, 545, 459] }, 'd' => { wx: 600, boundingbox: [20, -15, 591, 626] }, 'e' => { wx: 600, boundingbox: [40, -15, 563, 454] }, 'f' => { wx: 600, boundingbox: [83, 0, 547, 626] }, 'g' => { wx: 600, boundingbox: [30, -146, 580, 454] }, 'h' => { wx: 600, boundingbox: [5, 0, 592, 626] }, 'i' => { wx: 600, boundingbox: [77, 0, 523, 658] }, 'j' => { wx: 600, boundingbox: [63, -146, 440, 658] }, 'k' => { wx: 600, boundingbox: [20, 0, 585, 626] }, 'l' => { wx: 600, boundingbox: [77, 0, 523, 626] }, 'm' => { wx: 600, boundingbox: [-22, 0, 626, 454] }, 'n' => { wx: 600, boundingbox: [18, 0, 592, 454] }, 'o' => { wx: 600, boundingbox: [30, -15, 570, 454] }, 'p' => { wx: 600, boundingbox: [-1, -142, 570, 454] }, 'q' => { wx: 600, boundingbox: [20, -142, 591, 454] }, 'r' => { wx: 600, boundingbox: [47, 0, 580, 454] }, 's' => { wx: 600, boundingbox: [68, -17, 535, 459] }, 't' => { wx: 600, boundingbox: [47, -15, 532, 562] }, 'u' => { wx: 600, boundingbox: [-1, -15, 569, 439] }, 'v' => { wx: 600, boundingbox: [-1, 0, 601, 439] }, 'w' => { wx: 600, boundingbox: [-18, 0, 618, 439] }, 'x' => { wx: 600, boundingbox: [6, 0, 594, 439] }, 'y' => { wx: 600, boundingbox: [-4, -142, 601, 439] }, 'z' => { wx: 600, boundingbox: [81, 0, 520, 439] }, '{' => { wx: 600, boundingbox: [160, -102, 464, 616] }, '|' => { wx: 600, boundingbox: [255, -250, 345, 750] }, '}' => { wx: 600, boundingbox: [136, -102, 440, 616] }, '~' => { wx: 600, boundingbox: [71, 153, 530, 356] }, "\u00A1" => { wx: 600, boundingbox: [202, -146, 398, 449] }, "\u00A2" => { wx: 600, boundingbox: [66, -49, 518, 614] }, "\u00A3" => { wx: 600, boundingbox: [72, -28, 558, 611] }, "\u00A4" => { wx: 600, boundingbox: [25, -60, 576, 661] }, "\u00A5" => { wx: 600, boundingbox: [10, 0, 590, 562] }, "\u00A6" => { wx: 600, boundingbox: [-30, -131, 572, 616] }, "\u00A7" => { wx: 600, boundingbox: [83, -70, 517, 580] }, "\u00A8" => { wx: 600, boundingbox: [54, 49, 546, 517] }, "\u00A9" => { wx: 600, boundingbox: [227, 277, 373, 562] }, "\u00AA" => { wx: 600, boundingbox: [71, 277, 535, 562] }, "\u00AB" => { wx: 600, boundingbox: [8, 70, 553, 446] }, "\u00AC" => { wx: 600, boundingbox: [141, 70, 459, 446] }, "\u00AD" => { wx: 600, boundingbox: [141, 70, 459, 446] }, "\u00AE" => { wx: 600, boundingbox: [12, 0, 593, 626] }, "\u00AF" => { wx: 600, boundingbox: [12, 0, 593, 626] }, "\u00B1" => { wx: 600, boundingbox: [65, 203, 535, 313] }, "\u00B2" => { wx: 600, boundingbox: [106, -70, 494, 580] }, "\u00B3" => { wx: 600, boundingbox: [106, -70, 494, 580] }, "\u00B4" => { wx: 600, boundingbox: [196, 165, 404, 351] }, "\u00B6" => { wx: 600, boundingbox: [6, -70, 576, 580] }, "\u00B7" => { wx: 600, boundingbox: [140, 132, 460, 430] }, "\u00B8" => { wx: 600, boundingbox: [175, -142, 427, 143] }, "\u00B9" => { wx: 600, boundingbox: [65, -142, 529, 143] }, "\u00BA" => { wx: 600, boundingbox: [61, 277, 525, 562] }, "\u00BB" => { wx: 600, boundingbox: [47, 70, 592, 446] }, "\u00BC" => { wx: 600, boundingbox: [26, -15, 574, 116] }, "\u00BD" => { wx: 600, boundingbox: [-113, -15, 713, 616] }, "\u00BF" => { wx: 600, boundingbox: [99, -146, 502, 449] }, "\u00C1" => { wx: 600, boundingbox: [132, 508, 395, 661] }, "\u00C2" => { wx: 600, boundingbox: [205, 508, 468, 661] }, "\u00C3" => { wx: 600, boundingbox: [103, 483, 497, 657] }, "\u00C4" => { wx: 600, boundingbox: [89, 493, 512, 636] }, "\u00C5" => { wx: 600, boundingbox: [88, 505, 512, 585] }, "\u00C6" => { wx: 600, boundingbox: [83, 468, 517, 631] }, "\u00C7" => { wx: 600, boundingbox: [230, 498, 370, 638] }, "\u00C8" => { wx: 600, boundingbox: [128, 498, 472, 638] }, "\u00CA" => { wx: 600, boundingbox: [198, 481, 402, 678] }, "\u00CB" => { wx: 600, boundingbox: [205, -206, 387, 0] }, "\u00CD" => { wx: 600, boundingbox: [68, 488, 588, 661] }, "\u00CE" => { wx: 600, boundingbox: [169, -199, 400, 0] }, "\u00CF" => { wx: 600, boundingbox: [103, 493, 497, 667] }, "\u00D0" => { wx: 600, boundingbox: [-10, 203, 610, 313] }, "\u00E1" => { wx: 600, boundingbox: [-29, 0, 602, 562] }, "\u00E3" => { wx: 600, boundingbox: [147, 196, 453, 580] }, "\u00E8" => { wx: 600, boundingbox: [39, 0, 578, 562] }, "\u00E9" => { wx: 600, boundingbox: [22, -22, 578, 584] }, "\u00EA" => { wx: 600, boundingbox: [-25, 0, 595, 562] }, "\u00EB" => { wx: 600, boundingbox: [147, 196, 453, 580] }, "\u00F1" => { wx: 600, boundingbox: [-4, -15, 601, 454] }, "\u00F5" => { wx: 600, boundingbox: [77, 0, 523, 439] }, "\u00F8" => { wx: 600, boundingbox: [77, 0, 523, 626] }, "\u00F9" => { wx: 600, boundingbox: [30, -24, 570, 463] }, "\u00FA" => { wx: 600, boundingbox: [-18, -15, 611, 454] }, "\u00FB" => { wx: 600, boundingbox: [22, -15, 596, 626] }, "\xFF" => { wx: 600, boundingbox: [0, 0, 0, 0] } }
|
170
|
+
courier_oblique_metrics = { ' ' => { wx: 600, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 600, boundingbox: [243, -15, 464, 572] }, '"' => { wx: 600, boundingbox: [273, 328, 532, 562] }, '#' => { wx: 600, boundingbox: [133, -32, 596, 639] }, '$' => { wx: 600, boundingbox: [108, -126, 596, 662] }, '%' => { wx: 600, boundingbox: [134, -15, 599, 622] }, '&' => { wx: 600, boundingbox: [87, -15, 580, 543] }, "'" => { wx: 600, boundingbox: [283, 328, 495, 562] }, '(' => { wx: 600, boundingbox: [313, -108, 572, 622] }, ')' => { wx: 600, boundingbox: [137, -108, 396, 622] }, '*' => { wx: 600, boundingbox: [212, 257, 580, 607] }, '+' => { wx: 600, boundingbox: [129, 44, 580, 470] }, ',' => { wx: 600, boundingbox: [157, -112, 370, 122] }, '-' => { wx: 600, boundingbox: [152, 231, 558, 285] }, '.' => { wx: 600, boundingbox: [238, -15, 382, 109] }, '/' => { wx: 600, boundingbox: [112, -80, 604, 629] }, '0' => { wx: 600, boundingbox: [154, -15, 575, 622] }, '1' => { wx: 600, boundingbox: [98, 0, 515, 622] }, '2' => { wx: 600, boundingbox: [70, 0, 568, 622] }, '3' => { wx: 600, boundingbox: [82, -15, 538, 622] }, '4' => { wx: 600, boundingbox: [108, 0, 541, 622] }, '5' => { wx: 600, boundingbox: [99, -15, 589, 607] }, '6' => { wx: 600, boundingbox: [155, -15, 629, 622] }, '7' => { wx: 600, boundingbox: [182, 0, 612, 607] }, '8' => { wx: 600, boundingbox: [132, -15, 588, 622] }, '9' => { wx: 600, boundingbox: [93, -15, 574, 622] }, ':' => { wx: 600, boundingbox: [238, -15, 441, 385] }, ';' => { wx: 600, boundingbox: [157, -112, 441, 385] }, '<' => { wx: 600, boundingbox: [96, 42, 610, 472] }, '=' => { wx: 600, boundingbox: [109, 138, 600, 376] }, '>' => { wx: 600, boundingbox: [85, 42, 599, 472] }, '?' => { wx: 600, boundingbox: [222, -15, 583, 572] }, '@' => { wx: 600, boundingbox: [127, -15, 582, 622] }, 'A' => { wx: 600, boundingbox: [3, 0, 607, 562] }, 'B' => { wx: 600, boundingbox: [43, 0, 616, 562] }, 'C' => { wx: 600, boundingbox: [93, -18, 655, 580] }, 'D' => { wx: 600, boundingbox: [43, 0, 645, 562] }, 'E' => { wx: 600, boundingbox: [53, 0, 660, 562] }, 'F' => { wx: 600, boundingbox: [53, 0, 660, 562] }, 'G' => { wx: 600, boundingbox: [83, -18, 645, 580] }, 'H' => { wx: 600, boundingbox: [32, 0, 687, 562] }, 'I' => { wx: 600, boundingbox: [96, 0, 623, 562] }, 'J' => { wx: 600, boundingbox: [52, -18, 685, 562] }, 'K' => { wx: 600, boundingbox: [38, 0, 671, 562] }, 'L' => { wx: 600, boundingbox: [47, 0, 607, 562] }, 'M' => { wx: 600, boundingbox: [4, 0, 715, 562] }, 'N' => { wx: 600, boundingbox: [7, -13, 712, 562] }, 'O' => { wx: 600, boundingbox: [94, -18, 625, 580] }, 'P' => { wx: 600, boundingbox: [79, 0, 644, 562] }, 'Q' => { wx: 600, boundingbox: [95, -138, 625, 580] }, 'R' => { wx: 600, boundingbox: [38, 0, 598, 562] }, 'S' => { wx: 600, boundingbox: [76, -20, 650, 580] }, 'T' => { wx: 600, boundingbox: [108, 0, 665, 562] }, 'U' => { wx: 600, boundingbox: [125, -18, 702, 562] }, 'V' => { wx: 600, boundingbox: [105, -13, 723, 562] }, 'W' => { wx: 600, boundingbox: [106, -13, 722, 562] }, 'X' => { wx: 600, boundingbox: [23, 0, 675, 562] }, 'Y' => { wx: 600, boundingbox: [133, 0, 695, 562] }, 'Z' => { wx: 600, boundingbox: [86, 0, 610, 562] }, '[' => { wx: 600, boundingbox: [246, -108, 574, 622] }, '\\' => { wx: 600, boundingbox: [249, -80, 468, 629] }, ']' => { wx: 600, boundingbox: [135, -108, 463, 622] }, '^' => { wx: 600, boundingbox: [175, 354, 587, 622] }, '_' => { wx: 600, boundingbox: [-27, -125, 584, -75] }, '`' => { wx: 600, boundingbox: [343, 328, 457, 562] }, 'a' => { wx: 600, boundingbox: [76, -15, 569, 441] }, 'b' => { wx: 600, boundingbox: [29, -15, 625, 629] }, 'c' => { wx: 600, boundingbox: [106, -15, 608, 441] }, 'd' => { wx: 600, boundingbox: [85, -15, 640, 629] }, 'e' => { wx: 600, boundingbox: [106, -15, 598, 441] }, 'f' => { wx: 600, boundingbox: [114, 0, 662, 629] }, 'g' => { wx: 600, boundingbox: [61, -157, 657, 441] }, 'h' => { wx: 600, boundingbox: [33, 0, 592, 629] }, 'i' => { wx: 600, boundingbox: [95, 0, 515, 657] }, 'j' => { wx: 600, boundingbox: [52, -157, 550, 657] }, 'k' => { wx: 600, boundingbox: [58, 0, 633, 629] }, 'l' => { wx: 600, boundingbox: [95, 0, 515, 629] }, 'm' => { wx: 600, boundingbox: [-5, 0, 615, 441] }, 'n' => { wx: 600, boundingbox: [26, 0, 585, 441] }, 'o' => { wx: 600, boundingbox: [102, -15, 588, 441] }, 'p' => { wx: 600, boundingbox: [-24, -157, 605, 441] }, 'q' => { wx: 600, boundingbox: [85, -157, 682, 441] }, 'r' => { wx: 600, boundingbox: [60, 0, 636, 441] }, 's' => { wx: 600, boundingbox: [78, -15, 584, 441] }, 't' => { wx: 600, boundingbox: [167, -15, 561, 561] }, 'u' => { wx: 600, boundingbox: [101, -15, 572, 426] }, 'v' => { wx: 600, boundingbox: [90, -10, 681, 426] }, 'w' => { wx: 600, boundingbox: [76, -10, 695, 426] }, 'x' => { wx: 600, boundingbox: [20, 0, 655, 426] }, 'y' => { wx: 600, boundingbox: [-4, -157, 683, 426] }, 'z' => { wx: 600, boundingbox: [99, 0, 593, 426] }, '{' => { wx: 600, boundingbox: [233, -108, 569, 622] }, '|' => { wx: 600, boundingbox: [222, -250, 485, 750] }, '}' => { wx: 600, boundingbox: [140, -108, 477, 622] }, '~' => { wx: 600, boundingbox: [116, 197, 600, 320] }, "\u00A1" => { wx: 600, boundingbox: [225, -157, 445, 430] }, "\u00A2" => { wx: 600, boundingbox: [151, -49, 588, 614] }, "\u00A3" => { wx: 600, boundingbox: [124, -21, 621, 611] }, "\u00A4" => { wx: 600, boundingbox: [84, -57, 646, 665] }, "\u00A5" => { wx: 600, boundingbox: [120, 0, 693, 562] }, "\u00A6" => { wx: 600, boundingbox: [-26, -143, 671, 622] }, "\u00A7" => { wx: 600, boundingbox: [104, -78, 590, 580] }, "\u00A8" => { wx: 600, boundingbox: [94, 58, 628, 506] }, "\u00A9" => { wx: 600, boundingbox: [345, 328, 460, 562] }, "\u00AA" => { wx: 600, boundingbox: [262, 328, 541, 562] }, "\u00AB" => { wx: 600, boundingbox: [92, 70, 652, 446] }, "\u00AC" => { wx: 600, boundingbox: [204, 70, 540, 446] }, "\u00AD" => { wx: 600, boundingbox: [170, 70, 506, 446] }, "\u00AE" => { wx: 600, boundingbox: [3, 0, 619, 629] }, "\u00AF" => { wx: 600, boundingbox: [3, 0, 619, 629] }, "\u00B1" => { wx: 600, boundingbox: [124, 231, 586, 285] }, "\u00B2" => { wx: 600, boundingbox: [217, -78, 546, 580] }, "\u00B3" => { wx: 600, boundingbox: [163, -78, 546, 580] }, "\u00B4" => { wx: 600, boundingbox: [275, 189, 434, 327] }, "\u00B6" => { wx: 600, boundingbox: [100, -78, 630, 562] }, "\u00B7" => { wx: 600, boundingbox: [224, 130, 485, 383] }, "\u00B8" => { wx: 600, boundingbox: [185, -134, 397, 100] }, "\u00B9" => { wx: 600, boundingbox: [115, -134, 478, 100] }, "\u00BA" => { wx: 600, boundingbox: [213, 328, 576, 562] }, "\u00BB" => { wx: 600, boundingbox: [58, 70, 618, 446] }, "\u00BC" => { wx: 600, boundingbox: [46, -15, 575, 111] }, "\u00BD" => { wx: 600, boundingbox: [59, -15, 627, 622] }, "\u00BF" => { wx: 600, boundingbox: [105, -157, 466, 430] }, "\u00C1" => { wx: 600, boundingbox: [294, 497, 484, 672] }, "\u00C2" => { wx: 600, boundingbox: [348, 497, 612, 672] }, "\u00C3" => { wx: 600, boundingbox: [229, 477, 581, 654] }, "\u00C4" => { wx: 600, boundingbox: [212, 489, 629, 606] }, "\u00C5" => { wx: 600, boundingbox: [232, 525, 600, 565] }, "\u00C6" => { wx: 600, boundingbox: [279, 501, 576, 609] }, "\u00C7" => { wx: 600, boundingbox: [373, 537, 478, 640] }, "\u00C8" => { wx: 600, boundingbox: [272, 537, 579, 640] }, "\u00CA" => { wx: 600, boundingbox: [332, 463, 500, 627] }, "\u00CB" => { wx: 600, boundingbox: [197, -151, 344, 10] }, "\u00CD" => { wx: 600, boundingbox: [239, 497, 683, 672] }, "\u00CE" => { wx: 600, boundingbox: [189, -172, 377, 4] }, "\u00CF" => { wx: 600, boundingbox: [262, 492, 614, 669] }, "\u00D0" => { wx: 600, boundingbox: [49, 231, 661, 285] }, "\u00E1" => { wx: 600, boundingbox: [3, 0, 655, 562] }, "\u00E3" => { wx: 600, boundingbox: [209, 249, 512, 580] }, "\u00E8" => { wx: 600, boundingbox: [47, 0, 607, 562] }, "\u00E9" => { wx: 600, boundingbox: [94, -80, 625, 629] }, "\u00EA" => { wx: 600, boundingbox: [59, 0, 672, 562] }, "\u00EB" => { wx: 600, boundingbox: [210, 249, 535, 580] }, "\u00F1" => { wx: 600, boundingbox: [41, -15, 626, 441] }, "\u00F5" => { wx: 600, boundingbox: [95, 0, 515, 426] }, "\u00F8" => { wx: 600, boundingbox: [95, 0, 587, 629] }, "\u00F9" => { wx: 600, boundingbox: [102, -80, 588, 506] }, "\u00FA" => { wx: 600, boundingbox: [54, -15, 615, 441] }, "\u00FB" => { wx: 600, boundingbox: [48, -15, 617, 629] }, "\xFF" => { wx: 600, boundingbox: [0, 0, 0, 0] } }
|
171
|
+
courier_boldoblique_metrics = { ' ' => { wx: 600, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 600, boundingbox: [215, -15, 495, 572] }, '"' => { wx: 600, boundingbox: [211, 277, 585, 562] }, '#' => { wx: 600, boundingbox: [88, -45, 641, 651] }, '$' => { wx: 600, boundingbox: [87, -126, 630, 666] }, '%' => { wx: 600, boundingbox: [101, -15, 625, 616] }, '&' => { wx: 600, boundingbox: [61, -15, 595, 543] }, "'" => { wx: 600, boundingbox: [229, 277, 543, 562] }, '(' => { wx: 600, boundingbox: [265, -102, 592, 616] }, ')' => { wx: 600, boundingbox: [117, -102, 444, 616] }, '*' => { wx: 600, boundingbox: [179, 219, 598, 601] }, '+' => { wx: 600, boundingbox: [114, 39, 596, 478] }, ',' => { wx: 600, boundingbox: [99, -111, 430, 174] }, '-' => { wx: 600, boundingbox: [143, 203, 567, 313] }, '.' => { wx: 600, boundingbox: [206, -15, 427, 171] }, '/' => { wx: 600, boundingbox: [90, -77, 626, 626] }, '0' => { wx: 600, boundingbox: [135, -15, 593, 616] }, '1' => { wx: 600, boundingbox: [93, 0, 562, 616] }, '2' => { wx: 600, boundingbox: [61, 0, 594, 616] }, '3' => { wx: 600, boundingbox: [71, -15, 571, 616] }, '4' => { wx: 600, boundingbox: [81, 0, 559, 616] }, '5' => { wx: 600, boundingbox: [77, -15, 621, 601] }, '6' => { wx: 600, boundingbox: [135, -15, 652, 616] }, '7' => { wx: 600, boundingbox: [147, 0, 622, 601] }, '8' => { wx: 600, boundingbox: [115, -15, 604, 616] }, '9' => { wx: 600, boundingbox: [75, -15, 592, 616] }, ':' => { wx: 600, boundingbox: [205, -15, 480, 425] }, ';' => { wx: 600, boundingbox: [99, -111, 481, 425] }, '<' => { wx: 600, boundingbox: [120, 15, 613, 501] }, '=' => { wx: 600, boundingbox: [96, 118, 614, 398] }, '>' => { wx: 600, boundingbox: [97, 15, 589, 501] }, '?' => { wx: 600, boundingbox: [183, -14, 592, 580] }, '@' => { wx: 600, boundingbox: [65, -15, 642, 616] }, 'A' => { wx: 600, boundingbox: [-9, 0, 632, 562] }, 'B' => { wx: 600, boundingbox: [30, 0, 630, 562] }, 'C' => { wx: 600, boundingbox: [74, -18, 675, 580] }, 'D' => { wx: 600, boundingbox: [30, 0, 664, 562] }, 'E' => { wx: 600, boundingbox: [25, 0, 670, 562] }, 'F' => { wx: 600, boundingbox: [39, 0, 684, 562] }, 'G' => { wx: 600, boundingbox: [74, -18, 675, 580] }, 'H' => { wx: 600, boundingbox: [20, 0, 700, 562] }, 'I' => { wx: 600, boundingbox: [77, 0, 643, 562] }, 'J' => { wx: 600, boundingbox: [58, -18, 721, 562] }, 'K' => { wx: 600, boundingbox: [21, 0, 692, 562] }, 'L' => { wx: 600, boundingbox: [39, 0, 636, 562] }, 'M' => { wx: 600, boundingbox: [-2, 0, 722, 562] }, 'N' => { wx: 600, boundingbox: [8, -12, 730, 562] }, 'O' => { wx: 600, boundingbox: [74, -18, 645, 580] }, 'P' => { wx: 600, boundingbox: [48, 0, 643, 562] }, 'Q' => { wx: 600, boundingbox: [83, -138, 636, 580] }, 'R' => { wx: 600, boundingbox: [24, 0, 617, 562] }, 'S' => { wx: 600, boundingbox: [54, -22, 673, 582] }, 'T' => { wx: 600, boundingbox: [86, 0, 679, 562] }, 'U' => { wx: 600, boundingbox: [101, -18, 716, 562] }, 'V' => { wx: 600, boundingbox: [84, 0, 733, 562] }, 'W' => { wx: 600, boundingbox: [79, 0, 738, 562] }, 'X' => { wx: 600, boundingbox: [12, 0, 690, 562] }, 'Y' => { wx: 600, boundingbox: [109, 0, 709, 562] }, 'Z' => { wx: 600, boundingbox: [62, 0, 637, 562] }, '[' => { wx: 600, boundingbox: [223, -102, 606, 616] }, '\\' => { wx: 600, boundingbox: [222, -77, 496, 626] }, ']' => { wx: 600, boundingbox: [103, -102, 486, 616] }, '^' => { wx: 600, boundingbox: [171, 250, 556, 616] }, '_' => { wx: 600, boundingbox: [-27, -125, 585, -75] }, '`' => { wx: 600, boundingbox: [297, 277, 487, 562] }, 'a' => { wx: 600, boundingbox: [61, -15, 593, 454] }, 'b' => { wx: 600, boundingbox: [13, -15, 636, 626] }, 'c' => { wx: 600, boundingbox: [81, -15, 631, 459] }, 'd' => { wx: 600, boundingbox: [60, -15, 645, 626] }, 'e' => { wx: 600, boundingbox: [81, -15, 605, 454] }, 'f' => { wx: 600, boundingbox: [83, 0, 677, 626] }, 'g' => { wx: 600, boundingbox: [40, -146, 674, 454] }, 'h' => { wx: 600, boundingbox: [18, 0, 615, 626] }, 'i' => { wx: 600, boundingbox: [77, 0, 546, 658] }, 'j' => { wx: 600, boundingbox: [36, -146, 580, 658] }, 'k' => { wx: 600, boundingbox: [33, 0, 643, 626] }, 'l' => { wx: 600, boundingbox: [77, 0, 546, 626] }, 'm' => { wx: 600, boundingbox: [-22, 0, 649, 454] }, 'n' => { wx: 600, boundingbox: [18, 0, 615, 454] }, 'o' => { wx: 600, boundingbox: [71, -15, 622, 454] }, 'p' => { wx: 600, boundingbox: [-32, -142, 622, 454] }, 'q' => { wx: 600, boundingbox: [60, -142, 685, 454] }, 'r' => { wx: 600, boundingbox: [47, 0, 655, 454] }, 's' => { wx: 600, boundingbox: [66, -17, 608, 459] }, 't' => { wx: 600, boundingbox: [118, -15, 567, 562] }, 'u' => { wx: 600, boundingbox: [70, -15, 592, 439] }, 'v' => { wx: 600, boundingbox: [70, 0, 695, 439] }, 'w' => { wx: 600, boundingbox: [53, 0, 712, 439] }, 'x' => { wx: 600, boundingbox: [6, 0, 671, 439] }, 'y' => { wx: 600, boundingbox: [-21, -142, 695, 439] }, 'z' => { wx: 600, boundingbox: [81, 0, 614, 439] }, '{' => { wx: 600, boundingbox: [203, -102, 595, 616] }, '|' => { wx: 600, boundingbox: [201, -250, 505, 750] }, '}' => { wx: 600, boundingbox: [114, -102, 506, 616] }, '~' => { wx: 600, boundingbox: [120, 153, 590, 356] }, "\u00A1" => { wx: 600, boundingbox: [196, -146, 477, 449] }, "\u00A2" => { wx: 600, boundingbox: [121, -49, 605, 614] }, "\u00A3" => { wx: 600, boundingbox: [106, -28, 650, 611] }, "\u00A4" => { wx: 600, boundingbox: [22, -60, 708, 661] }, "\u00A5" => { wx: 600, boundingbox: [98, 0, 710, 562] }, "\u00A6" => { wx: 600, boundingbox: [-57, -131, 702, 616] }, "\u00A7" => { wx: 600, boundingbox: [74, -70, 620, 580] }, "\u00A8" => { wx: 600, boundingbox: [77, 49, 644, 517] }, "\u00A9" => { wx: 600, boundingbox: [303, 277, 493, 562] }, "\u00AA" => { wx: 600, boundingbox: [190, 277, 594, 562] }, "\u00AB" => { wx: 600, boundingbox: [62, 70, 639, 446] }, "\u00AC" => { wx: 600, boundingbox: [195, 70, 545, 446] }, "\u00AD" => { wx: 600, boundingbox: [165, 70, 514, 446] }, "\u00AE" => { wx: 600, boundingbox: [12, 0, 644, 626] }, "\u00AF" => { wx: 600, boundingbox: [12, 0, 644, 626] }, "\u00B1" => { wx: 600, boundingbox: [108, 203, 602, 313] }, "\u00B2" => { wx: 600, boundingbox: [175, -70, 586, 580] }, "\u00B3" => { wx: 600, boundingbox: [121, -70, 587, 580] }, "\u00B4" => { wx: 600, boundingbox: [248, 165, 461, 351] }, "\u00B6" => { wx: 600, boundingbox: [61, -70, 700, 580] }, "\u00B7" => { wx: 600, boundingbox: [196, 132, 523, 430] }, "\u00B8" => { wx: 600, boundingbox: [144, -142, 458, 143] }, "\u00B9" => { wx: 600, boundingbox: [34, -142, 560, 143] }, "\u00BA" => { wx: 600, boundingbox: [119, 277, 645, 562] }, "\u00BB" => { wx: 600, boundingbox: [71, 70, 647, 446] }, "\u00BC" => { wx: 600, boundingbox: [35, -15, 587, 116] }, "\u00BD" => { wx: 600, boundingbox: [-45, -15, 743, 616] }, "\u00BF" => { wx: 600, boundingbox: [100, -146, 509, 449] }, "\u00C1" => { wx: 600, boundingbox: [272, 508, 503, 661] }, "\u00C2" => { wx: 600, boundingbox: [312, 508, 609, 661] }, "\u00C3" => { wx: 600, boundingbox: [212, 483, 607, 657] }, "\u00C4" => { wx: 600, boundingbox: [199, 493, 643, 636] }, "\u00C5" => { wx: 600, boundingbox: [195, 505, 637, 585] }, "\u00C6" => { wx: 600, boundingbox: [217, 468, 652, 631] }, "\u00C7" => { wx: 600, boundingbox: [348, 498, 493, 638] }, "\u00C8" => { wx: 600, boundingbox: [246, 498, 595, 638] }, "\u00CA" => { wx: 600, boundingbox: [319, 481, 528, 678] }, "\u00CB" => { wx: 600, boundingbox: [168, -206, 368, 0] }, "\u00CD" => { wx: 600, boundingbox: [171, 488, 729, 661] }, "\u00CE" => { wx: 600, boundingbox: [143, -199, 367, 0] }, "\u00CF" => { wx: 600, boundingbox: [238, 493, 633, 667] }, "\u00D0" => { wx: 600, boundingbox: [33, 203, 677, 313] }, "\u00E1" => { wx: 600, boundingbox: [-29, 0, 708, 562] }, "\u00E3" => { wx: 600, boundingbox: [188, 196, 526, 580] }, "\u00E8" => { wx: 600, boundingbox: [39, 0, 636, 562] }, "\u00E9" => { wx: 600, boundingbox: [48, -22, 673, 584] }, "\u00EA" => { wx: 600, boundingbox: [26, 0, 701, 562] }, "\u00EB" => { wx: 600, boundingbox: [188, 196, 543, 580] }, "\u00F1" => { wx: 600, boundingbox: [21, -15, 652, 454] }, "\u00F5" => { wx: 600, boundingbox: [77, 0, 546, 439] }, "\u00F8" => { wx: 600, boundingbox: [77, 0, 587, 626] }, "\u00F9" => { wx: 600, boundingbox: [54, -24, 638, 463] }, "\u00FA" => { wx: 600, boundingbox: [18, -15, 662, 454] }, "\u00FB" => { wx: 600, boundingbox: [22, -15, 629, 626] }, "\xFF" => { wx: 600, boundingbox: [0, 0, 0, 0] } }
|
172
|
+
symbol_metrics = { ' ' => { wx: 250, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 333, boundingbox: [128, -17, 240, 672] }, '"' => { wx: 713, boundingbox: [31, 0, 681, 705] }, '#' => { wx: 500, boundingbox: [20, -16, 481, 673] }, '$' => { wx: 549, boundingbox: [25, 0, 478, 707] }, '%' => { wx: 833, boundingbox: [63, -36, 771, 655] }, '&' => { wx: 778, boundingbox: [41, -18, 750, 661] }, "'" => { wx: 439, boundingbox: [48, -17, 414, 500] }, '(' => { wx: 333, boundingbox: [53, -191, 300, 673] }, ')' => { wx: 333, boundingbox: [30, -191, 277, 673] }, '*' => { wx: 500, boundingbox: [65, 134, 427, 551] }, '+' => { wx: 549, boundingbox: [10, 0, 539, 533] }, ',' => { wx: 250, boundingbox: [56, -152, 194, 104] }, '-' => { wx: 549, boundingbox: [11, 233, 535, 288] }, '.' => { wx: 250, boundingbox: [69, -17, 181, 95] }, '/' => { wx: 278, boundingbox: [0, -18, 254, 646] }, '0' => { wx: 500, boundingbox: [24, -14, 476, 685] }, '1' => { wx: 500, boundingbox: [117, 0, 390, 673] }, '2' => { wx: 500, boundingbox: [25, 0, 475, 685] }, '3' => { wx: 500, boundingbox: [43, -14, 435, 685] }, '4' => { wx: 500, boundingbox: [15, 0, 469, 685] }, '5' => { wx: 500, boundingbox: [32, -14, 445, 690] }, '6' => { wx: 500, boundingbox: [34, -14, 468, 685] }, '7' => { wx: 500, boundingbox: [24, -16, 448, 673] }, '8' => { wx: 500, boundingbox: [56, -14, 445, 685] }, '9' => { wx: 500, boundingbox: [30, -18, 459, 685] }, ':' => { wx: 278, boundingbox: [81, -17, 193, 460] }, ';' => { wx: 278, boundingbox: [83, -152, 221, 460] }, '<' => { wx: 549, boundingbox: [26, 0, 523, 522] }, '=' => { wx: 549, boundingbox: [11, 141, 537, 390] }, '>' => { wx: 549, boundingbox: [26, 0, 523, 522] }, '?' => { wx: 444, boundingbox: [70, -17, 412, 686] }, '@' => { wx: 549, boundingbox: [11, 0, 537, 475] }, 'A' => { wx: 722, boundingbox: [4, 0, 684, 673] }, 'B' => { wx: 667, boundingbox: [29, 0, 592, 673] }, 'C' => { wx: 722, boundingbox: [-9, 0, 704, 673] }, 'D' => { wx: 612, boundingbox: [6, 0, 608, 688] }, 'E' => { wx: 611, boundingbox: [32, 0, 617, 673] }, 'F' => { wx: 763, boundingbox: [26, 0, 741, 673] }, 'G' => { wx: 603, boundingbox: [24, 0, 609, 673] }, 'H' => { wx: 722, boundingbox: [39, 0, 729, 673] }, 'I' => { wx: 333, boundingbox: [32, 0, 316, 673] }, 'J' => { wx: 631, boundingbox: [18, -18, 623, 689] }, 'K' => { wx: 722, boundingbox: [35, 0, 722, 673] }, 'L' => { wx: 686, boundingbox: [6, 0, 680, 688] }, 'M' => { wx: 889, boundingbox: [28, 0, 887, 673] }, 'N' => { wx: 722, boundingbox: [29, -8, 720, 673] }, 'O' => { wx: 722, boundingbox: [41, -17, 715, 685] }, 'P' => { wx: 768, boundingbox: [25, 0, 745, 673] }, 'Q' => { wx: 741, boundingbox: [41, -17, 715, 685] }, 'R' => { wx: 556, boundingbox: [28, 0, 563, 673] }, 'S' => { wx: 592, boundingbox: [5, 0, 589, 673] }, 'T' => { wx: 611, boundingbox: [33, 0, 607, 673] }, 'U' => { wx: 690, boundingbox: [-8, 0, 694, 673] }, 'V' => { wx: 439, boundingbox: [40, -233, 436, 500] }, 'W' => { wx: 768, boundingbox: [34, 0, 736, 688] }, 'X' => { wx: 645, boundingbox: [40, 0, 599, 673] }, 'Y' => { wx: 795, boundingbox: [15, 0, 781, 684] }, 'Z' => { wx: 611, boundingbox: [44, 0, 636, 673] }, '[' => { wx: 333, boundingbox: [86, -155, 299, 674] }, '\\' => { wx: 863, boundingbox: [163, 0, 701, 487] }, ']' => { wx: 333, boundingbox: [33, -155, 246, 674] }, '^' => { wx: 658, boundingbox: [15, 0, 652, 674] }, '_' => { wx: 500, boundingbox: [-2, -125, 502, -75] }, '`' => { wx: 500, boundingbox: [480, 881, 1090, 917] }, 'a' => { wx: 631, boundingbox: [41, -18, 622, 500] }, 'b' => { wx: 549, boundingbox: [61, -223, 515, 741] }, 'c' => { wx: 549, boundingbox: [12, -231, 522, 499] }, 'd' => { wx: 494, boundingbox: [40, -19, 481, 740] }, 'e' => { wx: 439, boundingbox: [22, -19, 427, 502] }, 'f' => { wx: 521, boundingbox: [28, -224, 492, 673] }, 'g' => { wx: 411, boundingbox: [5, -225, 484, 499] }, 'h' => { wx: 603, boundingbox: [0, -202, 527, 514] }, 'i' => { wx: 329, boundingbox: [0, -17, 301, 503] }, 'j' => { wx: 603, boundingbox: [36, -224, 587, 499] }, 'k' => { wx: 549, boundingbox: [33, 0, 558, 501] }, 'l' => { wx: 549, boundingbox: [24, -17, 548, 739] }, 'm' => { wx: 576, boundingbox: [33, -223, 567, 500] }, 'n' => { wx: 521, boundingbox: [-9, -16, 475, 507] }, 'o' => { wx: 549, boundingbox: [35, -19, 501, 499] }, 'p' => { wx: 549, boundingbox: [10, -19, 530, 487] }, 'q' => { wx: 521, boundingbox: [43, -17, 485, 690] }, 'r' => { wx: 549, boundingbox: [50, -230, 490, 499] }, 's' => { wx: 603, boundingbox: [30, -21, 588, 500] }, 't' => { wx: 439, boundingbox: [10, -19, 418, 500] }, 'u' => { wx: 576, boundingbox: [7, -18, 535, 507] }, 'v' => { wx: 713, boundingbox: [12, -18, 671, 583] }, 'w' => { wx: 686, boundingbox: [42, -17, 684, 500] }, 'x' => { wx: 493, boundingbox: [27, -224, 469, 766] }, 'y' => { wx: 686, boundingbox: [12, -228, 701, 500] }, 'z' => { wx: 494, boundingbox: [60, -225, 467, 756] }, '{' => { wx: 480, boundingbox: [58, -183, 397, 673] }, '|' => { wx: 200, boundingbox: [65, -293, 135, 707] }, '}' => { wx: 480, boundingbox: [79, -183, 418, 673] }, '~' => { wx: 549, boundingbox: [17, 203, 529, 307] }, "\u00A0" => { wx: 750, boundingbox: [20, -12, 714, 685] }, "\u00A1" => { wx: 620, boundingbox: [-2, 0, 610, 685] }, "\u00A2" => { wx: 247, boundingbox: [27, 459, 228, 735] }, "\u00A3" => { wx: 549, boundingbox: [29, 0, 526, 639] }, "\u00A4" => { wx: 167, boundingbox: [-180, -12, 340, 677] }, "\u00A5" => { wx: 713, boundingbox: [26, 124, 688, 404] }, "\u00A6" => { wx: 500, boundingbox: [2, -193, 494, 686] }, "\u00A7" => { wx: 753, boundingbox: [86, -26, 660, 533] }, "\u00A8" => { wx: 753, boundingbox: [142, -36, 600, 550] }, "\u00A9" => { wx: 753, boundingbox: [117, -33, 631, 532] }, "\u00AA" => { wx: 753, boundingbox: [113, -36, 629, 548] }, "\u00AB" => { wx: 1042, boundingbox: [24, -15, 1024, 511] }, "\u00AC" => { wx: 987, boundingbox: [32, -15, 942, 511] }, "\u00AD" => { wx: 603, boundingbox: [45, 0, 571, 910] }, "\u00AE" => { wx: 987, boundingbox: [49, -15, 959, 511] }, "\u00AF" => { wx: 603, boundingbox: [45, -22, 571, 888] }, "\u00B0" => { wx: 400, boundingbox: [50, 385, 350, 685] }, "\u00B1" => { wx: 549, boundingbox: [10, 0, 539, 645] }, "\u00B2" => { wx: 411, boundingbox: [20, 459, 413, 737] }, "\u00B3" => { wx: 549, boundingbox: [29, 0, 526, 639] }, "\u00B4" => { wx: 549, boundingbox: [17, 8, 533, 524] }, "\u00B5" => { wx: 713, boundingbox: [27, 123, 639, 404] }, "\u00B6" => { wx: 494, boundingbox: [26, -20, 462, 746] }, "\u00B7" => { wx: 460, boundingbox: [50, 113, 410, 473] }, "\u00B8" => { wx: 549, boundingbox: [10, 71, 536, 456] }, "\u00B9" => { wx: 549, boundingbox: [15, -25, 540, 549] }, "\u00BA" => { wx: 549, boundingbox: [14, 82, 538, 443] }, "\u00BB" => { wx: 549, boundingbox: [14, 135, 527, 394] }, "\u00BC" => { wx: 1000, boundingbox: [111, -17, 889, 95] }, "\u00BD" => { wx: 603, boundingbox: [280, -120, 336, 1010] }, "\u00BE" => { wx: 1000, boundingbox: [-60, 220, 1050, 276] }, "\u00BF" => { wx: 658, boundingbox: [15, -16, 602, 629] }, "\u00C0" => { wx: 823, boundingbox: [175, -18, 661, 658] }, "\u00C1" => { wx: 686, boundingbox: [10, -53, 578, 740] }, "\u00C2" => { wx: 795, boundingbox: [26, -15, 759, 734] }, "\u00C3" => { wx: 987, boundingbox: [159, -211, 870, 573] }, "\u00C4" => { wx: 768, boundingbox: [43, -17, 733, 673] }, "\u00C5" => { wx: 768, boundingbox: [43, -15, 733, 675] }, "\u00C6" => { wx: 823, boundingbox: [39, -24, 781, 719] }, "\u00C7" => { wx: 768, boundingbox: [40, 0, 732, 509] }, "\u00C8" => { wx: 768, boundingbox: [40, -17, 732, 492] }, "\u00C9" => { wx: 713, boundingbox: [20, 0, 673, 470] }, "\u00CA" => { wx: 713, boundingbox: [20, -125, 673, 470] }, "\u00CB" => { wx: 713, boundingbox: [36, -70, 690, 540] }, "\u00CC" => { wx: 713, boundingbox: [37, 0, 690, 470] }, "\u00CD" => { wx: 713, boundingbox: [37, -125, 690, 470] }, "\u00CE" => { wx: 713, boundingbox: [45, 0, 505, 468] }, "\u00CF" => { wx: 713, boundingbox: [45, -58, 505, 555] }, "\u00D0" => { wx: 768, boundingbox: [26, 0, 738, 673] }, "\u00D1" => { wx: 713, boundingbox: [36, -19, 681, 718] }, "\u00D2" => { wx: 790, boundingbox: [50, -17, 740, 673] }, "\u00D3" => { wx: 790, boundingbox: [51, -15, 741, 675] }, "\u00D4" => { wx: 890, boundingbox: [18, 293, 855, 673] }, "\u00D5" => { wx: 823, boundingbox: [25, -101, 803, 751] }, "\u00D6" => { wx: 549, boundingbox: [10, -38, 515, 917] }, "\u00D7" => { wx: 250, boundingbox: [69, 210, 169, 310] }, "\u00D8" => { wx: 713, boundingbox: [15, 0, 680, 288] }, "\u00D9" => { wx: 603, boundingbox: [23, 0, 583, 454] }, "\u00DA" => { wx: 603, boundingbox: [30, 0, 578, 477] }, "\u00DB" => { wx: 1042, boundingbox: [27, -20, 1023, 510] }, "\u00DC" => { wx: 987, boundingbox: [30, -15, 939, 513] }, "\u00DD" => { wx: 603, boundingbox: [39, 2, 567, 911] }, "\u00DE" => { wx: 987, boundingbox: [45, -20, 954, 508] }, "\u00DF" => { wx: 603, boundingbox: [44, -19, 572, 890] }, "\u00E0" => { wx: 494, boundingbox: [18, 0, 466, 745] }, "\u00E1" => { wx: 329, boundingbox: [25, -198, 306, 746] }, "\u00E2" => { wx: 790, boundingbox: [50, -20, 740, 670] }, "\u00E3" => { wx: 790, boundingbox: [49, -15, 739, 675] }, "\u00E4" => { wx: 786, boundingbox: [5, 293, 725, 673] }, "\u00E5" => { wx: 713, boundingbox: [14, -108, 695, 752] }, "\u00E6" => { wx: 384, boundingbox: [24, -293, 436, 926] }, "\u00E7" => { wx: 384, boundingbox: [24, -85, 108, 925] }, "\u00E8" => { wx: 384, boundingbox: [24, -293, 436, 926] }, "\u00E9" => { wx: 384, boundingbox: [0, -80, 349, 926] }, "\u00EA" => { wx: 384, boundingbox: [0, -79, 77, 925] }, "\u00EB" => { wx: 384, boundingbox: [0, -80, 349, 926] }, "\u00EC" => { wx: 494, boundingbox: [209, -85, 445, 925] }, "\u00ED" => { wx: 494, boundingbox: [20, -85, 284, 935] }, "\u00EE" => { wx: 494, boundingbox: [209, -75, 445, 935] }, "\u00EF" => { wx: 494, boundingbox: [209, -85, 284, 935] }, "\u00F1" => { wx: 329, boundingbox: [21, -198, 302, 746] }, "\u00F2" => { wx: 274, boundingbox: [2, -107, 291, 916] }, "\u00F3" => { wx: 686, boundingbox: [308, -88, 675, 920] }, "\u00F4" => { wx: 686, boundingbox: [308, -88, 378, 975] }, "\u00F5" => { wx: 686, boundingbox: [11, -87, 378, 921] }, "\u00F6" => { wx: 384, boundingbox: [54, -293, 466, 926] }, "\u00F7" => { wx: 384, boundingbox: [382, -85, 466, 925] }, "\u00F8" => { wx: 384, boundingbox: [54, -293, 466, 926] }, "\u00F9" => { wx: 384, boundingbox: [22, -80, 371, 926] }, "\u00FA" => { wx: 384, boundingbox: [294, -79, 371, 925] }, "\u00FB" => { wx: 384, boundingbox: [22, -80, 371, 926] }, "\u00FC" => { wx: 494, boundingbox: [48, -85, 284, 925] }, "\u00FD" => { wx: 494, boundingbox: [209, -85, 473, 935] }, "\u00FE" => { wx: 494, boundingbox: [48, -75, 284, 935] }, "\xFF" => { wx: 790, boundingbox: [56, -3, 733, 808] } }
|
173
|
+
zapfdingbats_metrics = { ' ' => { wx: 278, boundingbox: [0, 0, 0, 0] }, '!' => { wx: 974, boundingbox: [35, 72, 939, 621] }, '"' => { wx: 961, boundingbox: [35, 81, 927, 611] }, '#' => { wx: 974, boundingbox: [35, 72, 939, 621] }, '$' => { wx: 980, boundingbox: [35, 0, 945, 692] }, '%' => { wx: 719, boundingbox: [34, 139, 685, 566] }, '&' => { wx: 789, boundingbox: [35, -14, 755, 705] }, "'" => { wx: 790, boundingbox: [35, -14, 755, 705] }, '(' => { wx: 791, boundingbox: [35, -13, 761, 705] }, ')' => { wx: 690, boundingbox: [34, 138, 655, 553] }, '*' => { wx: 960, boundingbox: [35, 123, 925, 568] }, '+' => { wx: 939, boundingbox: [35, 134, 904, 559] }, ',' => { wx: 549, boundingbox: [29, -11, 516, 705] }, '-' => { wx: 855, boundingbox: [34, 59, 820, 632] }, '.' => { wx: 911, boundingbox: [35, 50, 876, 642] }, '/' => { wx: 933, boundingbox: [35, 139, 899, 550] }, '0' => { wx: 911, boundingbox: [35, 50, 876, 642] }, '1' => { wx: 945, boundingbox: [35, 139, 909, 553] }, '2' => { wx: 974, boundingbox: [35, 104, 938, 587] }, '3' => { wx: 755, boundingbox: [34, -13, 721, 705] }, '4' => { wx: 846, boundingbox: [36, -14, 811, 705] }, '5' => { wx: 762, boundingbox: [35, 0, 727, 692] }, '6' => { wx: 761, boundingbox: [35, 0, 727, 692] }, '7' => { wx: 571, boundingbox: [-1, -68, 571, 661] }, '8' => { wx: 677, boundingbox: [36, -13, 642, 705] }, '9' => { wx: 763, boundingbox: [35, 0, 728, 692] }, ':' => { wx: 760, boundingbox: [35, 0, 726, 692] }, ';' => { wx: 759, boundingbox: [35, 0, 725, 692] }, '<' => { wx: 754, boundingbox: [35, 0, 720, 692] }, '=' => { wx: 494, boundingbox: [35, 0, 460, 692] }, '>' => { wx: 552, boundingbox: [35, 0, 517, 692] }, '?' => { wx: 537, boundingbox: [35, 0, 503, 692] }, '@' => { wx: 577, boundingbox: [35, 96, 542, 596] }, 'A' => { wx: 692, boundingbox: [35, -14, 657, 705] }, 'B' => { wx: 786, boundingbox: [35, -14, 751, 705] }, 'C' => { wx: 788, boundingbox: [35, -14, 752, 705] }, 'D' => { wx: 788, boundingbox: [35, -14, 753, 705] }, 'E' => { wx: 790, boundingbox: [35, -14, 756, 705] }, 'F' => { wx: 793, boundingbox: [35, -13, 759, 705] }, 'G' => { wx: 794, boundingbox: [35, -13, 759, 705] }, 'H' => { wx: 816, boundingbox: [35, -14, 782, 705] }, 'I' => { wx: 823, boundingbox: [35, -14, 787, 705] }, 'J' => { wx: 789, boundingbox: [35, -14, 754, 705] }, 'K' => { wx: 841, boundingbox: [35, -14, 807, 705] }, 'L' => { wx: 823, boundingbox: [35, -14, 789, 705] }, 'M' => { wx: 833, boundingbox: [35, -14, 798, 705] }, 'N' => { wx: 816, boundingbox: [35, -13, 782, 705] }, 'O' => { wx: 831, boundingbox: [35, -14, 796, 705] }, 'P' => { wx: 923, boundingbox: [35, -14, 888, 705] }, 'Q' => { wx: 744, boundingbox: [35, 0, 710, 692] }, 'R' => { wx: 723, boundingbox: [35, 0, 688, 692] }, 'S' => { wx: 749, boundingbox: [35, 0, 714, 692] }, 'T' => { wx: 790, boundingbox: [34, -14, 756, 705] }, 'U' => { wx: 792, boundingbox: [35, -14, 758, 705] }, 'V' => { wx: 695, boundingbox: [35, -14, 661, 706] }, 'W' => { wx: 776, boundingbox: [35, -6, 741, 699] }, 'X' => { wx: 768, boundingbox: [35, -7, 734, 699] }, 'Y' => { wx: 792, boundingbox: [35, -14, 757, 705] }, 'Z' => { wx: 759, boundingbox: [35, 0, 725, 692] }, '[' => { wx: 707, boundingbox: [35, -13, 672, 704] }, '\\' => { wx: 708, boundingbox: [35, -14, 672, 705] }, ']' => { wx: 682, boundingbox: [35, -14, 647, 705] }, '^' => { wx: 701, boundingbox: [35, -14, 666, 705] }, '_' => { wx: 826, boundingbox: [35, -14, 791, 705] }, '`' => { wx: 815, boundingbox: [35, -14, 780, 705] }, 'a' => { wx: 789, boundingbox: [35, -14, 754, 705] }, 'b' => { wx: 789, boundingbox: [35, -14, 754, 705] }, 'c' => { wx: 707, boundingbox: [34, -14, 673, 705] }, 'd' => { wx: 687, boundingbox: [36, 0, 651, 692] }, 'e' => { wx: 696, boundingbox: [35, 0, 661, 691] }, 'f' => { wx: 689, boundingbox: [35, 0, 655, 692] }, 'g' => { wx: 786, boundingbox: [34, -14, 751, 705] }, 'h' => { wx: 787, boundingbox: [35, -14, 752, 705] }, 'i' => { wx: 713, boundingbox: [35, -14, 678, 705] }, 'j' => { wx: 791, boundingbox: [35, -14, 756, 705] }, 'k' => { wx: 785, boundingbox: [36, -14, 751, 705] }, 'l' => { wx: 791, boundingbox: [35, -14, 757, 705] }, 'm' => { wx: 873, boundingbox: [35, -14, 838, 705] }, 'n' => { wx: 761, boundingbox: [35, 0, 726, 692] }, 'o' => { wx: 762, boundingbox: [35, 0, 727, 692] }, 'p' => { wx: 762, boundingbox: [35, 0, 727, 692] }, 'q' => { wx: 759, boundingbox: [35, 0, 725, 692] }, 'r' => { wx: 759, boundingbox: [35, 0, 725, 692] }, 's' => { wx: 892, boundingbox: [35, 0, 858, 705] }, 't' => { wx: 892, boundingbox: [35, -14, 858, 692] }, 'u' => { wx: 788, boundingbox: [35, -14, 754, 705] }, 'v' => { wx: 784, boundingbox: [35, -14, 749, 705] }, 'w' => { wx: 438, boundingbox: [35, -14, 403, 705] }, 'x' => { wx: 138, boundingbox: [35, 0, 104, 692] }, 'y' => { wx: 277, boundingbox: [35, 0, 242, 692] }, 'z' => { wx: 415, boundingbox: [35, 0, 380, 692] }, '{' => { wx: 392, boundingbox: [35, 263, 357, 705] }, '|' => { wx: 392, boundingbox: [34, 263, 357, 705] }, '}' => { wx: 668, boundingbox: [35, 263, 633, 705] }, '~' => { wx: 668, boundingbox: [36, 263, 634, 705] }, "\u0080" => { wx: 390, boundingbox: [35, -14, 356, 705] }, "\u0081" => { wx: 390, boundingbox: [35, -14, 355, 705] }, "\u0082" => { wx: 317, boundingbox: [35, 0, 283, 692] }, "\u0083" => { wx: 317, boundingbox: [35, 0, 283, 692] }, "\u0084" => { wx: 276, boundingbox: [35, 0, 242, 692] }, "\u0085" => { wx: 276, boundingbox: [35, 0, 242, 692] }, "\u0086" => { wx: 509, boundingbox: [35, 0, 475, 692] }, "\u0087" => { wx: 509, boundingbox: [35, 0, 475, 692] }, "\u0088" => { wx: 410, boundingbox: [35, 0, 375, 692] }, "\u0089" => { wx: 410, boundingbox: [35, 0, 375, 692] }, "\u008A" => { wx: 234, boundingbox: [35, -14, 199, 705] }, "\u008B" => { wx: 234, boundingbox: [35, -14, 199, 705] }, "\u008C" => { wx: 334, boundingbox: [35, 0, 299, 692] }, "\u008D" => { wx: 334, boundingbox: [35, 0, 299, 692] }, "\u00A1" => { wx: 732, boundingbox: [35, -143, 697, 806] }, "\u00A2" => { wx: 544, boundingbox: [56, -14, 488, 706] }, "\u00A3" => { wx: 544, boundingbox: [34, -14, 508, 705] }, "\u00A4" => { wx: 910, boundingbox: [35, 40, 875, 651] }, "\u00A5" => { wx: 667, boundingbox: [35, -14, 633, 705] }, "\u00A6" => { wx: 760, boundingbox: [35, -14, 726, 705] }, "\u00A7" => { wx: 760, boundingbox: [0, 121, 758, 569] }, "\u00A8" => { wx: 776, boundingbox: [35, 0, 741, 705] }, "\u00A9" => { wx: 595, boundingbox: [34, -14, 560, 705] }, "\u00AA" => { wx: 694, boundingbox: [35, -14, 659, 705] }, "\u00AB" => { wx: 626, boundingbox: [34, 0, 591, 705] }, "\u00AC" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00AD" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00AE" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00AF" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B0" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B1" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B2" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B3" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B4" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B5" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B6" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B7" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B8" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00B9" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00BA" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00BB" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00BC" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00BD" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00BE" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00BF" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C0" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C1" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C2" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C3" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C4" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C5" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C6" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C7" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C8" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00C9" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00CA" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00CB" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00CC" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00CD" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00CE" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00CF" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00D0" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00D1" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00D2" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00D3" => { wx: 788, boundingbox: [35, -14, 754, 705] }, "\u00D4" => { wx: 894, boundingbox: [35, 58, 860, 634] }, "\u00D5" => { wx: 838, boundingbox: [35, 152, 803, 540] }, "\u00D6" => { wx: 1016, boundingbox: [34, 152, 981, 540] }, "\u00D7" => { wx: 458, boundingbox: [35, -127, 422, 820] }, "\u00D8" => { wx: 748, boundingbox: [35, 94, 698, 597] }, "\u00D9" => { wx: 924, boundingbox: [35, 140, 890, 552] }, "\u00DA" => { wx: 748, boundingbox: [35, 94, 698, 597] }, "\u00DB" => { wx: 918, boundingbox: [35, 166, 884, 526] }, "\u00DC" => { wx: 927, boundingbox: [35, 32, 892, 660] }, "\u00DD" => { wx: 928, boundingbox: [35, 129, 891, 562] }, "\u00DE" => { wx: 928, boundingbox: [35, 128, 893, 563] }, "\u00DF" => { wx: 834, boundingbox: [35, 155, 799, 537] }, "\u00E0" => { wx: 873, boundingbox: [35, 93, 838, 599] }, "\u00E1" => { wx: 828, boundingbox: [35, 104, 791, 588] }, "\u00E2" => { wx: 924, boundingbox: [35, 98, 889, 594] }, "\u00E3" => { wx: 924, boundingbox: [35, 98, 889, 594] }, "\u00E4" => { wx: 917, boundingbox: [35, 0, 882, 692] }, "\u00E5" => { wx: 930, boundingbox: [35, 84, 896, 608] }, "\u00E6" => { wx: 931, boundingbox: [35, 84, 896, 608] }, "\u00E7" => { wx: 463, boundingbox: [35, -99, 429, 791] }, "\u00E8" => { wx: 883, boundingbox: [35, 71, 848, 623] }, "\u00E9" => { wx: 836, boundingbox: [35, 44, 802, 648] }, "\u00EA" => { wx: 836, boundingbox: [35, 44, 802, 648] }, "\u00EB" => { wx: 867, boundingbox: [35, 101, 832, 591] }, "\u00EC" => { wx: 867, boundingbox: [35, 101, 832, 591] }, "\u00ED" => { wx: 696, boundingbox: [35, 44, 661, 648] }, "\u00EE" => { wx: 696, boundingbox: [35, 44, 661, 648] }, "\u00EF" => { wx: 874, boundingbox: [35, 77, 840, 619] }, "\u00F1" => { wx: 874, boundingbox: [35, 73, 840, 615] }, "\u00F2" => { wx: 760, boundingbox: [35, 0, 725, 692] }, "\u00F3" => { wx: 946, boundingbox: [35, 160, 911, 533] }, "\u00F4" => { wx: 771, boundingbox: [34, 37, 736, 655] }, "\u00F5" => { wx: 865, boundingbox: [35, 207, 830, 481] }, "\u00F6" => { wx: 771, boundingbox: [34, 37, 736, 655] }, "\u00F7" => { wx: 888, boundingbox: [34, -19, 853, 712] }, "\u00F8" => { wx: 967, boundingbox: [35, 124, 932, 568] }, "\u00F9" => { wx: 888, boundingbox: [34, -19, 853, 712] }, "\u00FA" => { wx: 831, boundingbox: [35, 113, 796, 579] }, "\u00FB" => { wx: 873, boundingbox: [36, 118, 838, 578] }, "\u00FC" => { wx: 927, boundingbox: [35, 150, 891, 542] }, "\u00FD" => { wx: 970, boundingbox: [35, 76, 931, 616] }, "\u00FE" => { wx: 918, boundingbox: [34, 99, 884, 593] } }
|
174
|
+
# make two correlating arrays (indexes reffer to the same data), one for font names and the other for the fonts matrics.
|
175
|
+
fonts_metrics_array = [times_metrics, times_bold_metrics, times_italic_metrics, times_bolditalic_metrics,
|
176
|
+
helvetica_metrics, helvetica_bold_metrics, helvetica_oblique_metrics, helvetica_oblique_metrics,
|
177
|
+
courier_metrics, courier_bold_metrics, courier_oblique_metrics, courier_boldoblique_metrics,
|
178
|
+
symbol_metrics, zapfdingbats_metrics]
|
179
|
+
fonts_names_array = [:"Times-Roman",
|
180
|
+
:"Times-Bold",
|
181
|
+
:"Times-Italic",
|
182
|
+
:"Times-BoldItalic",
|
183
|
+
:Helvetica,
|
184
|
+
:"Helvetica-Bold",
|
185
|
+
:"Helvetica-BoldOblique",
|
186
|
+
:"Helvetica-Oblique",
|
187
|
+
:Courier,
|
188
|
+
:"Courier-Bold",
|
189
|
+
:"Courier-Oblique",
|
190
|
+
:"Courier-BoldOblique",
|
191
|
+
:Symbol,
|
192
|
+
:ZapfDingbats]
|
193
|
+
|
194
|
+
# create the font object and register the font for each one of the 14 fonts
|
195
|
+
fonts_names_array.each_index do |i|
|
196
|
+
CombinePDF::Fonts.register_font fonts_names_array[i], fonts_metrics_array[i], Type: :Font, Subtype: :Type1, BaseFont: fonts_names_array[i]
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# Register a font that already exists in a pdf object into the font library.
|
201
|
+
#
|
202
|
+
# The implementation is experimental, but this function attempts to deconstruct a font object in order to
|
203
|
+
# extract it's cmap and metric data, allowing it's use in the CombinePDF library.
|
204
|
+
#
|
205
|
+
def register_font_from_pdf_object(font_name, font_object)
|
206
|
+
# FIXME:
|
207
|
+
# - add stream deflation for the CMap file.
|
208
|
+
# - add :Encoding CMaps (such as :WinAnsiEncoding etc`)
|
209
|
+
# - the ToUnicode CMap parsing assumes 8 Bytes <0F0F> while 16 Bytes and multiple unicode chars are also possible.
|
210
|
+
|
211
|
+
# first, create cmap, as it will be used to correctly create the widths directory.
|
212
|
+
|
213
|
+
# find the CMap from one of the two systems (TrueType vs. Type0 fonts)
|
214
|
+
# at the moment doen't suppot :Encoding cmaps...
|
215
|
+
cmap = {}
|
216
|
+
if font_object[:ToUnicode]
|
217
|
+
to_unicode = font_object[:ToUnicode]
|
218
|
+
to_unicode = to_unicode[:referenced_object] if to_unicode[:is_reference_only]
|
219
|
+
# deflate the cmap file stream before parsing
|
220
|
+
to_unicode = create_deep_copy to_unicode
|
221
|
+
CombinePDF::PDFFilter.inflate_object to_unicode
|
222
|
+
# parse the deflated stream
|
223
|
+
cmap = parse_cmap to_unicode[:raw_stream_content]
|
224
|
+
else
|
225
|
+
warn "didn't find ToUnicode object for #{font_object}"
|
226
|
+
return false
|
227
|
+
end
|
228
|
+
|
229
|
+
# second, create the metrics directory.
|
230
|
+
metrics = {}
|
231
|
+
old_widths = font_object
|
232
|
+
if font_object[:DescendantFonts]
|
233
|
+
old_widths = font_object[:DescendantFonts]
|
234
|
+
old_widths = old_widths[:referenced_object][:indirect_without_dictionary] if old_widths.is_a?(Hash) && old_widths[:is_reference_only]
|
235
|
+
old_widths = old_widths[0][:referenced_object]
|
236
|
+
avrg_height = 360
|
237
|
+
avrg_height = old_widths[:XHeight] if old_widths[:XHeight]
|
238
|
+
avrg_height = (avrg_height + old_widths[:CapHeight]) / 2 if old_widths[:CapHeight]
|
239
|
+
avrg_width = old_widths[:AvgWidth] || 0
|
240
|
+
avarage_bbox = [0, 0, avrg_width, avrg_height] # data is missing for full box metrics, just ignore
|
241
|
+
end
|
242
|
+
|
243
|
+
# compute the metrics values using the appropiate system (TrueType vs. Type0 fonts)
|
244
|
+
cmap_inverted = {}
|
245
|
+
cmap.each { |k, v| cmap_inverted[v.hex] = k }
|
246
|
+
if old_widths[:W]
|
247
|
+
old_widths = old_widths[:W]
|
248
|
+
if old_widths.is_a?(Hash) && old_widths[:is_reference_only]
|
249
|
+
old_widths = old_widths[:referenced_object][:indirect_without_dictionary]
|
250
|
+
end
|
251
|
+
old_widths = create_deep_copy old_widths
|
252
|
+
while old_widths[0]
|
253
|
+
a = old_widths.shift
|
254
|
+
b = old_widths.shift
|
255
|
+
if b.is_a?(Array)
|
256
|
+
b.each_index { |i| metrics[cmap_inverted[(a + i)] || (a + i)] = { wx: b[i], boundingbox: avarage_bbox } }
|
257
|
+
else
|
258
|
+
c = old_widths.shift
|
259
|
+
(b - a).times { |i| metrics[cmap_inverted[(a + i)] || (a + i)] = { wx: c[0], boundingbox: avarage_bbox } }
|
260
|
+
end
|
261
|
+
|
262
|
+
end
|
263
|
+
elsif old_widths[:Widths]
|
264
|
+
first_char = old_widths[:FirstChar]
|
265
|
+
old_widths = old_widths[:Widths]
|
266
|
+
if old_widths.is_a?(Hash) && old_widths[:is_reference_only]
|
267
|
+
old_widths = old_widths[:referenced_object][:indirect_without_dictionary]
|
268
|
+
end
|
269
|
+
old_widths.each_index { |i| metrics[cmap_inverted[(i + first_char)] || (i + first_char)] = { wx: old_widths[i], boundingbox: avarage_bbox } }
|
270
|
+
else
|
271
|
+
warn "didn't find widths object for #{old_widths}"
|
272
|
+
return false
|
273
|
+
end
|
274
|
+
# register the font and return the font object
|
275
|
+
cmap = nil if cmap.empty?
|
276
|
+
CombinePDF::Fonts.register_font font_name, metrics, font_object, cmap
|
277
|
+
end
|
278
|
+
|
279
|
+
# # register a TrueType font using the ttfunk gem
|
280
|
+
# #
|
281
|
+
# # NOT YET SUPPORTED - I'm still working on this one... learning about fonts as I go.
|
282
|
+
# #
|
283
|
+
# # name:: the name of the font - this is the name through which you can "pull" the font from the registery
|
284
|
+
# # true_type_font_file:: the file name to be opened and parsed using ttfunk
|
285
|
+
# #
|
286
|
+
# # credit to the Prawn team and the Prawn PDF project. This code is based on their work.
|
287
|
+
# # Please respect their license or don't use this.
|
288
|
+
# def from_ttfunk(name, true_type_font_file)
|
289
|
+
# # FIXME: PDF_object isn't formated correcly.
|
290
|
+
# # missing ToUnicode? CMAP? wrong Stream content...?
|
291
|
+
|
292
|
+
# # read the TTFunk file
|
293
|
+
# ttfont = TTFunk::File.open true_type_font_file
|
294
|
+
# #set the scaling from the font to PDF points (1000)
|
295
|
+
# scale = 1000.0 / ttfont.header.units_per_em
|
296
|
+
# # PDF flags, as indicated by Prawn team's code
|
297
|
+
# flags = 0
|
298
|
+
# family_class = (ttfont.os2.exists? && ttfont.os2.family_class || 0) >> 8
|
299
|
+
# flags |= 0x0001 if ttfont.postscript.fixed_pitch?
|
300
|
+
# flags |= 0x0002 if [1,2,3,4,5,7].include? family_class
|
301
|
+
# flags |= 0x0008 if family_class == 10
|
302
|
+
# flags |= 0x0040 if ttfont.postscript.italic_angle.to_i != 0
|
303
|
+
# flags |= 0x0004 # Prawn assumes the font contains at least some non-latin characters
|
304
|
+
|
305
|
+
# # get cmap
|
306
|
+
# cmap = ttfont.cmap.unicode[0].code_map
|
307
|
+
# # get metrics
|
308
|
+
# widths = ttfont.horizontal_metrics.widths
|
309
|
+
# metrics = {}
|
310
|
+
# cmap.each do |k,v|
|
311
|
+
# bb = ttfont.glyph_outlines.for(v)
|
312
|
+
# bb = bb ? [(bb.x_min*scale).to_i, (bb.y_min*scale).to_i, (bb.x_max*scale).to_i, (bb.y_max*scale).to_i ] : [0,0,0,0]
|
313
|
+
# metrics[k] = { wx: (widths[v].to_f * scale).to_i , boundingbox: bb}
|
314
|
+
# end
|
315
|
+
|
316
|
+
# # create PDF object
|
317
|
+
# subset = TTFunk::SubsetCollection.new ttfont
|
318
|
+
# cmap.each {|k,v| subset.encode([k])}
|
319
|
+
# pdf_object = { :Type=>:Font,
|
320
|
+
# :Subtype=>:TrueType,
|
321
|
+
# :Name=>:name,
|
322
|
+
# :BaseFont=> ttfont.name.postscript_name[0, 32].gsub("\0",""),
|
323
|
+
# :Encoding=>:WinAnsiEncoding,
|
324
|
+
# :FirstChar=>((ttfont.os2.exists? && ttfont.os2.first_char_index) ? ttfont.os2.first_char_index : 32),
|
325
|
+
# :LastChar=>((ttfont.os2.exists? && ttfont.os2.last_char_index) ? ttfont.os2.last_char_index : 64335),
|
326
|
+
# :Widths=>widths,
|
327
|
+
# :FontDescriptor => {
|
328
|
+
# is_reference_only: true,
|
329
|
+
# :referenced_object => {
|
330
|
+
# :Type=>:FontDescriptor,
|
331
|
+
# :FontName=> ttfont.name.postscript_name[0, 32].gsub("\0",""),
|
332
|
+
# :Flags=>flags,
|
333
|
+
# :ItalicAngle=>ttfont.postscript.italic_angle,
|
334
|
+
# :Ascent=> ttfont.ascent * scale,
|
335
|
+
# :Descent=> ttfont.descent * scale,
|
336
|
+
# :CapHeight=>(ttfont.os2.exists? && ttfont.os2.cap_height) ? ttfont.os2.cap_height : ttfont.ascent * scale,
|
337
|
+
# :AvgWidth=>396,
|
338
|
+
# :MaxWidth=> ttfont.horizontal_header.advance_width_max, #maybe?
|
339
|
+
# :FontWeight=> (ttfont.os2.exists? && ttfont.os2.weight_class) ? ttfont.os2.weight_class : 400,
|
340
|
+
# :XHeight=> (ttfont.os2.exists? && ttfont.os2.x_height) ? (ttfont.os2.x_height * scale).to_i: metrics["x".ord][:wx],
|
341
|
+
# # :Leading=>16,
|
342
|
+
# :StemV=>0, #TTFunk doesn't compute this
|
343
|
+
# :FontBBox=>( ttfont.bbox.map {|i| (i*scale).to_i } ),
|
344
|
+
# :FontFile2=>{
|
345
|
+
# is_reference_only: true,
|
346
|
+
# referenced_object: {
|
347
|
+
# :Length => ttfont.contents.length,
|
348
|
+
# raw_stream_content: subset[0..-1][0].encode
|
349
|
+
# }
|
350
|
+
# }
|
351
|
+
# }
|
352
|
+
# }
|
353
|
+
# }
|
354
|
+
# register_font name, metrics, pdf_object, cmap
|
355
|
+
# end
|
356
|
+
|
357
|
+
protected
|
358
|
+
|
359
|
+
# the Hash listing all the fonts.
|
360
|
+
FONTS_LIBRARY = {}.dup
|
361
|
+
|
362
|
+
# the Mutex for library write access
|
363
|
+
|
364
|
+
FONTS_LIBRARY_MUTEX = Mutex.new
|
365
|
+
|
366
|
+
# this method parses a cmap file using it's data stream
|
367
|
+
# FIXME:
|
368
|
+
# - the ToUnicode CMap parsing assumes 8 Bytes <0F0F> while 16 Bytes and multiple unicode chars are also possible (albit very rare).
|
369
|
+
def self.parse_cmap(stream = '')
|
370
|
+
# FIXME:
|
371
|
+
# - the ToUnicode CMap parsing assumes 8 Bytes <0F0F> while 16 Bytes and multiple unicode chars are also possible.
|
372
|
+
|
373
|
+
# when 0..255
|
374
|
+
# warn "coded to char"
|
375
|
+
# self.cmap[c.ord].chr
|
376
|
+
# when 256..65535
|
377
|
+
# warn "coded to unicode"
|
378
|
+
# [self.cmap[c.ord]].pack 'U*'
|
379
|
+
# else
|
380
|
+
# warn "uncoded!"
|
381
|
+
# c
|
382
|
+
# end
|
383
|
+
cmap = {}
|
384
|
+
# get the deflated stream
|
385
|
+
scanner = StringScanner.new stream
|
386
|
+
# parse the cmap file - first collect the relevant lines from the cmap file.
|
387
|
+
do_scan = false # the parsing flag, starts as false
|
388
|
+
lines_found = [] # will be filled with arrays, each array representing a line.
|
389
|
+
until scanner.eos?
|
390
|
+
if do_scan
|
391
|
+
while do_scan && !scanner.eos?
|
392
|
+
if scanner.scan(/[\<]?[\d\w]+[\>]?/)
|
393
|
+
if scanner.matched[0] == '<'
|
394
|
+
lines_found.last << scanner.matched[1..-2]
|
395
|
+
else
|
396
|
+
if scanner.matched.to_i.to_s(16).length.odd?
|
397
|
+
lines_found.last << ('0' + scanner.matched.to_i.to_s(16))
|
398
|
+
else
|
399
|
+
lines_found.last << scanner.matched.to_i.to_s(16)
|
400
|
+
end
|
401
|
+
end
|
402
|
+
elsif scanner.scan(/\[/) # this marks an array of objects. so we create a container.
|
403
|
+
lines_found << []
|
404
|
+
elsif scanner.scan(/\]/) # at the end of the array, we insert the array object into it's containing line.
|
405
|
+
# the following is the equivelant of calling:
|
406
|
+
# lines_found[-2].<<(lines_found.pop)
|
407
|
+
# << is a function call in ruby, so the object on the left is computed before the object on the right.
|
408
|
+
# this is why we don't use lines_found.last << lines_found.pop (which might work if << was an operator).
|
409
|
+
array_parsed = lines_found.pop
|
410
|
+
lines_found.last << array_parsed
|
411
|
+
elsif scanner.scan(/[\n\r]+/)
|
412
|
+
lines_found << []
|
413
|
+
elsif scanner.scan(/endbfrange|endbfchar/)
|
414
|
+
# remove the last line added, as it won't be used, and set stop signal
|
415
|
+
lines_found.pop
|
416
|
+
do_scan = false
|
417
|
+
else
|
418
|
+
scanner.pos += 1
|
419
|
+
end
|
420
|
+
end
|
421
|
+
else
|
422
|
+
if scanner.scan_until(/beginbfrange|beginbfchar/)
|
423
|
+
# set the start signal, a new array (line) will be created once the \n is parsed and before any numbers
|
424
|
+
do_scan = true
|
425
|
+
else
|
426
|
+
scanner.terminate
|
427
|
+
end
|
428
|
+
end
|
429
|
+
end
|
430
|
+
# parse the cmap file - next, parse each line and set cmap data.
|
431
|
+
lines_found.each do |line|
|
432
|
+
case line.length
|
433
|
+
when 2
|
434
|
+
cmap['%c' % line[1].hex] = line[0] # FixMe? for now limit to 8 Byte data
|
435
|
+
when 3
|
436
|
+
if line[2].is_a?(Array)
|
437
|
+
format = "%0#{line[0].length}x"
|
438
|
+
i = line[0].hex
|
439
|
+
last_char = line[1].hex
|
440
|
+
j = 0
|
441
|
+
while i <= last_char
|
442
|
+
cmap['%c' % line[2][j].hex] = format % i # FixMe? for now limit to 8 Byte data
|
443
|
+
j += 1
|
444
|
+
i += 1
|
445
|
+
end
|
446
|
+
else
|
447
|
+
format = "%0#{line[0].length}x"
|
448
|
+
i = line[0].hex
|
449
|
+
last_char = line[1].hex
|
450
|
+
j = 0
|
451
|
+
while i <= last_char
|
452
|
+
cmap['%c' % (line[2].hex + j)] = format % i # FixMe? for now limit to 8 Byte data
|
453
|
+
j += 1
|
454
|
+
i += 1
|
455
|
+
end
|
456
|
+
end
|
457
|
+
end
|
458
|
+
end
|
459
|
+
warn "CMap is empty even after parsing!\nthese were the lines found: #{lines_found}\nfrom: #{scanner.string}" if cmap.empty?
|
460
|
+
cmap
|
461
|
+
end
|
462
|
+
end
|
468
463
|
end
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|