3 php pdf generation library
4 Copyright (C) Potential Technologies 2002 - 2003
5 http://www.potentialtech.com
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 $Id: strlen.inc.php,v 2.1 2003/02/03 14:59:11 wmoran Exp $
24 $this->needsset = false;
25 $this->widths['Symbol']= array ( 32 => 250, 33 => 333, 34 => 713, 35 => 500, 36 => 549,
26 37 => 833, 38 => 778, 39 => 439, 40 => 333, 41 => 333,
27 42 => 500, 43 => 549, 44 => 250, 45 => 549, 46 => 250,
28 47 => 278, 48 => 500, 49 => 500, 50 => 500, 51 => 500,
29 52 => 500, 53 => 500, 54 => 500, 55 => 500, 56 => 500,
30 57 => 500, 58 => 278, 59 => 278, 60 => 549, 61 => 549,
31 62 => 549, 63 => 444, 64 => 549, 65 => 722, 66 => 667,
32 67 => 722, 68 => 612, 69 => 611, 70 => 763, 71 => 603,
33 72 => 722, 73 => 333, 74 => 631, 75 => 722, 76 => 686,
34 77 => 889, 78 => 722, 79 => 722, 80 => 768, 81 => 741,
35 82 => 556, 83 => 592, 84 => 611, 85 => 690, 86 => 439,
36 87 => 768, 88 => 645, 89 => 795, 90 => 611, 91 => 333,
37 92 => 863, 93 => 333, 94 => 658, 95 => 500, 96 => 500,
38 97 => 631, 98 => 549, 99 => 549, 100 => 494, 101 => 439,
39 102 => 521, 103 => 411, 104 => 603, 105 => 329, 106 => 603,
40 107 => 549, 108 => 549, 109 => 576, 110 => 521, 111 => 549,
41 112 => 549, 113 => 521, 114 => 549, 115 => 603, 116 => 439,
42 117 => 576, 118 => 713, 119 => 686, 120 => 493, 121 => 686,
43 122 => 494, 123 => 480, 124 => 200, 125 => 480, 126 => 549,
44 161 => 620, 162 => 247, 163 => 549, 164 => 167, 165 => 713,
45 166 => 500, 167 => 753, 168 => 753, 169 => 753, 170 => 753,
46 171 => 1042, 172 => 987, 173 => 603, 174 => 987, 175 => 603,
47 176 => 400, 177 => 549, 178 => 411, 179 => 549, 180 => 549,
48 181 => 713, 182 => 494, 183 => 460, 184 => 549, 185 => 549,
49 186 => 549, 187 => 549, 188 => 1000, 189 => 603, 190 => 1000,
50 191 => 658, 192 => 823, 193 => 686, 194 => 795, 195 => 987,
51 196 => 768, 197 => 768, 198 => 823, 199 => 768, 200 => 768,
52 201 => 713, 202 => 713, 203 => 713, 204 => 713, 205 => 713,
53 206 => 713, 207 => 713, 208 => 768, 209 => 713, 210 => 790,
54 211 => 790, 212 => 890, 213 => 823, 214 => 549, 215 => 250,
55 216 => 713, 217 => 603, 218 => 603, 219 => 1042, 220 => 987,
56 221 => 603, 222 => 987, 223 => 603, 224 => 494, 225 => 329,
57 226 => 790, 227 => 790, 228 => 786, 229 => 713, 230 => 384,
58 231 => 384, 232 => 384, 233 => 384, 234 => 384, 235 => 384,
59 236 => 494, 237 => 494, 238 => 494, 239 => 494, 241 => 329,
60 242 => 274, 243 => 686, 244 => 686, 245 => 686, 246 => 384,
61 247 => 384, 248 => 384, 249 => 384, 250 => 384, 251 => 384,
62 252 => 494, 253 => 494, 254 => 494 );
63 $this->widths['Dingbats'] = array (32 => 278, 33 => 974, 34 => 961, 35 => 974, 36 => 980,
64 37 => 719, 38 => 789, 39 => 790, 40 => 791, 41 => 690,
65 42 => 960, 43 => 939, 44 => 549, 45 => 855, 46 => 911,
66 47 => 933, 48 => 911, 49 => 945, 50 => 974, 51 => 755,
67 52 => 846, 53 => 762, 54 => 761, 55 => 571, 56 => 677,
68 57 => 763, 58 => 760, 59 => 759, 60 => 754, 61 => 494,
69 62 => 552, 63 => 537, 64 => 577, 65 => 692, 66 => 786,
70 67 => 788, 68 => 788, 69 => 790, 70 => 793, 71 => 794,
71 72 => 816, 73 => 823, 74 => 789, 75 => 841, 76 => 823,
72 77 => 833, 78 => 816, 79 => 831, 80 => 923, 81 => 744,
73 82 => 723, 83 => 749, 84 => 790, 85 => 792, 86 => 695,
74 87 => 776, 88 => 768, 89 => 792, 90 => 759, 91 => 707,
75 92 => 708, 93 => 682, 94 => 701, 95 => 826, 96 => 815,
76 97 => 789, 98 => 789, 99 => 707, 100 => 687, 101 => 696,
77 102 => 689, 103 => 786, 104 => 787, 105 => 713, 106 => 791,
78 107 => 785, 108 => 791, 109 => 873, 110 => 761, 111 => 762,
79 112 => 762, 113 => 759, 114 => 759, 115 => 892, 116 => 892,
80 117 => 788, 118 => 784, 119 => 438, 120 => 138, 121 => 277,
81 122 => 415, 123 => 392, 124 => 392, 125 => 668, 126 => 668,
82 161 => 732, 162 => 544, 163 => 544, 164 => 910, 165 => 667,
83 166 => 760, 167 => 760, 168 => 776, 169 => 595, 170 => 694,
84 171 => 626, 172 => 788, 173 => 788, 174 => 788, 175 => 788,
85 176 => 788, 177 => 788, 178 => 788, 179 => 788, 180 => 788,
86 181 => 788, 182 => 788, 183 => 788, 184 => 788, 185 => 788,
87 186 => 788, 187 => 788, 188 => 788, 189 => 788, 190 => 788,
88 191 => 788, 192 => 788, 193 => 788, 194 => 788, 195 => 788,
89 196 => 788, 197 => 788, 198 => 788, 199 => 788, 200 => 788,
90 201 => 788, 202 => 788, 203 => 788, 204 => 788, 205 => 788,
91 206 => 788, 207 => 788, 208 => 788, 209 => 788, 210 => 788,
92 211 => 788, 212 => 894, 213 => 838, 214 => 1016, 215 => 458,
93 216 => 748, 217 => 924, 218 => 748, 219 => 918, 220 => 927,
94 221 => 928, 222 => 928, 223 => 834, 224 => 873, 225 => 828,
95 226 => 924, 227 => 924, 228 => 917, 229 => 930, 230 => 931,
96 231 => 463, 232 => 883, 233 => 836, 234 => 836, 235 => 867,
97 236 => 867, 237 => 696, 238 => 696, 239 => 874, 241 => 874,
98 242 => 760, 243 => 946, 244 => 771, 245 => 865, 246 => 771,
99 247 => 888, 248 => 967, 249 => 888, 250 => 831, 251 => 873,
100 252 => 927, 253 => 970, 254 => 918);
101 $this->widths['Helvetica-Bold'] = array (32 => 278, 33 => 333, 34 => 474, 35 => 556,
102 36 => 556, 37 => 889, 38 => 722, 39 => 278,
103 40 => 333, 41 => 333, 42 => 389, 43 => 584,
104 44 => 278, 45 => 333, 46 => 278, 47 => 278,
105 48 => 556, 49 => 556, 50 => 556, 51 => 556,
106 52 => 556, 53 => 556, 54 => 556, 55 => 556,
107 56 => 556, 57 => 556, 58 => 333, 59 => 333,
108 60 => 584, 61 => 584, 62 => 584, 63 => 611,
109 64 => 975, 65 => 722, 66 => 722, 67 => 722,
110 68 => 722, 69 => 667, 70 => 611, 71 => 778,
111 72 => 722, 73 => 278, 74 => 556, 75 => 722,
112 76 => 611, 77 => 833, 78 => 722, 79 => 778,
113 80 => 667, 81 => 778, 82 => 722, 83 => 667,
114 84 => 611, 85 => 722, 86 => 667, 87 => 944,
115 88 => 667, 89 => 667, 90 => 611, 91 => 333,
116 92 => 278, 93 => 333, 94 => 584, 95 => 556,
117 96 => 278, 97 => 556, 98 => 611, 99 => 556,
118 100 => 611, 101 => 556, 102 => 333, 103 => 611,
119 104 => 611, 105 => 278, 106 => 278, 107 => 556,
120 108 => 278, 109 => 889, 110 => 611, 111 => 611,
121 112 => 611, 113 => 611, 114 => 389, 115 => 556,
122 116 => 333, 117 => 611, 118 => 556, 119 => 778,
123 120 => 556, 121 => 556, 122 => 500, 123 => 389,
124 124 => 280, 125 => 389, 126 => 584, 161 => 333,
125 162 => 556, 163 => 556, 164 => 167, 165 => 556,
126 166 => 556, 167 => 556, 168 => 556, 169 => 238,
127 170 => 500, 171 => 556, 172 => 333, 173 => 333,
128 174 => 611, 175 => 611, 177 => 556, 178 => 556,
129 179 => 556, 180 => 278, 182 => 556, 183 => 350,
130 184 => 278, 185 => 500, 186 => 500, 187 => 556,
131 188 => 1000, 189 => 1000, 191 => 611, 193 => 333,
132 194 => 333, 195 => 333, 196 => 333, 197 => 333,
133 198 => 333, 199 => 333, 200 => 333, 202 => 333,
134 203 => 333, 205 => 333, 206 => 333, 207 => 333,
135 208 => 1000, 225 => 1000, 227 => 370, 232 => 611,
136 233 => 778, 234 => 1000, 235 => 365, 241 => 889,
137 245 => 278, 248 => 278, 249 => 611, 250 => 944,
139 $this->widths['Helvetica'] = array (32 => 278, 33 => 278, 34 => 355, 35 => 556, 36 => 556,
140 37 => 889, 38 => 667, 39 => 222, 40 => 333, 41 => 333,
141 42 => 389, 43 => 584, 44 => 278, 45 => 333, 46 => 278,
142 47 => 278, 48 => 556, 49 => 556, 50 => 556, 51 => 556,
143 52 => 556, 53 => 556, 54 => 556, 55 => 556, 56 => 556,
144 57 => 556, 58 => 278, 59 => 278, 60 => 584, 61 => 584,
145 62 => 584, 63 => 556, 64 => 1015, 65 => 667, 66 => 667,
146 67 => 722, 68 => 722, 69 => 667, 70 => 611, 71 => 778,
147 72 => 722, 73 => 278, 74 => 500, 75 => 667, 76 => 556,
148 77 => 833, 78 => 722, 79 => 778, 80 => 667, 81 => 778,
149 82 => 722, 83 => 667, 84 => 611, 85 => 722, 86 => 667,
150 87 => 944, 88 => 667, 89 => 667, 90 => 611, 91 => 278,
151 92 => 278, 93 => 278, 94 => 469, 95 => 556, 96 => 222,
152 97 => 556, 98 => 556, 99 => 500, 100 => 556, 101 => 556,
153 102 => 278, 103 => 556, 104 => 556, 105 => 222, 106 => 222,
154 107 => 500, 108 => 222, 109 => 833, 110 => 556, 111 => 556,
155 112 => 556, 113 => 556, 114 => 333, 115 => 500, 116 => 278,
156 117 => 556, 118 => 500, 119 => 722, 120 => 500, 121 => 500,
157 122 => 500, 123 => 334, 124 => 260, 125 => 334, 126 => 584,
158 161 => 333, 162 => 556, 163 => 556, 164 => 167, 165 => 556,
159 166 => 556, 167 => 556, 168 => 556, 169 => 191, 170 => 333,
160 171 => 556, 172 => 333, 173 => 333, 174 => 500, 175 => 500,
161 177 => 556, 178 => 556, 179 => 556, 180 => 278, 182 => 537,
162 183 => 350, 184 => 222, 185 => 333, 186 => 333, 187 => 556,
163 188 => 1000, 189 => 1000, 191 => 611, 193 => 333, 194 => 333,
164 195 => 333, 196 => 333, 197 => 333, 198 => 333, 199 => 333,
165 200 => 333, 202 => 333, 203 => 333, 205 => 333, 206 => 333,
166 207 => 333, 208 => 1000, 225 => 1000, 227 => 370, 232 => 556,
167 233 => 778, 234 => 1000, 235 => 365, 241 => 889, 245 => 278,
168 248 => 222, 249 => 611, 250 => 944, 251 => 611 );
169 $this->widths['Times'] = array (32 => 250, 33 => 333, 34 => 408, 35 => 500, 36 => 500,
170 37 => 833, 38 => 778, 39 => 333, 40 => 333, 41 => 333,
171 42 => 500, 43 => 564, 44 => 250, 45 => 333, 46 => 250,
172 47 => 278, 48 => 500, 49 => 500, 50 => 500, 51 => 500,
173 52 => 500, 53 => 500, 54 => 500, 55 => 500, 56 => 500,
174 57 => 500, 58 => 278, 59 => 278, 60 => 564, 61 => 564,
175 62 => 564, 63 => 444, 64 => 921, 65 => 722, 66 => 667,
176 67 => 667, 68 => 722, 69 => 611, 70 => 556, 71 => 722,
177 72 => 722, 73 => 333, 74 => 389, 75 => 722, 76 => 611,
178 77 => 889, 78 => 722, 79 => 722, 80 => 556, 81 => 722,
179 82 => 667, 83 => 556, 84 => 611, 85 => 722, 86 => 722,
180 87 => 944, 88 => 722, 89 => 722, 90 => 611, 91 => 333,
181 92 => 278, 93 => 333, 94 => 469, 95 => 500, 96 => 333,
182 97 => 444, 98 => 500, 99 => 444, 100 => 500, 101 => 444,
183 102 => 333, 103 => 500, 104 => 500, 105 => 278, 106 => 278,
184 107 => 500, 108 => 278, 109 => 778, 110 => 500, 111 => 500,
185 112 => 500, 113 => 500, 114 => 333, 115 => 389, 116 => 278,
186 117 => 500, 118 => 500, 119 => 722, 120 => 500, 121 => 500,
187 122 => 444, 123 => 480, 124 => 200, 125 => 480, 126 => 541,
188 161 => 333, 162 => 500, 163 => 500, 164 => 167, 165 => 500,
189 166 => 500, 167 => 500, 168 => 500, 169 => 180, 170 => 444,
190 171 => 500, 172 => 333, 173 => 333, 174 => 556, 175 => 556,
191 177 => 500, 178 => 500, 179 => 500, 180 => 250, 182 => 453,
192 183 => 350, 184 => 333, 185 => 444, 186 => 444, 187 => 500,
193 188 => 1000, 189 => 1000, 191 => 444, 193 => 333, 194 => 333,
194 195 => 333, 196 => 333, 197 => 333, 198 => 333, 199 => 333,
195 200 => 333, 202 => 333, 203 => 333, 205 => 333, 206 => 333,
196 207 => 333, 208 => 1000, 225 => 889, 227 => 276, 232 => 611,
197 233 => 722, 234 => 889, 235 => 310, 241 => 667, 245 => 278,
198 248 => 278, 249 => 500, 250 => 722, 251 => 500);
199 $this->widths['Times-Bold'] = array (32 => 250, 33 => 333, 34 => 555, 35 => 500, 36 => 500,
200 37 => 1000, 38 => 833, 39 => 333, 40 => 333, 41 => 333,
201 42 => 500, 43 => 570, 44 => 250, 45 => 333, 46 => 250,
202 47 => 278, 48 => 500, 49 => 500, 50 => 500, 51 => 500,
203 52 => 500, 53 => 500, 54 => 500, 55 => 500, 56 => 500,
204 57 => 500, 58 => 333, 59 => 333, 60 => 570, 61 => 570,
205 62 => 570, 63 => 500, 64 => 930, 65 => 722, 66 => 667,
206 67 => 722, 68 => 722, 69 => 667, 70 => 611, 71 => 778,
207 72 => 778, 73 => 389, 74 => 500, 75 => 778, 76 => 667,
208 77 => 944, 78 => 722, 79 => 778, 80 => 611, 81 => 778,
209 82 => 722, 83 => 556, 84 => 667, 85 => 722, 86 => 722,
210 87 => 1000, 88 => 722, 89 => 722, 90 => 667, 91 => 333,
211 92 => 278, 93 => 333, 94 => 581, 95 => 500, 96 => 333,
212 97 => 500, 98 => 556, 99 => 444, 100 => 556, 101 => 444,
213 102 => 333, 103 => 500, 104 => 556, 105 => 278, 106 => 333,
214 107 => 556, 108 => 278, 109 => 833, 110 => 556, 111 => 500,
215 112 => 556, 113 => 556, 114 => 444, 115 => 389, 116 => 333,
216 117 => 556, 118 => 500, 119 => 722, 120 => 500, 121 => 500,
217 122 => 444, 123 => 394, 124 => 220, 125 => 394, 126 => 520,
218 161 => 333, 162 => 500, 163 => 500, 164 => 167, 165 => 500,
219 166 => 500, 167 => 500, 168 => 500, 169 => 278, 170 => 500,
220 171 => 500, 172 => 333, 173 => 333, 174 => 556, 175 => 556,
221 177 => 500, 178 => 500, 179 => 500, 180 => 250, 182 => 540,
222 183 => 350, 184 => 333, 185 => 500, 186 => 500, 187 => 500,
223 188 => 1000, 189 => 1000, 191 => 500, 193 => 333, 194 => 333,
224 195 => 333, 196 => 333, 197 => 333, 198 => 333, 199 => 333,
225 200 => 333, 202 => 333, 203 => 333, 205 => 333, 206 => 333,
226 207 => 333, 208 => 1000, 225 => 1000, 227 => 300, 232 => 667,
227 233 => 778, 234 => 1000, 235 => 330, 241 => 722, 245 => 278,
228 248 => 278, 249 => 500, 250 => 722, 251 => 556);
229 $this->widths['Times-Italic'] = array (32 => 250, 33 => 333, 34 => 420, 35 => 500, 36 => 500,
230 37 => 833, 38 => 778, 39 => 333, 40 => 333, 41 => 333,
231 42 => 500, 43 => 675, 44 => 250, 45 => 333, 46 => 250,
232 47 => 278, 48 => 500, 49 => 500, 50 => 500, 51 => 500,
233 52 => 500, 53 => 500, 54 => 500, 55 => 500, 56 => 500,
234 57 => 500, 58 => 333, 59 => 333, 60 => 675, 61 => 675,
235 62 => 675, 63 => 500, 64 => 920, 65 => 611, 66 => 611,
236 67 => 667, 68 => 722, 69 => 611, 70 => 611, 71 => 722,
237 72 => 722, 73 => 333, 74 => 444, 75 => 667, 76 => 556,
238 77 => 833, 78 => 667, 79 => 722, 80 => 611, 81 => 722,
239 82 => 611, 83 => 500, 84 => 556, 85 => 722, 86 => 611,
240 87 => 833, 88 => 611, 89 => 556, 90 => 556, 91 => 389,
241 92 => 278, 93 => 389, 94 => 422, 95 => 500, 96 => 333,
242 97 => 500, 98 => 500, 99 => 444, 100 => 500, 101 => 444,
243 102 => 278, 103 => 500, 104 => 500, 105 => 278, 106 => 278,
244 107 => 444, 108 => 278, 109 => 722, 110 => 500, 111 => 500,
245 112 => 500, 113 => 500, 114 => 389, 115 => 389, 116 => 278,
246 117 => 500, 118 => 444, 119 => 667, 120 => 444, 121 => 444,
247 122 => 389, 123 => 400, 124 => 275, 125 => 400, 126 => 541,
248 161 => 389, 162 => 500, 163 => 500, 164 => 167, 165 => 500,
249 166 => 500, 167 => 500, 168 => 500, 169 => 214, 170 => 556,
250 171 => 500, 172 => 333, 173 => 333, 174 => 500, 175 => 500,
251 177 => 500, 178 => 500, 179 => 500, 180 => 250, 182 => 523,
252 183 => 350, 184 => 333, 185 => 556, 186 => 556, 187 => 500,
253 188 => 889, 189 => 1000, 191 => 500, 193 => 333, 194 => 333,
254 195 => 333, 196 => 333, 197 => 333, 198 => 333, 199 => 333,
255 200 => 333, 202 => 333, 203 => 333, 205 => 333, 206 => 333,
256 207 => 333, 208 => 889, 225 => 889, 227 => 276, 232 => 556,
257 233 => 722, 234 => 944, 235 => 310, 241 => 667, 245 => 278,
258 248 => 278, 249 => 500, 250 => 667, 251 => 500);
259 $this->widths['Times-BoldItalic'] = array (32 => 250, 33 => 389, 34 => 555, 35 => 500, 36 => 500,
260 37 => 833, 38 => 778, 39 => 333, 40 => 333, 41 => 333,
261 42 => 500, 43 => 570, 44 => 250, 45 => 333, 46 => 250,
262 47 => 278, 48 => 500, 49 => 500, 50 => 500, 51 => 500,
263 52 => 500, 53 => 500, 54 => 500, 55 => 500, 56 => 500,
264 57 => 500, 58 => 333, 59 => 333, 60 => 570, 61 => 570,
265 62 => 570, 63 => 500, 64 => 832, 65 => 667, 66 => 667,
266 67 => 667, 68 => 722, 69 => 667, 70 => 667, 71 => 722,
267 72 => 778, 73 => 389, 74 => 500, 75 => 667, 76 => 611,
268 77 => 889, 78 => 722, 79 => 722, 80 => 611, 81 => 722,
269 82 => 667, 83 => 556, 84 => 611, 85 => 722, 86 => 667,
270 87 => 889, 88 => 667, 89 => 611, 90 => 611, 91 => 333,
271 92 => 278, 93 => 333, 94 => 570, 95 => 500, 96 => 333,
272 97 => 500, 98 => 500, 99 => 444, 100 => 500, 101 => 444,
273 102 => 333, 103 => 500, 104 => 556, 105 => 278, 106 => 278,
274 107 => 500, 108 => 278, 109 => 778, 110 => 556, 111 => 500,
275 112 => 500, 113 => 500, 114 => 389, 115 => 389, 116 => 278,
276 117 => 556, 118 => 444, 119 => 667, 120 => 500, 121 => 444,
277 122 => 389, 123 => 348, 124 => 220, 125 => 348, 126 => 570,
278 161 => 389, 162 => 500, 163 => 500, 164 => 167, 165 => 500,
279 166 => 500, 167 => 500, 168 => 500, 169 => 278, 170 => 500,
280 171 => 500, 172 => 333, 173 => 333, 174 => 556, 175 => 556,
281 177 => 500, 178 => 500, 179 => 500, 180 => 250, 182 => 500,
282 183 => 350, 184 => 333, 185 => 500, 186 => 500, 187 => 500,
283 188 => 1000, 189 => 1000, 191 => 500, 193 => 333, 194 => 333,
284 195 => 333, 196 => 333, 197 => 333, 198 => 333, 199 => 333,
285 200 => 333, 202 => 333, 203 => 333, 205 => 333, 206 => 333,
286 207 => 333, 208 => 1000, 225 => 944, 227 => 266, 232 => 611,
287 233 => 722, 234 => 944, 235 => 300, 241 => 722, 245 => 278,
288 248 => 278, 249 => 500, 250 => 722, 251 => 500);