The requested changes are too big and content was truncated. Show full diff
@@ -0,0 +1,448 | |||
|
1 | ||
|
2 | #============================================================+ | |
|
3 | # File name : barcode.rb | |
|
4 | # Begin : 2002-07-31 | |
|
5 | # Last Update : 2005-01-02 | |
|
6 | # Author : Karim Mribti [barcode@mribti.com] | |
|
7 | # Version : 1.1 [0.0.8a (original code)] | |
|
8 | # License : GNU LGPL (Lesser General Public License) 2.1 | |
|
9 | # http://www.gnu.org/copyleft/lesser.txt | |
|
10 | # Source Code : http://www.mribti.com/barcode/ | |
|
11 | # | |
|
12 | # Description : Generic Barcode Render Class for PHP using | |
|
13 | # the GD graphics library. | |
|
14 | # | |
|
15 | # NOTE: | |
|
16 | # This version contains changes by Nicola Asuni: | |
|
17 | # - porting to Ruby | |
|
18 | # - code style and formatting | |
|
19 | # - automatic php documentation in PhpDocumentor Style | |
|
20 | # (www.phpdoc.org) | |
|
21 | # - minor bug fixing | |
|
22 | # - $mCharSet and $mChars variables were added here | |
|
23 | #============================================================+ | |
|
24 | ||
|
25 | # | |
|
26 | # Barcode Render Class for PHP using the GD graphics library. | |
|
27 | # @author Karim Mribti, Nicola Asuni | |
|
28 | # @name BarcodeObject | |
|
29 | # @package com.tecnick.tcpdf | |
|
30 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
31 | # @since 2001-03-25 | |
|
32 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
33 | # | |
|
34 | ||
|
35 | # Styles | |
|
36 | # Global | |
|
37 | ||
|
38 | # | |
|
39 | # option: generate barcode border | |
|
40 | # | |
|
41 | define("BCS_BORDER", 1); | |
|
42 | ||
|
43 | # | |
|
44 | # option: use transparent background | |
|
45 | # | |
|
46 | define("BCS_TRANSPARENT", 2); | |
|
47 | ||
|
48 | # | |
|
49 | # option: center barcode | |
|
50 | # | |
|
51 | define("BCS_ALIGN_CENTER", 4); | |
|
52 | ||
|
53 | # | |
|
54 | # option: align left | |
|
55 | # | |
|
56 | define("BCS_ALIGN_LEFT", 8); | |
|
57 | ||
|
58 | # | |
|
59 | # option: align right | |
|
60 | # | |
|
61 | define("BCS_ALIGN_RIGHT", 16); | |
|
62 | ||
|
63 | # | |
|
64 | # option: generate JPEG image | |
|
65 | # | |
|
66 | define("BCS_IMAGE_JPEG", 32); | |
|
67 | ||
|
68 | # | |
|
69 | # option: generate PNG image | |
|
70 | # | |
|
71 | define("BCS_IMAGE_PNG", 64); | |
|
72 | ||
|
73 | # | |
|
74 | # option: draw text | |
|
75 | # | |
|
76 | define("BCS_DRAW_TEXT", 128); | |
|
77 | ||
|
78 | # | |
|
79 | # option: stretch text | |
|
80 | # | |
|
81 | define("BCS_STRETCH_TEXT", 256); | |
|
82 | ||
|
83 | # | |
|
84 | # option: reverse color | |
|
85 | # | |
|
86 | define("BCS_REVERSE_COLOR", 512); | |
|
87 | ||
|
88 | # | |
|
89 | # option: draw check | |
|
90 | # (only for I25 code) | |
|
91 | # | |
|
92 | define("BCS_I25_DRAW_CHECK", 2048); | |
|
93 | ||
|
94 | # | |
|
95 | # set default background color | |
|
96 | # | |
|
97 | define("BCD_DEFAULT_BACKGROUND_COLOR", 0xFFFFFF); | |
|
98 | ||
|
99 | # | |
|
100 | # set default foreground color | |
|
101 | # | |
|
102 | define("BCD_DEFAULT_FOREGROUND_COLOR", 0x000000); | |
|
103 | ||
|
104 | # | |
|
105 | # set default style options | |
|
106 | # | |
|
107 | define("BCD_DEFAULT_STYLE", BCS_BORDER | BCS_ALIGN_CENTER | BCS_IMAGE_PNG); | |
|
108 | ||
|
109 | # | |
|
110 | # set default width | |
|
111 | # | |
|
112 | define("BCD_DEFAULT_WIDTH", 460); | |
|
113 | ||
|
114 | # | |
|
115 | # set default height | |
|
116 | # | |
|
117 | define("BCD_DEFAULT_HEIGHT", 120); | |
|
118 | ||
|
119 | # | |
|
120 | # set default font | |
|
121 | # | |
|
122 | define("BCD_DEFAULT_FONT", 5); | |
|
123 | ||
|
124 | # | |
|
125 | # st default horizontal resolution | |
|
126 | # | |
|
127 | define("BCD_DEFAULT_XRES", 2); | |
|
128 | ||
|
129 | # Margins | |
|
130 | ||
|
131 | # | |
|
132 | # set default margin | |
|
133 | # | |
|
134 | define("BCD_DEFAULT_MAR_Y1", 0); | |
|
135 | ||
|
136 | # | |
|
137 | # set default margin | |
|
138 | # | |
|
139 | define("BCD_DEFAULT_MAR_Y2", 0); | |
|
140 | ||
|
141 | # | |
|
142 | # set default text offset | |
|
143 | # | |
|
144 | define("BCD_DEFAULT_TEXT_OFFSET", 2); | |
|
145 | ||
|
146 | # For the I25 Only | |
|
147 | ||
|
148 | # | |
|
149 | # narrow bar option | |
|
150 | # (only for I25 code) | |
|
151 | # | |
|
152 | define("BCD_I25_NARROW_BAR", 1); | |
|
153 | ||
|
154 | # | |
|
155 | # wide bar option | |
|
156 | # (only for I25 code) | |
|
157 | # | |
|
158 | define("BCD_I25_WIDE_BAR", 2); | |
|
159 | ||
|
160 | # For the C39 Only | |
|
161 | ||
|
162 | # | |
|
163 | # narrow bar option | |
|
164 | # (only for c39 code) | |
|
165 | # | |
|
166 | define("BCD_C39_NARROW_BAR", 1); | |
|
167 | ||
|
168 | # | |
|
169 | # wide bar option | |
|
170 | # (only for c39 code) | |
|
171 | # | |
|
172 | define("BCD_C39_WIDE_BAR", 2); | |
|
173 | ||
|
174 | # For Code 128 | |
|
175 | ||
|
176 | # | |
|
177 | # set type 1 bar | |
|
178 | # (only for c128 code) | |
|
179 | # | |
|
180 | define("BCD_C128_BAR_1", 1); | |
|
181 | ||
|
182 | # | |
|
183 | # set type 2 bar | |
|
184 | # (only for c128 code) | |
|
185 | # | |
|
186 | define("BCD_C128_BAR_2", 2); | |
|
187 | ||
|
188 | # | |
|
189 | # set type 3 bar | |
|
190 | # (only for c128 code) | |
|
191 | # | |
|
192 | define("BCD_C128_BAR_3", 3); | |
|
193 | ||
|
194 | # | |
|
195 | # set type 4 bar | |
|
196 | # (only for c128 code) | |
|
197 | # | |
|
198 | define("BCD_C128_BAR_4", 4); | |
|
199 | ||
|
200 | # | |
|
201 | # Barcode Render Class for PHP using the GD graphics library. | |
|
202 | # @author Karim Mribti, Nicola Asuni | |
|
203 | # @name BarcodeObject | |
|
204 | # @package com.tecnick.tcpdf | |
|
205 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
206 | # @since 2001-03-25 | |
|
207 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
208 | # | |
|
209 | class BarcodeObject { | |
|
210 | # | |
|
211 | # @var Image width in pixels. | |
|
212 | # @access protected | |
|
213 | # | |
|
214 | protected $mWidth; | |
|
215 | ||
|
216 | # | |
|
217 | # @var Image height in pixels. | |
|
218 | # @access protected | |
|
219 | # | |
|
220 | protected $mHeight; | |
|
221 | ||
|
222 | # | |
|
223 | # @var Numeric code for Barcode style. | |
|
224 | # @access protected | |
|
225 | # | |
|
226 | protected $mStyle; | |
|
227 | ||
|
228 | # | |
|
229 | # @var Background color. | |
|
230 | # @access protected | |
|
231 | # | |
|
232 | protected $mBgcolor; | |
|
233 | ||
|
234 | # | |
|
235 | # @var Brush color. | |
|
236 | # @access protected | |
|
237 | # | |
|
238 | protected $mBrush; | |
|
239 | ||
|
240 | # | |
|
241 | # @var Image object. | |
|
242 | # @access protected | |
|
243 | # | |
|
244 | protected $mImg; | |
|
245 | ||
|
246 | # | |
|
247 | # @var Numeric code for character font. | |
|
248 | # @access protected | |
|
249 | # | |
|
250 | protected $mFont; | |
|
251 | ||
|
252 | # | |
|
253 | # @var Error message. | |
|
254 | # @access protected | |
|
255 | # | |
|
256 | protected $mError; | |
|
257 | ||
|
258 | # | |
|
259 | # @var Character Set. | |
|
260 | # @access protected | |
|
261 | # | |
|
262 | protected $mCharSet; | |
|
263 | ||
|
264 | # | |
|
265 | # @var Allowed symbols. | |
|
266 | # @access protected | |
|
267 | # | |
|
268 | protected $mChars; | |
|
269 | ||
|
270 | # | |
|
271 | # Class Constructor. | |
|
272 | # @param int $Width Image width in pixels. | |
|
273 | # @param int $Height Image height in pixels. | |
|
274 | # @param int $Style Barcode style. | |
|
275 | # | |
|
276 | def __construct($Width=BCD_DEFAULT_WIDTH, $Height=BCD_DEFAULT_HEIGHT, $Style=BCD_DEFAULT_STYLE) | |
|
277 | @mWidth = $Width; | |
|
278 | @mHeight = $Height; | |
|
279 | @mStyle = $Style; | |
|
280 | @mFont = BCD_DEFAULT_FONT; | |
|
281 | @mImg = ImageCreate(@mWidth, @mHeight); | |
|
282 | $dbColor = @mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_FOREGROUND_COLOR : BCD_DEFAULT_BACKGROUND_COLOR; | |
|
283 | $dfColor = @mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_BACKGROUND_COLOR : BCD_DEFAULT_FOREGROUND_COLOR; | |
|
284 | @mBgcolor = ImageColorAllocate(@mImg, ($dbColor & 0xFF0000) >> 16, | |
|
285 | ($dbColor & 0x00FF00) >> 8, $dbColor & 0x0000FF); | |
|
286 | @mBrush = ImageColorAllocate(@mImg, ($dfColor & 0xFF0000) >> 16, | |
|
287 | ($dfColor & 0x00FF00) >> 8, $dfColor & 0x0000FF); | |
|
288 | if (!(@mStyle & BCS_TRANSPARENT)) | |
|
289 | ImageFill(@mImg, @mWidth, @mHeight, @mBgcolor); | |
|
290 | end | |
|
291 | end | |
|
292 | ||
|
293 | # | |
|
294 | # Class Destructor. | |
|
295 | # Destroy image object. | |
|
296 | # | |
|
297 | def __destructor() | |
|
298 | @DestroyObject(); | |
|
299 | end | |
|
300 | ||
|
301 | # | |
|
302 | # Returns the image object. | |
|
303 | # @return object image. | |
|
304 | # @author Nicola Asuni | |
|
305 | # @since 1.5.2 | |
|
306 | # | |
|
307 | def getImage() | |
|
308 | return @mImg; | |
|
309 | end | |
|
310 | ||
|
311 | # | |
|
312 | # Abstract method used to draw the barcode image. | |
|
313 | # @param int $xres Horizontal resolution. | |
|
314 | # | |
|
315 | def DrawObject($xres) { | |
|
316 | # there is not implementation neded, is simply the asbsract function.# | |
|
317 | return false; | |
|
318 | end | |
|
319 | ||
|
320 | # | |
|
321 | # Draws the barcode border. | |
|
322 | # @access protected | |
|
323 | # | |
|
324 | protected function DrawBorder() | |
|
325 | ImageRectangle(@mImg, 0, 0, @mWidth-1, @mHeight-1, @mBrush); | |
|
326 | end | |
|
327 | ||
|
328 | # | |
|
329 | # Draws the alphanumeric code. | |
|
330 | # @param int $Font Font type. | |
|
331 | # @param int $xPos Horiziontal position. | |
|
332 | # @param int $yPos Vertical position. | |
|
333 | # @param int $Char Alphanumeric code to write. | |
|
334 | # @access protected | |
|
335 | # | |
|
336 | protected function DrawChar($Font, $xPos, $yPos, $Char) | |
|
337 | ImageString(@mImg,$Font,$xPos,$yPos,$Char,@mBrush); | |
|
338 | end | |
|
339 | ||
|
340 | # | |
|
341 | # Draws a character string. | |
|
342 | # @param int $Font Font type. | |
|
343 | # @param int $xPos Horiziontal position. | |
|
344 | # @param int $yPos Vertical position. | |
|
345 | # @param int $Char string to write. | |
|
346 | # @access protected | |
|
347 | # | |
|
348 | protected function DrawText($Font, $xPos, $yPos, $Char) | |
|
349 | ImageString(@mImg,$Font,$xPos,$yPos,$Char,@mBrush); | |
|
350 | end | |
|
351 | ||
|
352 | # | |
|
353 | # Draws a single barcode bar. | |
|
354 | # @param int $xPos Horiziontal position. | |
|
355 | # @param int $yPos Vertical position. | |
|
356 | # @param int $xSize Horizontal size. | |
|
357 | # @param int $xSize Vertical size. | |
|
358 | # @return bool trur in case of success, false otherwise. | |
|
359 | # @access protected | |
|
360 | # | |
|
361 | protected function DrawSingleBar($xPos, $yPos, $xSize, $ySize) | |
|
362 | if ($xPos>=0 && $xPos<=@mWidth && ($xPos+$xSize)<=@mWidth && | |
|
363 | $yPos>=0 && $yPos<=@mHeight && ($yPos+$ySize)<=@mHeight) | |
|
364 | for ($i=0;$i<$xSize;$i++) | |
|
365 | ImageLine(@mImg, $xPos+$i, $yPos, $xPos+$i, $yPos+$ySize, @mBrush); | |
|
366 | end | |
|
367 | return true; | |
|
368 | end | |
|
369 | return false; | |
|
370 | end | |
|
371 | ||
|
372 | # | |
|
373 | # Returns the current error message. | |
|
374 | # @return string error message. | |
|
375 | # | |
|
376 | def GetError() | |
|
377 | return @mError; | |
|
378 | end | |
|
379 | ||
|
380 | # | |
|
381 | # Returns the font height. | |
|
382 | # @param int $font font type. | |
|
383 | # @return int font height. | |
|
384 | # | |
|
385 | def GetFontHeight($font) | |
|
386 | return ImageFontHeight($font); | |
|
387 | end | |
|
388 | ||
|
389 | # | |
|
390 | # Returns the font width. | |
|
391 | # @param int $font font type. | |
|
392 | # @return int font width. | |
|
393 | # | |
|
394 | def GetFontWidth($font) | |
|
395 | return ImageFontWidth($font); | |
|
396 | end | |
|
397 | ||
|
398 | # | |
|
399 | # Set font type. | |
|
400 | # @param int $font font type. | |
|
401 | # | |
|
402 | def SetFont($font) | |
|
403 | @mFont = $font; | |
|
404 | end | |
|
405 | ||
|
406 | # | |
|
407 | # Returns barcode style. | |
|
408 | # @return int barcode style. | |
|
409 | # | |
|
410 | def GetStyle() | |
|
411 | return @mStyle; | |
|
412 | end | |
|
413 | ||
|
414 | # | |
|
415 | # Set barcode style. | |
|
416 | # @param int $Style barcode style. | |
|
417 | # | |
|
418 | def SetStyle ($Style) | |
|
419 | @mStyle = $Style; | |
|
420 | end | |
|
421 | ||
|
422 | # | |
|
423 | # Flush the barcode image. | |
|
424 | # | |
|
425 | def FlushObject() | |
|
426 | if ((@mStyle & BCS_BORDER)) | |
|
427 | @DrawBorder(); | |
|
428 | end | |
|
429 | if (@mStyle & BCS_IMAGE_PNG) | |
|
430 | Header("Content-Type: image/png"); | |
|
431 | ImagePng(@mImg); | |
|
432 | elsif (@mStyle & BCS_IMAGE_JPEG) | |
|
433 | Header("Content-Type: image/jpeg"); | |
|
434 | ImageJpeg(@mImg); | |
|
435 | end | |
|
436 | end | |
|
437 | ||
|
438 | # | |
|
439 | # Destroy the barcode image. | |
|
440 | # | |
|
441 | def DestroyObject() | |
|
442 | ImageDestroy(@mImg); | |
|
443 | end | |
|
444 | } | |
|
445 | ||
|
446 | #============================================================+ | |
|
447 | # END OF FILE | |
|
448 | #============================================================+ |
@@ -0,0 +1,393 | |||
|
1 | ||
|
2 | #============================================================+ | |
|
3 | # File name : c128aobject.rb | |
|
4 | # Begin : 2002-07-31 | |
|
5 | # Last Update : 2004-12-29 | |
|
6 | # Author : Karim Mribti [barcode@mribti.com] | |
|
7 | # Version : 0.0.8a 2001-04-01 (original code) | |
|
8 | # License : GNU LGPL (Lesser General Public License) 2.1 | |
|
9 | # http://www.gnu.org/copyleft/lesser.txt | |
|
10 | # Source Code : http://www.mribti.com/barcode/ | |
|
11 | # | |
|
12 | # Description : Code 128-A Barcode Render Class for PHP using | |
|
13 | # the GD graphics library. | |
|
14 | # Code 128-A is a continuous, multilevel and | |
|
15 | # include all upper case alphanumeric characters | |
|
16 | # and ASCII control characters. | |
|
17 | # | |
|
18 | # NOTE: | |
|
19 | # This version contains changes by Nicola Asuni: | |
|
20 | # - porting to Ruby | |
|
21 | # - code style and formatting | |
|
22 | # - automatic php documentation in PhpDocumentor Style | |
|
23 | # (www.phpdoc.org) | |
|
24 | # - minor bug fixing | |
|
25 | #============================================================+ | |
|
26 | ||
|
27 | # | |
|
28 | # Code 128-A Barcode Render Class for PHP using the GD graphics library.<br> | |
|
29 | # Code 128-A is a continuous, multilevel and include all upper case alphanumeric characters and ASCII control characters. | |
|
30 | # @author Karim Mribti, Nicola Asuni | |
|
31 | # @name BarcodeObject | |
|
32 | # @package com.tecnick.tcpdf | |
|
33 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
34 | # @since 2001-03-25 | |
|
35 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
36 | # | |
|
37 | ||
|
38 | # | |
|
39 | # Code 128-A Barcode Render Class for PHP using the GD graphics library.<br> | |
|
40 | # Code 128-A is a continuous, multilevel and include all upper case alphanumeric characters and ASCII control characters. | |
|
41 | # @author Karim Mribti, Nicola Asuni | |
|
42 | # @name BarcodeObject | |
|
43 | # @package com.tecnick.tcpdf | |
|
44 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
45 | # @since 2001-03-25 | |
|
46 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
47 | # | |
|
48 | class C128AObject extends BarcodeObject { | |
|
49 | ||
|
50 | # | |
|
51 | # Class Constructor. | |
|
52 | # @param int $Width Image width in pixels. | |
|
53 | # @param int $Height Image height in pixels. | |
|
54 | # @param int $Style Barcode style. | |
|
55 | # @param int $Value value to print on barcode. | |
|
56 | # | |
|
57 | def __construct($Width, $Height, $Style, $Value) | |
|
58 | parent::__construct($Width, $Height, $Style); | |
|
59 | @mValue = $Value; | |
|
60 | @mChars = " !\"#$%&'()*+�-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_"; | |
|
61 | @mCharSet = array ( | |
|
62 | "212222", # 00# | |
|
63 | "222122", # 01# | |
|
64 | "222221", # 02# | |
|
65 | "121223", # 03# | |
|
66 | "121322", # 04# | |
|
67 | "131222", # 05# | |
|
68 | "122213", # 06# | |
|
69 | "122312", # 07# | |
|
70 | "132212", # 08# | |
|
71 | "221213", # 09# | |
|
72 | "221312", # 10# | |
|
73 | "231212", # 11# | |
|
74 | "112232", # 12# | |
|
75 | "122132", # 13# | |
|
76 | "122231", # 14# | |
|
77 | "113222", # 15# | |
|
78 | "123122", # 16# | |
|
79 | "123221", # 17# | |
|
80 | "223211", # 18# | |
|
81 | "221132", # 19# | |
|
82 | "221231", # 20# | |
|
83 | "213212", # 21# | |
|
84 | "223112", # 22# | |
|
85 | "312131", # 23# | |
|
86 | "311222", # 24# | |
|
87 | "321122", # 25# | |
|
88 | "321221", # 26# | |
|
89 | "312212", # 27# | |
|
90 | "322112", # 28# | |
|
91 | "322211", # 29# | |
|
92 | "212123", # 30# | |
|
93 | "212321", # 31# | |
|
94 | "232121", # 32# | |
|
95 | "111323", # 33# | |
|
96 | "131123", # 34# | |
|
97 | "131321", # 35# | |
|
98 | "112313", # 36# | |
|
99 | "132113", # 37# | |
|
100 | "132311", # 38# | |
|
101 | "211313", # 39# | |
|
102 | "231113", # 40# | |
|
103 | "231311", # 41# | |
|
104 | "112133", # 42# | |
|
105 | "112331", # 43# | |
|
106 | "132131", # 44# | |
|
107 | "113123", # 45# | |
|
108 | "113321", # 46# | |
|
109 | "133121", # 47# | |
|
110 | "313121", # 48# | |
|
111 | "211331", # 49# | |
|
112 | "231131", # 50# | |
|
113 | "213113", # 51# | |
|
114 | "213311", # 52# | |
|
115 | "213131", # 53# | |
|
116 | "311123", # 54# | |
|
117 | "311321", # 55# | |
|
118 | "331121", # 56# | |
|
119 | "312113", # 57# | |
|
120 | "312311", # 58# | |
|
121 | "332111", # 59# | |
|
122 | "314111", # 60# | |
|
123 | "221411", # 61# | |
|
124 | "431111", # 62# | |
|
125 | "111224", # 63# | |
|
126 | "111422", # 64# | |
|
127 | "121124", # 65# | |
|
128 | "121421", # 66# | |
|
129 | "141122", # 67# | |
|
130 | "141221", # 68# | |
|
131 | "112214", # 69# | |
|
132 | "112412", # 70# | |
|
133 | "122114", # 71# | |
|
134 | "122411", # 72# | |
|
135 | "142112", # 73# | |
|
136 | "142211", # 74# | |
|
137 | "241211", # 75# | |
|
138 | "221114", # 76# | |
|
139 | "413111", # 77# | |
|
140 | "241112", # 78# | |
|
141 | "134111", # 79# | |
|
142 | "111242", # 80# | |
|
143 | "121142", # 81# | |
|
144 | "121241", # 82# | |
|
145 | "114212", # 83# | |
|
146 | "124112", # 84# | |
|
147 | "124211", # 85# | |
|
148 | "411212", # 86# | |
|
149 | "421112", # 87# | |
|
150 | "421211", # 88# | |
|
151 | "212141", # 89# | |
|
152 | "214121", # 90# | |
|
153 | "412121", # 91# | |
|
154 | "111143", # 92# | |
|
155 | "111341", # 93# | |
|
156 | "131141", # 94# | |
|
157 | "114113", # 95# | |
|
158 | "114311", # 96# | |
|
159 | "411113", # 97# | |
|
160 | "411311", # 98# | |
|
161 | "113141", # 99# | |
|
162 | "114131", # 100# | |
|
163 | "311141", # 101# | |
|
164 | "411131" # 102# | |
|
165 | ); | |
|
166 | end | |
|
167 | ||
|
168 | # | |
|
169 | # Returns the character index. | |
|
170 | # @param char $char character. | |
|
171 | # @return int character index or -1 in case of error. | |
|
172 | # @access private | |
|
173 | # | |
|
174 | def GetCharIndex($char) | |
|
175 | for ($i=0;$i<64;$i++) | |
|
176 | if (@mChars[$i] == $char) | |
|
177 | return $i; | |
|
178 | end | |
|
179 | end | |
|
180 | return -1; | |
|
181 | end | |
|
182 | ||
|
183 | # | |
|
184 | # Returns the bar size. | |
|
185 | # @param int $xres Horizontal resolution. | |
|
186 | # @param char $char Character. | |
|
187 | # @return int barcode size. | |
|
188 | # @access private | |
|
189 | # | |
|
190 | def GetBarSize($xres, $char) | |
|
191 | switch ($char) | |
|
192 | case '1' | |
|
193 | $cVal = BCD_C128_BAR_1; | |
|
194 | ||
|
195 | case '2' | |
|
196 | $cVal = BCD_C128_BAR_2; | |
|
197 | ||
|
198 | case '3' | |
|
199 | $cVal = BCD_C128_BAR_3; | |
|
200 | ||
|
201 | case '4' | |
|
202 | $cVal = BCD_C128_BAR_4; | |
|
203 | ||
|
204 | default | |
|
205 | $cVal = 0; | |
|
206 | end | |
|
207 | end | |
|
208 | return $cVal# $xres; | |
|
209 | end | |
|
210 | ||
|
211 | # | |
|
212 | # Returns barcode size. | |
|
213 | # @param int $xres Horizontal resolution. | |
|
214 | # @return barcode size. | |
|
215 | # @access private | |
|
216 | # | |
|
217 | def GetSize($xres) | |
|
218 | $len = @mValue.length; | |
|
219 | ||
|
220 | if ($len == 0) { | |
|
221 | @mError = "Null value"; | |
|
222 | return false; | |
|
223 | end | |
|
224 | $ret = 0; | |
|
225 | for ($i=0;$i<$len;$i++) | |
|
226 | if (($id = GetCharIndex(@mValue[$i])) == -1) | |
|
227 | @mError = "C128A not include the char '".@mValue[$i]."'"; | |
|
228 | return false; | |
|
229 | else | |
|
230 | $cset = @mCharSet[$id]; | |
|
231 | $ret += GetBarSize($xres, $cset[0]); | |
|
232 | $ret += GetBarSize($xres, $cset[1]); | |
|
233 | $ret += GetBarSize($xres, $cset[2]); | |
|
234 | $ret += GetBarSize($xres, $cset[3]); | |
|
235 | $ret += GetBarSize($xres, $cset[4]); | |
|
236 | $ret += GetBarSize($xres, $cset[5]); | |
|
237 | end | |
|
238 | end | |
|
239 | ||
|
240 | # length of Check character# | |
|
241 | $cset = GetCheckCharValue(); | |
|
242 | $CheckSize = 0; | |
|
243 | for ($i=0;$i<6;$i++) | |
|
244 | $CheckSize += GetBarSize($cset[$i], $xres); | |
|
245 | end | |
|
246 | $StartSize = 2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + BCD_C128_BAR_4*$xres; | |
|
247 | $StopSize = 2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + 2*BCD_C128_BAR_3*$xres; | |
|
248 | return $StartSize + $ret + $CheckSize + $StopSize; | |
|
249 | end | |
|
250 | ||
|
251 | # | |
|
252 | # Returns the check-char value. | |
|
253 | # @return string. | |
|
254 | # @access private | |
|
255 | # | |
|
256 | def GetCheckCharValue() | |
|
257 | $len = @mValue.length; | |
|
258 | $sum = 103; # 'A' type; | |
|
259 | for ($i=0;$i<$len;$i++) | |
|
260 | $sum += GetCharIndex(@mValue[$i])# ($i+1); | |
|
261 | end | |
|
262 | $check = $sum % 103; | |
|
263 | return @mCharSet[$check]; | |
|
264 | end | |
|
265 | ||
|
266 | # | |
|
267 | # Draws the start code. | |
|
268 | # @param int $DrawPos Drawing position. | |
|
269 | # @param int $yPos Vertical position. | |
|
270 | # @param int $ySize Vertical size. | |
|
271 | # @param int $xres Horizontal resolution. | |
|
272 | # @return int drawing position. | |
|
273 | # @access private | |
|
274 | # | |
|
275 | def DrawStart($DrawPos, $yPos, $ySize, $xres) | |
|
276 | # Start code is '211412'# | |
|
277 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('2', $xres) , $ySize); | |
|
278 | $DrawPos += GetBarSize('2', $xres); | |
|
279 | $DrawPos += GetBarSize('1', $xres); | |
|
280 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('1', $xres) , $ySize); | |
|
281 | $DrawPos += GetBarSize('1', $xres); | |
|
282 | $DrawPos += GetBarSize('4', $xres); | |
|
283 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('1', $xres) , $ySize); | |
|
284 | $DrawPos += GetBarSize('1', $xres); | |
|
285 | $DrawPos += GetBarSize('2', $xres); | |
|
286 | return $DrawPos; | |
|
287 | end | |
|
288 | ||
|
289 | # | |
|
290 | # Draws the stop code. | |
|
291 | # @param int $DrawPos Drawing position. | |
|
292 | # @param int $yPos Vertical position. | |
|
293 | # @param int $ySize Vertical size. | |
|
294 | # @param int $xres Horizontal resolution. | |
|
295 | # @return int drawing position. | |
|
296 | # @access private | |
|
297 | # | |
|
298 | def DrawStop($DrawPos, $yPos, $ySize, $xres) | |
|
299 | # Stop code is '2331112'# | |
|
300 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('2', $xres) , $ySize); | |
|
301 | $DrawPos += GetBarSize('2', $xres); | |
|
302 | $DrawPos += GetBarSize('3', $xres); | |
|
303 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('3', $xres) , $ySize); | |
|
304 | $DrawPos += GetBarSize('3', $xres); | |
|
305 | $DrawPos += GetBarSize('1', $xres); | |
|
306 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('1', $xres) , $ySize); | |
|
307 | $DrawPos += GetBarSize('1', $xres); | |
|
308 | $DrawPos += GetBarSize('1', $xres); | |
|
309 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('2', $xres) , $ySize); | |
|
310 | $DrawPos += GetBarSize('2', $xres); | |
|
311 | return $DrawPos; | |
|
312 | end | |
|
313 | ||
|
314 | # | |
|
315 | # Draws the check-char code. | |
|
316 | # @param int $DrawPos Drawing position. | |
|
317 | # @param int $yPos Vertical position. | |
|
318 | # @param int $ySize Vertical size. | |
|
319 | # @param int $xres Horizontal resolution. | |
|
320 | # @return int drawing position. | |
|
321 | # @access private | |
|
322 | # | |
|
323 | def DrawCheckChar($DrawPos, $yPos, $ySize, $xres) | |
|
324 | $cset = GetCheckCharValue(); | |
|
325 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[0], $xres) , $ySize); | |
|
326 | $DrawPos += GetBarSize($cset[0], $xres); | |
|
327 | $DrawPos += GetBarSize($cset[1], $xres); | |
|
328 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[2], $xres) , $ySize); | |
|
329 | $DrawPos += GetBarSize($cset[2], $xres); | |
|
330 | $DrawPos += GetBarSize($cset[3], $xres); | |
|
331 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[4], $xres) , $ySize); | |
|
332 | $DrawPos += GetBarSize($cset[4], $xres); | |
|
333 | $DrawPos += GetBarSize($cset[5], $xres); | |
|
334 | return $DrawPos; | |
|
335 | end | |
|
336 | ||
|
337 | # | |
|
338 | # Draws the barcode object. | |
|
339 | # @param int $xres Horizontal resolution. | |
|
340 | # @return bool true in case of success. | |
|
341 | # | |
|
342 | def DrawObject($xres) | |
|
343 | $len = @mValue.length; | |
|
344 | if (($size = GetSize($xres))==0) | |
|
345 | return false; | |
|
346 | end | |
|
347 | ||
|
348 | if (@mStyle & BCS_ALIGN_CENTER) $sPos = (integer)((@mWidth - $size ) / 2); | |
|
349 | elsif (@mStyle & BCS_ALIGN_RIGHT) $sPos = @mWidth - $size; | |
|
350 | else $sPos = 0; | |
|
351 | ||
|
352 | # Total height of bar code -Bars only-# | |
|
353 | if (@mStyle & BCS_DRAW_TEXT) $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2 - GetFontHeight(@mFont); | |
|
354 | else $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2; | |
|
355 | ||
|
356 | # Draw text# | |
|
357 | if (@mStyle & BCS_DRAW_TEXT) | |
|
358 | if (@mStyle & BCS_STRETCH_TEXT) | |
|
359 | for ($i=0;$i<$len;$i++) | |
|
360 | @DrawChar(@mFont, $sPos+(2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + BCD_C128_BAR_4*$xres)+($size/$len)*$i, | |
|
361 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue[$i]); | |
|
362 | else# Center# | |
|
363 | $text_width = GetFontWidth(@mFont)# @mValue.length; | |
|
364 | @DrawText(@mFont, $sPos+(($size-$text_width)/2)+(2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + BCD_C128_BAR_4*$xres), | |
|
365 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue); | |
|
366 | end | |
|
367 | end | |
|
368 | ||
|
369 | $cPos = 0; | |
|
370 | $DrawPos = @DrawStart($sPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
371 | do { | |
|
372 | $c = GetCharIndex(@mValue[$cPos]); | |
|
373 | $cset = @mCharSet[$c]; | |
|
374 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[0], $xres) , $ysize); | |
|
375 | $DrawPos += GetBarSize($cset[0], $xres); | |
|
376 | $DrawPos += GetBarSize($cset[1], $xres); | |
|
377 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[2], $xres) , $ysize); | |
|
378 | $DrawPos += GetBarSize($cset[2], $xres); | |
|
379 | $DrawPos += GetBarSize($cset[3], $xres); | |
|
380 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[4], $xres) , $ysize); | |
|
381 | $DrawPos += GetBarSize($cset[4], $xres); | |
|
382 | $DrawPos += GetBarSize($cset[5], $xres); | |
|
383 | $cPos += 1; | |
|
384 | end while ($cPos<$len); | |
|
385 | $DrawPos = @DrawCheckChar($DrawPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
386 | $DrawPos = @DrawStop($DrawPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
387 | return true; | |
|
388 | end | |
|
389 | } | |
|
390 | ||
|
391 | #============================================================+ | |
|
392 | # END OF FILE | |
|
393 | #============================================================+ |
@@ -0,0 +1,393 | |||
|
1 | ||
|
2 | #============================================================+ | |
|
3 | # File name : c128bobject.rb | |
|
4 | # Begin : 2002-07-31 | |
|
5 | # Last Update : 2004-12-29 | |
|
6 | # Author : Karim Mribti [barcode@mribti.com] | |
|
7 | # Version : 0.0.8a 2001-04-01 (original code) | |
|
8 | # License : GNU LGPL (Lesser General Public License) 2.1 | |
|
9 | # http://www.gnu.org/copyleft/lesser.txt | |
|
10 | # Source Code : http://www.mribti.com/barcode/ | |
|
11 | # | |
|
12 | # Description : Code 128-B Barcode Render Class for PHP using | |
|
13 | # the GD graphics library. | |
|
14 | # Code 128-B is a continuous, multilevel and full | |
|
15 | # ASCII code. | |
|
16 | # | |
|
17 | # NOTE: | |
|
18 | # This version contains changes by Nicola Asuni: | |
|
19 | # - porting to Ruby | |
|
20 | # - code style and formatting | |
|
21 | # - automatic php documentation in PhpDocumentor Style | |
|
22 | # (www.phpdoc.org) | |
|
23 | # - minor bug fixing | |
|
24 | #============================================================+ | |
|
25 | ||
|
26 | # | |
|
27 | # Code 128-B Barcode Render Class for PHP using the GD graphics library.<br> | |
|
28 | # Code 128-B is a continuous, multilevel and full ASCII code. | |
|
29 | # @author Karim Mribti, Nicola Asuni | |
|
30 | # @name BarcodeObject | |
|
31 | # @package com.tecnick.tcpdf | |
|
32 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
33 | # @since 2001-03-25 | |
|
34 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
35 | # | |
|
36 | ||
|
37 | # | |
|
38 | # Code 128-B Barcode Render Class for PHP using the GD graphics library.<br> | |
|
39 | # Code 128-B is a continuous, multilevel and full ASCII code. | |
|
40 | # @author Karim Mribti, Nicola Asuni | |
|
41 | # @name BarcodeObject | |
|
42 | # @package com.tecnick.tcpdf | |
|
43 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
44 | # @since 2001-03-25 | |
|
45 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
46 | # | |
|
47 | class C128BObject extends BarcodeObject { | |
|
48 | ||
|
49 | # | |
|
50 | # Class Constructor. | |
|
51 | # @param int $Width Image width in pixels. | |
|
52 | # @param int $Height Image height in pixels. | |
|
53 | # @param int $Style Barcode style. | |
|
54 | # @param int $Value value to print on barcode. | |
|
55 | # | |
|
56 | def __construct($Width, $Height, $Style, $Value) | |
|
57 | parent::__construct($Width, $Height, $Style); | |
|
58 | @mValue = $Value; | |
|
59 | @mChars = " !\"#$%&'()*+�-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{ }~"; | |
|
60 | @mCharSet = array ( | |
|
61 | "212222", # 00# | |
|
62 | "222122", # 01# | |
|
63 | "222221", # 02# | |
|
64 | "121223", # 03# | |
|
65 | "121322", # 04# | |
|
66 | "131222", # 05# | |
|
67 | "122213", # 06# | |
|
68 | "122312", # 07# | |
|
69 | "132212", # 08# | |
|
70 | "221213", # 09# | |
|
71 | "221312", # 10# | |
|
72 | "231212", # 11# | |
|
73 | "112232", # 12# | |
|
74 | "122132", # 13# | |
|
75 | "122231", # 14# | |
|
76 | "113222", # 15# | |
|
77 | "123122", # 16# | |
|
78 | "123221", # 17# | |
|
79 | "223211", # 18# | |
|
80 | "221132", # 19# | |
|
81 | "221231", # 20# | |
|
82 | "213212", # 21# | |
|
83 | "223112", # 22# | |
|
84 | "312131", # 23# | |
|
85 | "311222", # 24# | |
|
86 | "321122", # 25# | |
|
87 | "321221", # 26# | |
|
88 | "312212", # 27# | |
|
89 | "322112", # 28# | |
|
90 | "322211", # 29# | |
|
91 | "212123", # 30# | |
|
92 | "212321", # 31# | |
|
93 | "232121", # 32# | |
|
94 | "111323", # 33# | |
|
95 | "131123", # 34# | |
|
96 | "131321", # 35# | |
|
97 | "112313", # 36# | |
|
98 | "132113", # 37# | |
|
99 | "132311", # 38# | |
|
100 | "211313", # 39# | |
|
101 | "231113", # 40# | |
|
102 | "231311", # 41# | |
|
103 | "112133", # 42# | |
|
104 | "112331", # 43# | |
|
105 | "132131", # 44# | |
|
106 | "113123", # 45# | |
|
107 | "113321", # 46# | |
|
108 | "133121", # 47# | |
|
109 | "313121", # 48# | |
|
110 | "211331", # 49# | |
|
111 | "231131", # 50# | |
|
112 | "213113", # 51# | |
|
113 | "213311", # 52# | |
|
114 | "213131", # 53# | |
|
115 | "311123", # 54# | |
|
116 | "311321", # 55# | |
|
117 | "331121", # 56# | |
|
118 | "312113", # 57# | |
|
119 | "312311", # 58# | |
|
120 | "332111", # 59# | |
|
121 | "314111", # 60# | |
|
122 | "221411", # 61# | |
|
123 | "431111", # 62# | |
|
124 | "111224", # 63# | |
|
125 | "111422", # 64# | |
|
126 | "121124", # 65# | |
|
127 | "121421", # 66# | |
|
128 | "141122", # 67# | |
|
129 | "141221", # 68# | |
|
130 | "112214", # 69# | |
|
131 | "112412", # 70# | |
|
132 | "122114", # 71# | |
|
133 | "122411", # 72# | |
|
134 | "142112", # 73# | |
|
135 | "142211", # 74# | |
|
136 | "241211", # 75# | |
|
137 | "221114", # 76# | |
|
138 | "413111", # 77# | |
|
139 | "241112", # 78# | |
|
140 | "134111", # 79# | |
|
141 | "111242", # 80# | |
|
142 | "121142", # 81# | |
|
143 | "121241", # 82# | |
|
144 | "114212", # 83# | |
|
145 | "124112", # 84# | |
|
146 | "124211", # 85# | |
|
147 | "411212", # 86# | |
|
148 | "421112", # 87# | |
|
149 | "421211", # 88# | |
|
150 | "212141", # 89# | |
|
151 | "214121", # 90# | |
|
152 | "412121", # 91# | |
|
153 | "111143", # 92# | |
|
154 | "111341", # 93# | |
|
155 | "131141", # 94# | |
|
156 | "114113", # 95# | |
|
157 | "114311", # 96# | |
|
158 | "411113", # 97# | |
|
159 | "411311", # 98# | |
|
160 | "113141", # 99# | |
|
161 | "114131", # 100# | |
|
162 | "311141", # 101# | |
|
163 | "411131" # 102# | |
|
164 | ); | |
|
165 | end | |
|
166 | ||
|
167 | # | |
|
168 | # Returns the character index. | |
|
169 | # @param char $char character. | |
|
170 | # @return int character index or -1 in case of error. | |
|
171 | # @access private | |
|
172 | # | |
|
173 | def GetCharIndex($char) | |
|
174 | for ($i=0;$i<95;$i++) | |
|
175 | if (@mChars[$i] == $char) | |
|
176 | return $i; | |
|
177 | end | |
|
178 | end | |
|
179 | return -1; | |
|
180 | end | |
|
181 | ||
|
182 | # | |
|
183 | # Returns the bar size. | |
|
184 | # @param int $xres Horizontal resolution. | |
|
185 | # @param char $char Character. | |
|
186 | # @return int barcode size. | |
|
187 | # @access private | |
|
188 | # | |
|
189 | def GetBarSize($xres, $char) | |
|
190 | switch ($char) | |
|
191 | case '1' | |
|
192 | $cVal = BCD_C128_BAR_1; | |
|
193 | ||
|
194 | case '2' | |
|
195 | $cVal = BCD_C128_BAR_2; | |
|
196 | ||
|
197 | case '3' | |
|
198 | $cVal = BCD_C128_BAR_3; | |
|
199 | ||
|
200 | case '4' | |
|
201 | $cVal = BCD_C128_BAR_4; | |
|
202 | ||
|
203 | default | |
|
204 | $cVal = 0; | |
|
205 | end | |
|
206 | end | |
|
207 | return $cVal# $xres; | |
|
208 | end | |
|
209 | ||
|
210 | # | |
|
211 | # Returns barcode size. | |
|
212 | # @param int $xres Horizontal resolution. | |
|
213 | # @return barcode size. | |
|
214 | # @access private | |
|
215 | # | |
|
216 | def GetSize($xres) | |
|
217 | $len = @mValue.length; | |
|
218 | ||
|
219 | if ($len == 0) { | |
|
220 | @mError = "Null value"; | |
|
221 | return false; | |
|
222 | end | |
|
223 | $ret = 0; | |
|
224 | for ($i=0;$i<$len;$i++) | |
|
225 | if (($id = GetCharIndex(@mValue[$i])) == -1) | |
|
226 | @mError = "C128B not include the char '".@mValue[$i]."'"; | |
|
227 | return false; | |
|
228 | else | |
|
229 | $cset = @mCharSet[$id]; | |
|
230 | $ret += GetBarSize($xres, $cset[0]); | |
|
231 | $ret += GetBarSize($xres, $cset[1]); | |
|
232 | $ret += GetBarSize($xres, $cset[2]); | |
|
233 | $ret += GetBarSize($xres, $cset[3]); | |
|
234 | $ret += GetBarSize($xres, $cset[4]); | |
|
235 | $ret += GetBarSize($xres, $cset[5]); | |
|
236 | end | |
|
237 | end | |
|
238 | # length of Check character# | |
|
239 | $cset = GetCheckCharValue(); | |
|
240 | $CheckSize = 0; | |
|
241 | for ($i=0;$i<6;$i++) | |
|
242 | $CheckSize += GetBarSize($cset[$i], $xres); | |
|
243 | end | |
|
244 | ||
|
245 | $StartSize = 2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + BCD_C128_BAR_4*$xres; | |
|
246 | $StopSize = 2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + 2*BCD_C128_BAR_3*$xres; | |
|
247 | ||
|
248 | return $StartSize + $ret + $CheckSize + $StopSize; | |
|
249 | end | |
|
250 | ||
|
251 | # | |
|
252 | # Returns the check-char value. | |
|
253 | # @return string. | |
|
254 | # @access private | |
|
255 | # | |
|
256 | def GetCheckCharValue() | |
|
257 | $len = @mValue.length; | |
|
258 | $sum = 104; # 'B' type; | |
|
259 | for ($i=0;$i<$len;$i++) | |
|
260 | $sum += GetCharIndex(@mValue[$i])# ($i+1); | |
|
261 | end | |
|
262 | $check = $sum % 103; | |
|
263 | return @mCharSet[$check]; | |
|
264 | end | |
|
265 | ||
|
266 | # | |
|
267 | # Draws the start code. | |
|
268 | # @param int $DrawPos Drawing position. | |
|
269 | # @param int $yPos Vertical position. | |
|
270 | # @param int $ySize Vertical size. | |
|
271 | # @param int $xres Horizontal resolution. | |
|
272 | # @return int drawing position. | |
|
273 | # @access private | |
|
274 | # | |
|
275 | def DrawStart($DrawPos, $yPos, $ySize, $xres) | |
|
276 | # Start code is '211214'# | |
|
277 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('2', $xres), $ySize); | |
|
278 | $DrawPos += GetBarSize('2', $xres); | |
|
279 | $DrawPos += GetBarSize('1', $xres); | |
|
280 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('1', $xres), $ySize); | |
|
281 | $DrawPos += GetBarSize('1', $xres); | |
|
282 | $DrawPos += GetBarSize('2', $xres); | |
|
283 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('1', $xres), $ySize); | |
|
284 | $DrawPos += GetBarSize('1', $xres); | |
|
285 | $DrawPos += GetBarSize('4', $xres); | |
|
286 | return $DrawPos; | |
|
287 | end | |
|
288 | ||
|
289 | # | |
|
290 | # Draws the stop code. | |
|
291 | # @param int $DrawPos Drawing position. | |
|
292 | # @param int $yPos Vertical position. | |
|
293 | # @param int $ySize Vertical size. | |
|
294 | # @param int $xres Horizontal resolution. | |
|
295 | # @return int drawing position. | |
|
296 | # @access private | |
|
297 | # | |
|
298 | def DrawStop($DrawPos, $yPos, $ySize, $xres) | |
|
299 | # Stop code is '2331112'# | |
|
300 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('2', $xres) , $ySize); | |
|
301 | $DrawPos += GetBarSize('2', $xres); | |
|
302 | $DrawPos += GetBarSize('3', $xres); | |
|
303 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('3', $xres) , $ySize); | |
|
304 | $DrawPos += GetBarSize('3', $xres); | |
|
305 | $DrawPos += GetBarSize('1', $xres); | |
|
306 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('1', $xres) , $ySize); | |
|
307 | $DrawPos += GetBarSize('1', $xres); | |
|
308 | $DrawPos += GetBarSize('1', $xres); | |
|
309 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('2', $xres) , $ySize); | |
|
310 | $DrawPos += GetBarSize('2', $xres); | |
|
311 | return $DrawPos; | |
|
312 | end | |
|
313 | ||
|
314 | # | |
|
315 | # Draws the check-char code. | |
|
316 | # @param int $DrawPos Drawing position. | |
|
317 | # @param int $yPos Vertical position. | |
|
318 | # @param int $ySize Vertical size. | |
|
319 | # @param int $xres Horizontal resolution. | |
|
320 | # @return int drawing position. | |
|
321 | # @access private | |
|
322 | # | |
|
323 | def DrawCheckChar($DrawPos, $yPos, $ySize, $xres) | |
|
324 | $cset = GetCheckCharValue(); | |
|
325 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[0], $xres) , $ySize); | |
|
326 | $DrawPos += GetBarSize($cset[0], $xres); | |
|
327 | $DrawPos += GetBarSize($cset[1], $xres); | |
|
328 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[2], $xres) , $ySize); | |
|
329 | $DrawPos += GetBarSize($cset[2], $xres); | |
|
330 | $DrawPos += GetBarSize($cset[3], $xres); | |
|
331 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[4], $xres) , $ySize); | |
|
332 | $DrawPos += GetBarSize($cset[4], $xres); | |
|
333 | $DrawPos += GetBarSize($cset[5], $xres); | |
|
334 | return $DrawPos; | |
|
335 | end | |
|
336 | ||
|
337 | # | |
|
338 | # Draws the barcode object. | |
|
339 | # @param int $xres Horizontal resolution. | |
|
340 | # @return bool true in case of success. | |
|
341 | # | |
|
342 | def DrawObject($xres) | |
|
343 | $len = @mValue.length; | |
|
344 | if (($size = GetSize($xres))==0) | |
|
345 | return false; | |
|
346 | end | |
|
347 | ||
|
348 | if (@mStyle & BCS_ALIGN_CENTER) $sPos = (integer)((@mWidth - $size ) / 2); | |
|
349 | elsif (@mStyle & BCS_ALIGN_RIGHT) $sPos = @mWidth - $size; | |
|
350 | else $sPos = 0; | |
|
351 | ||
|
352 | # Total height of bar code -Bars only-# | |
|
353 | if (@mStyle & BCS_DRAW_TEXT) $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2 - GetFontHeight(@mFont); | |
|
354 | else $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2; | |
|
355 | ||
|
356 | # Draw text# | |
|
357 | if (@mStyle & BCS_DRAW_TEXT) | |
|
358 | if (@mStyle & BCS_STRETCH_TEXT) | |
|
359 | for ($i=0;$i<$len;$i++) | |
|
360 | @DrawChar(@mFont, $sPos+(2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + BCD_C128_BAR_4*$xres)+($size/$len)*$i, | |
|
361 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue[$i]); | |
|
362 | else# Center# | |
|
363 | $text_width = GetFontWidth(@mFont)# @mValue.length; | |
|
364 | @DrawText(@mFont, $sPos+(($size-$text_width)/2)+(2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + BCD_C128_BAR_4*$xres), | |
|
365 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue); | |
|
366 | end | |
|
367 | end | |
|
368 | ||
|
369 | $cPos = 0; | |
|
370 | $DrawPos = @DrawStart($sPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
371 | do { | |
|
372 | $c = GetCharIndex(@mValue[$cPos]); | |
|
373 | $cset = @mCharSet[$c]; | |
|
374 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[0], $xres) , $ysize); | |
|
375 | $DrawPos += GetBarSize($cset[0], $xres); | |
|
376 | $DrawPos += GetBarSize($cset[1], $xres); | |
|
377 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[2], $xres) , $ysize); | |
|
378 | $DrawPos += GetBarSize($cset[2], $xres); | |
|
379 | $DrawPos += GetBarSize($cset[3], $xres); | |
|
380 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[4], $xres) , $ysize); | |
|
381 | $DrawPos += GetBarSize($cset[4], $xres); | |
|
382 | $DrawPos += GetBarSize($cset[5], $xres); | |
|
383 | $cPos += 1; | |
|
384 | end while ($cPos<$len); | |
|
385 | $DrawPos = @DrawCheckChar($DrawPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
386 | $DrawPos = @DrawStop($DrawPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
387 | return true; | |
|
388 | end | |
|
389 | } | |
|
390 | ||
|
391 | #============================================================+ | |
|
392 | # END OF FILE | |
|
393 | #============================================================+ |
@@ -0,0 +1,414 | |||
|
1 | ||
|
2 | #============================================================+ | |
|
3 | # File name : c128cobject.rb | |
|
4 | # Begin : 2002-07-31 | |
|
5 | # Last Update : 2004-12-29 | |
|
6 | # Author : Karim Mribti [barcode@mribti.com] | |
|
7 | # : Sam Michaels [swampgas@swampgas.org] | |
|
8 | # : Nicola Asuni [info@tecnick.com] | |
|
9 | # Version : 0.0.8a 2001-04-01 (original code) | |
|
10 | # License : GNU LGPL (Lesser General Public License) 2.1 | |
|
11 | # http://www.gnu.org/copyleft/lesser.txt | |
|
12 | # Source Code : http://www.mribti.com/barcode/ | |
|
13 | # | |
|
14 | # Description : Code 128-C Barcode Render Class for PHP using | |
|
15 | # the GD graphics library. | |
|
16 | # Code 128-C is numeric only and provides the | |
|
17 | # most efficiency. | |
|
18 | # | |
|
19 | # NOTE: | |
|
20 | # This version contains changes by Nicola Asuni: | |
|
21 | # - porting to Ruby | |
|
22 | # - code style and formatting | |
|
23 | # - automatic php documentation in PhpDocumentor Style | |
|
24 | # (www.phpdoc.org) | |
|
25 | # - minor bug fixing | |
|
26 | #============================================================+ | |
|
27 | ||
|
28 | # | |
|
29 | # Code 128-C Barcode Render Class for PHP using the GD graphics library.<br> | |
|
30 | # Code 128-C is numeric only and provides the most efficiency. | |
|
31 | # @author Karim Mribti, Nicola Asuni | |
|
32 | # @name BarcodeObject | |
|
33 | # @package com.tecnick.tcpdf | |
|
34 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
35 | # @since 2001-03-25 | |
|
36 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
37 | # | |
|
38 | ||
|
39 | # | |
|
40 | # Code 128-C Barcode Render Class for PHP using the GD graphics library.<br> | |
|
41 | # Code 128-C is numeric only and provides the most efficiency. | |
|
42 | # @author Karim Mribti, Nicola Asuni | |
|
43 | # @name BarcodeObject | |
|
44 | # @package com.tecnick.tcpdf | |
|
45 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
46 | # @since 2001-03-25 | |
|
47 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
48 | # | |
|
49 | class C128CObject extends BarcodeObject { | |
|
50 | ||
|
51 | # | |
|
52 | # Class Constructor. | |
|
53 | # @param int $Width Image width in pixels. | |
|
54 | # @param int $Height Image height in pixels. | |
|
55 | # @param int $Style Barcode style. | |
|
56 | # @param int $Value value to print on barcode. | |
|
57 | # | |
|
58 | def __construct($Width, $Height, $Style, $Value) | |
|
59 | parent::__construct($Width, $Height, $Style); | |
|
60 | @mValue = $Value; | |
|
61 | @mChars = array ( | |
|
62 | "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", | |
|
63 | "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", | |
|
64 | "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", | |
|
65 | "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", | |
|
66 | "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", | |
|
67 | "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", | |
|
68 | "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", | |
|
69 | "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", | |
|
70 | "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", | |
|
71 | "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", | |
|
72 | ); | |
|
73 | @mCharSet = array ( | |
|
74 | "212222", # 00# | |
|
75 | "222122", # 01# | |
|
76 | "222221", # 02# | |
|
77 | "121223", # 03# | |
|
78 | "121322", # 04# | |
|
79 | "131222", # 05# | |
|
80 | "122213", # 06# | |
|
81 | "122312", # 07# | |
|
82 | "132212", # 08# | |
|
83 | "221213", # 09# | |
|
84 | "221312", # 10# | |
|
85 | "231212", # 11# | |
|
86 | "112232", # 12# | |
|
87 | "122132", # 13# | |
|
88 | "122231", # 14# | |
|
89 | "113222", # 15# | |
|
90 | "123122", # 16# | |
|
91 | "123221", # 17# | |
|
92 | "223211", # 18# | |
|
93 | "221132", # 19# | |
|
94 | "221231", # 20# | |
|
95 | "213212", # 21# | |
|
96 | "223112", # 22# | |
|
97 | "312131", # 23# | |
|
98 | "311222", # 24# | |
|
99 | "321122", # 25# | |
|
100 | "321221", # 26# | |
|
101 | "312212", # 27# | |
|
102 | "322112", # 28# | |
|
103 | "322211", # 29# | |
|
104 | "212123", # 30# | |
|
105 | "212321", # 31# | |
|
106 | "232121", # 32# | |
|
107 | "111323", # 33# | |
|
108 | "131123", # 34# | |
|
109 | "131321", # 35# | |
|
110 | "112313", # 36# | |
|
111 | "132113", # 37# | |
|
112 | "132311", # 38# | |
|
113 | "211313", # 39# | |
|
114 | "231113", # 40# | |
|
115 | "231311", # 41# | |
|
116 | "112133", # 42# | |
|
117 | "112331", # 43# | |
|
118 | "132131", # 44# | |
|
119 | "113123", # 45# | |
|
120 | "113321", # 46# | |
|
121 | "133121", # 47# | |
|
122 | "313121", # 48# | |
|
123 | "211331", # 49# | |
|
124 | "231131", # 50# | |
|
125 | "213113", # 51# | |
|
126 | "213311", # 52# | |
|
127 | "213131", # 53# | |
|
128 | "311123", # 54# | |
|
129 | "311321", # 55# | |
|
130 | "331121", # 56# | |
|
131 | "312113", # 57# | |
|
132 | "312311", # 58# | |
|
133 | "332111", # 59# | |
|
134 | "314111", # 60# | |
|
135 | "221411", # 61# | |
|
136 | "431111", # 62# | |
|
137 | "111224", # 63# | |
|
138 | "111422", # 64# | |
|
139 | "121124", # 65# | |
|
140 | "121421", # 66# | |
|
141 | "141122", # 67# | |
|
142 | "141221", # 68# | |
|
143 | "112214", # 69# | |
|
144 | "112412", # 70# | |
|
145 | "122114", # 71# | |
|
146 | "122411", # 72# | |
|
147 | "142112", # 73# | |
|
148 | "142211", # 74# | |
|
149 | "241211", # 75# | |
|
150 | "221114", # 76# | |
|
151 | "413111", # 77# | |
|
152 | "241112", # 78# | |
|
153 | "134111", # 79# | |
|
154 | "111242", # 80# | |
|
155 | "121142", # 81# | |
|
156 | "121241", # 82# | |
|
157 | "114212", # 83# | |
|
158 | "124112", # 84# | |
|
159 | "124211", # 85# | |
|
160 | "411212", # 86# | |
|
161 | "421112", # 87# | |
|
162 | "421211", # 88# | |
|
163 | "212141", # 89# | |
|
164 | "214121", # 90# | |
|
165 | "412121", # 91# | |
|
166 | "111143", # 92# | |
|
167 | "111341", # 93# | |
|
168 | "131141", # 94# | |
|
169 | "114113", # 95# | |
|
170 | "114311", # 96# | |
|
171 | "411113", # 97# | |
|
172 | "411311", # 98# | |
|
173 | "113141", # 99# | |
|
174 | ); | |
|
175 | end | |
|
176 | ||
|
177 | # | |
|
178 | # Returns the character index. | |
|
179 | # @param char $char character. | |
|
180 | # @return int character index or -1 in case of error. | |
|
181 | # @access private | |
|
182 | # | |
|
183 | def GetCharIndex($char) | |
|
184 | for ($i=0;$i<100;$i++) | |
|
185 | if (@mChars[$i] == $char) | |
|
186 | return $i; | |
|
187 | end | |
|
188 | end | |
|
189 | return -1; | |
|
190 | end | |
|
191 | ||
|
192 | # | |
|
193 | # Returns the bar size. | |
|
194 | # @param int $xres Horizontal resolution. | |
|
195 | # @param char $char Character. | |
|
196 | # @return int barcode size. | |
|
197 | # @access private | |
|
198 | # | |
|
199 | def GetBarSize($xres, $char) | |
|
200 | switch ($char) | |
|
201 | case '1' | |
|
202 | $cVal = BCD_C128_BAR_1; | |
|
203 | ||
|
204 | case '2' | |
|
205 | $cVal = BCD_C128_BAR_2; | |
|
206 | ||
|
207 | case '3' | |
|
208 | $cVal = BCD_C128_BAR_3; | |
|
209 | ||
|
210 | case '4' | |
|
211 | $cVal = BCD_C128_BAR_4; | |
|
212 | ||
|
213 | default | |
|
214 | $cVal = 0; | |
|
215 | end | |
|
216 | end | |
|
217 | return $cVal# $xres; | |
|
218 | end | |
|
219 | ||
|
220 | # | |
|
221 | # Returns barcode size. | |
|
222 | # @param int $xres Horizontal resolution. | |
|
223 | # @return barcode size. | |
|
224 | # @access private | |
|
225 | # | |
|
226 | def GetSize($xres) | |
|
227 | $len = @mValue.length; | |
|
228 | ||
|
229 | if ($len == 0) { | |
|
230 | @mError = "Null value"; | |
|
231 | return false; | |
|
232 | end | |
|
233 | $ret = 0; | |
|
234 | ||
|
235 | for ($i=0;$i<$len;$i++) | |
|
236 | if ((@mValue[$i][0] < 48) || (@mValue[$i][0] > 57)) | |
|
237 | @mError = "Code-128C is numeric only"; | |
|
238 | return false; | |
|
239 | end | |
|
240 | end | |
|
241 | ||
|
242 | if (($len%2) != 0) | |
|
243 | @mError = "The length of barcode value must be even. You must pad the number with zeros."; | |
|
244 | return false; | |
|
245 | end | |
|
246 | ||
|
247 | for ($i=0;$i<$len;$i+=2) | |
|
248 | $id = GetCharIndex(@mValue[$i].@mValue[$i+1]); | |
|
249 | $cset = @mCharSet[$id]; | |
|
250 | $ret += GetBarSize($xres, $cset[0]); | |
|
251 | $ret += GetBarSize($xres, $cset[1]); | |
|
252 | $ret += GetBarSize($xres, $cset[2]); | |
|
253 | $ret += GetBarSize($xres, $cset[3]); | |
|
254 | $ret += GetBarSize($xres, $cset[4]); | |
|
255 | $ret += GetBarSize($xres, $cset[5]); | |
|
256 | end | |
|
257 | # length of Check character# | |
|
258 | $cset = GetCheckCharValue(); | |
|
259 | $CheckSize = 0; | |
|
260 | for ($i=0;$i<6;$i++) | |
|
261 | $CheckSize += GetBarSize($cset[$i], $xres); | |
|
262 | end | |
|
263 | ||
|
264 | $StartSize = 2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + BCD_C128_BAR_4*$xres; | |
|
265 | $StopSize = 2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + 2*BCD_C128_BAR_3*$xres; | |
|
266 | return $StartSize + $ret + $CheckSize + $StopSize; | |
|
267 | end | |
|
268 | ||
|
269 | # | |
|
270 | # Returns the check-char value. | |
|
271 | # @return string. | |
|
272 | # @access private | |
|
273 | # | |
|
274 | def GetCheckCharValue() | |
|
275 | $len = @mValue.length; | |
|
276 | $sum = 105; # 'C' type; | |
|
277 | $m = 0; | |
|
278 | for ($i=0;$i<$len;$i+=2) | |
|
279 | $m += 1; | |
|
280 | $sum += GetCharIndex(@mValue[$i].@mValue[$i+1])# $m; | |
|
281 | end | |
|
282 | $check = $sum % 103; | |
|
283 | return @mCharSet[$check]; | |
|
284 | end | |
|
285 | ||
|
286 | # | |
|
287 | # Draws the start code. | |
|
288 | # @param int $DrawPos Drawing position. | |
|
289 | # @param int $yPos Vertical position. | |
|
290 | # @param int $ySize Vertical size. | |
|
291 | # @param int $xres Horizontal resolution. | |
|
292 | # @return int drawing position. | |
|
293 | # @access private | |
|
294 | # | |
|
295 | def DrawStart($DrawPos, $yPos, $ySize, $xres) | |
|
296 | # Start code is '211232'# | |
|
297 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('2', $xres) , $ySize); | |
|
298 | $DrawPos += GetBarSize('2', $xres); | |
|
299 | $DrawPos += GetBarSize('1', $xres); | |
|
300 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('1', $xres) , $ySize); | |
|
301 | $DrawPos += GetBarSize('1', $xres); | |
|
302 | $DrawPos += GetBarSize('2', $xres); | |
|
303 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('3', $xres) , $ySize); | |
|
304 | $DrawPos += GetBarSize('3', $xres); | |
|
305 | $DrawPos += GetBarSize('2', $xres); | |
|
306 | return $DrawPos; | |
|
307 | end | |
|
308 | ||
|
309 | # | |
|
310 | # Draws the stop code. | |
|
311 | # @param int $DrawPos Drawing position. | |
|
312 | # @param int $yPos Vertical position. | |
|
313 | # @param int $ySize Vertical size. | |
|
314 | # @param int $xres Horizontal resolution. | |
|
315 | # @return int drawing position. | |
|
316 | # @access private | |
|
317 | # | |
|
318 | def DrawStop($DrawPos, $yPos, $ySize, $xres) | |
|
319 | # Stop code is '2331112'# | |
|
320 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('2', $xres) , $ySize); | |
|
321 | $DrawPos += GetBarSize('2', $xres); | |
|
322 | $DrawPos += GetBarSize('3', $xres); | |
|
323 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('3', $xres) , $ySize); | |
|
324 | $DrawPos += GetBarSize('3', $xres); | |
|
325 | $DrawPos += GetBarSize('1', $xres); | |
|
326 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('1', $xres) , $ySize); | |
|
327 | $DrawPos += GetBarSize('1', $xres); | |
|
328 | $DrawPos += GetBarSize('1', $xres); | |
|
329 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize('2', $xres) , $ySize); | |
|
330 | $DrawPos += GetBarSize('2', $xres); | |
|
331 | return $DrawPos; | |
|
332 | end | |
|
333 | ||
|
334 | # | |
|
335 | # Draws the check-char code. | |
|
336 | # @param int $DrawPos Drawing position. | |
|
337 | # @param int $yPos Vertical position. | |
|
338 | # @param int $ySize Vertical size. | |
|
339 | # @param int $xres Horizontal resolution. | |
|
340 | # @return int drawing position. | |
|
341 | # @access private | |
|
342 | # | |
|
343 | def DrawCheckChar($DrawPos, $yPos, $ySize, $xres) | |
|
344 | $cset = GetCheckCharValue(); | |
|
345 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[0], $xres) , $ySize); | |
|
346 | $DrawPos += GetBarSize($cset[0], $xres); | |
|
347 | $DrawPos += GetBarSize($cset[1], $xres); | |
|
348 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[2], $xres) , $ySize); | |
|
349 | $DrawPos += GetBarSize($cset[2], $xres); | |
|
350 | $DrawPos += GetBarSize($cset[3], $xres); | |
|
351 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[4], $xres) , $ySize); | |
|
352 | $DrawPos += GetBarSize($cset[4], $xres); | |
|
353 | $DrawPos += GetBarSize($cset[5], $xres); | |
|
354 | return $DrawPos; | |
|
355 | end | |
|
356 | ||
|
357 | # | |
|
358 | # Draws the barcode object. | |
|
359 | # @param int $xres Horizontal resolution. | |
|
360 | # @return bool true in case of success. | |
|
361 | # | |
|
362 | def DrawObject($xres) | |
|
363 | $len = @mValue.length; | |
|
364 | if (($size = GetSize($xres))==0) | |
|
365 | return false; | |
|
366 | end | |
|
367 | ||
|
368 | if (@mStyle & BCS_ALIGN_CENTER) $sPos = (integer)((@mWidth - $size ) / 2); | |
|
369 | elsif (@mStyle & BCS_ALIGN_RIGHT) $sPos = @mWidth - $size; | |
|
370 | else $sPos = 0; | |
|
371 | ||
|
372 | # Total height of bar code -Bars only-# | |
|
373 | if (@mStyle & BCS_DRAW_TEXT) $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2 - GetFontHeight(@mFont); | |
|
374 | else $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2; | |
|
375 | ||
|
376 | # Draw text# | |
|
377 | if (@mStyle & BCS_DRAW_TEXT) | |
|
378 | if (@mStyle & BCS_STRETCH_TEXT) | |
|
379 | for ($i=0;$i<$len;$i++) | |
|
380 | @DrawChar(@mFont, $sPos+(2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + BCD_C128_BAR_4*$xres)+($size/$len)*$i, | |
|
381 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue[$i]); | |
|
382 | else# Center# | |
|
383 | $text_width = GetFontWidth(@mFont) * @mValue.length; | |
|
384 | @DrawText(@mFont, $sPos+(($size-$text_width)/2)+(2*BCD_C128_BAR_2*$xres + 3*BCD_C128_BAR_1*$xres + BCD_C128_BAR_4*$xres), | |
|
385 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue); | |
|
386 | end | |
|
387 | end | |
|
388 | ||
|
389 | $cPos = 0; | |
|
390 | $DrawPos = @DrawStart($sPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
391 | do { | |
|
392 | $c = GetCharIndex(@mValue[$cPos].@mValue[$cPos+1]); | |
|
393 | $cset = @mCharSet[$c]; | |
|
394 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[0], $xres) , $ysize); | |
|
395 | $DrawPos += GetBarSize($cset[0], $xres); | |
|
396 | $DrawPos += GetBarSize($cset[1], $xres); | |
|
397 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[2], $xres) , $ysize); | |
|
398 | $DrawPos += GetBarSize($cset[2], $xres); | |
|
399 | $DrawPos += GetBarSize($cset[3], $xres); | |
|
400 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, GetBarSize($cset[4], $xres) , $ysize); | |
|
401 | $DrawPos += GetBarSize($cset[4], $xres); | |
|
402 | $DrawPos += GetBarSize($cset[5], $xres); | |
|
403 | $cPos += 2; | |
|
404 | end while ($cPos<$len); | |
|
405 | $DrawPos = @DrawCheckChar($DrawPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
406 | $DrawPos = @DrawStop($DrawPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
407 | return true; | |
|
408 | end | |
|
409 | } | |
|
410 | ||
|
411 | #============================================================+ | |
|
412 | # END OF FILE | |
|
413 | #============================================================+ | |
|
414 |
@@ -0,0 +1,281 | |||
|
1 | ||
|
2 | #============================================================+ | |
|
3 | # File name : c39object.rb | |
|
4 | # Begin : 2002-07-31 | |
|
5 | # Last Update : 2004-12-29 | |
|
6 | # Author : Karim Mribti [barcode@mribti.com] | |
|
7 | # : Nicola Asuni [info@tecnick.com] | |
|
8 | # Version : 0.0.8a 2001-04-01 (original code) | |
|
9 | # License : GNU LGPL (Lesser General Public License) 2.1 | |
|
10 | # http://www.gnu.org/copyleft/lesser.txt | |
|
11 | # Source Code : http://www.mribti.com/barcode/ | |
|
12 | # | |
|
13 | # Description : Code 39 Barcode Render Class for PHP using | |
|
14 | # the GD graphics library. | |
|
15 | # Code 39 is an alphanumeric bar code that can | |
|
16 | # encode decimal number, case alphabet and some | |
|
17 | # special symbols. | |
|
18 | # | |
|
19 | # NOTE: | |
|
20 | # This version contains changes by Nicola Asuni: | |
|
21 | # - porting to Ruby | |
|
22 | # - code style and formatting | |
|
23 | # - automatic php documentation in PhpDocumentor Style | |
|
24 | # (www.phpdoc.org) | |
|
25 | # - minor bug fixing | |
|
26 | #============================================================+ | |
|
27 | ||
|
28 | # | |
|
29 | # Code 39 Barcode Render Class.<br> | |
|
30 | # Code 39 is an alphanumeric bar code that can encode decimal number, case alphabet and some special symbols. | |
|
31 | # @author Karim Mribti, Nicola Asuni | |
|
32 | # @name BarcodeObject | |
|
33 | # @package com.tecnick.tcpdf | |
|
34 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
35 | # @since 2001-03-25 | |
|
36 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
37 | # | |
|
38 | ||
|
39 | # | |
|
40 | # Code 39 Barcode Render Class.<br> | |
|
41 | # Code 39 is an alphanumeric bar code that can encode decimal number, case alphabet and some special symbols. | |
|
42 | # @author Karim Mribti, Nicola Asuni | |
|
43 | # @name BarcodeObject | |
|
44 | # @package com.tecnick.tcpdf | |
|
45 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
46 | # @since 2001-03-25 | |
|
47 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
48 | # | |
|
49 | class C39Object extends BarcodeObject { | |
|
50 | ||
|
51 | # | |
|
52 | # Class Constructor. | |
|
53 | # @param int $Width Image width in pixels. | |
|
54 | # @param int $Height Image height in pixels. | |
|
55 | # @param int $Style Barcode style. | |
|
56 | # @param int $Value value to print on barcode. | |
|
57 | # | |
|
58 | def __construct($Width, $Height, $Style, $Value) | |
|
59 | parent::__construct($Width, $Height, $Style); | |
|
60 | @mValue = $Value; | |
|
61 | @mChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-.#$/+%"; | |
|
62 | @mCharSet = array ( | |
|
63 | # 0 # "000110100", | |
|
64 | # 1 # "100100001", | |
|
65 | # 2 # "001100001", | |
|
66 | # 3 # "101100000", | |
|
67 | # 4 # "000110001", | |
|
68 | # 5 # "100110000", | |
|
69 | # 6 # "001110000", | |
|
70 | # 7 # "000100101", | |
|
71 | # 8 # "100100100", | |
|
72 | # 9 # "001100100", | |
|
73 | # A # "100001001", | |
|
74 | # B # "001001001", | |
|
75 | # C # "101001000", | |
|
76 | # D # "000011001", | |
|
77 | # E # "100011000", | |
|
78 | # F # "001011000", | |
|
79 | # G # "000001101", | |
|
80 | # H # "100001100", | |
|
81 | # I # "001001100", | |
|
82 | # J # "000011100", | |
|
83 | # K # "100000011", | |
|
84 | # L # "001000011", | |
|
85 | # M # "101000010", | |
|
86 | # N # "000010011", | |
|
87 | # O # "100010010", | |
|
88 | # P # "001010010", | |
|
89 | # Q # "000000111", | |
|
90 | # R # "100000110", | |
|
91 | # S # "001000110", | |
|
92 | # T # "000010110", | |
|
93 | # U # "110000001", | |
|
94 | # V # "011000001", | |
|
95 | # W # "111000000", | |
|
96 | # X # "010010001", | |
|
97 | # Y # "110010000", | |
|
98 | # Z # "011010000", | |
|
99 | # - # "010000101", | |
|
100 | # . # "110000100", | |
|
101 | # SP# "011000100", | |
|
102 | /*# # "010010100", | |
|
103 | # $ # "010101000", | |
|
104 | # / # "010100010", | |
|
105 | # + # "010001010", | |
|
106 | # % # "000101010" | |
|
107 | ); | |
|
108 | end | |
|
109 | ||
|
110 | # | |
|
111 | # Returns the character index. | |
|
112 | # @param char $char character. | |
|
113 | # @return int character index or -1 in case of error. | |
|
114 | # @access private | |
|
115 | # | |
|
116 | def GetCharIndex($char) | |
|
117 | for ($i=0;$i<44;$i++) | |
|
118 | if (@mChars[$i] == $char) | |
|
119 | return $i; | |
|
120 | end | |
|
121 | end | |
|
122 | return -1; | |
|
123 | end | |
|
124 | ||
|
125 | # | |
|
126 | # Returns barcode size. | |
|
127 | # @param int $xres Horizontal resolution. | |
|
128 | # @return barcode size. | |
|
129 | # @access private | |
|
130 | # | |
|
131 | def GetSize($xres) | |
|
132 | $len = @mValue.length; | |
|
133 | ||
|
134 | if ($len == 0) { | |
|
135 | @mError = "Null value"; | |
|
136 | return false; | |
|
137 | end | |
|
138 | ||
|
139 | for ($i=0;$i<$len;$i++) | |
|
140 | if (GetCharIndex(@mValue[$i]) == -1 || @mValue[$i] == '*') | |
|
141 | # The asterisk is only used as a start and stop code# | |
|
142 | @mError = "C39 not include the char '".@mValue[$i]."'"; | |
|
143 | return false; | |
|
144 | end | |
|
145 | end | |
|
146 | ||
|
147 | # Start, Stop is 010010100 == '*' # | |
|
148 | $StartSize = BCD_C39_NARROW_BAR# $xres# 6 + BCD_C39_WIDE_BAR# $xres# 3; | |
|
149 | $StopSize = BCD_C39_NARROW_BAR# $xres# 6 + BCD_C39_WIDE_BAR# $xres# 3; | |
|
150 | $CharSize = BCD_C39_NARROW_BAR# $xres# 6 + BCD_C39_WIDE_BAR# $xres# 3; # Same for all chars# | |
|
151 | ||
|
152 | return $CharSize# $len + $StartSize + $StopSize + # Space between chars# BCD_C39_NARROW_BAR# $xres# ($len-1); | |
|
153 | end | |
|
154 | ||
|
155 | # | |
|
156 | # Draws the start code. | |
|
157 | # @param int $DrawPos Drawing position. | |
|
158 | # @param int $yPos Vertical position. | |
|
159 | # @param int $ySize Vertical size. | |
|
160 | # @param int $xres Horizontal resolution. | |
|
161 | # @return int drawing position. | |
|
162 | # @access private | |
|
163 | # | |
|
164 | def DrawStart($DrawPos, $yPos, $ySize, $xres) | |
|
165 | # Start code is '*'# | |
|
166 | $narrow = BCD_C39_NARROW_BAR# $xres; | |
|
167 | $wide = BCD_C39_WIDE_BAR# $xres; | |
|
168 | @DrawSingleBar($DrawPos, $yPos, $narrow , $ySize); | |
|
169 | $DrawPos += $narrow; | |
|
170 | $DrawPos += $wide; | |
|
171 | @DrawSingleBar($DrawPos, $yPos, $narrow , $ySize); | |
|
172 | $DrawPos += $narrow; | |
|
173 | $DrawPos += $narrow; | |
|
174 | @DrawSingleBar($DrawPos, $yPos, $wide , $ySize); | |
|
175 | $DrawPos += $wide; | |
|
176 | $DrawPos += $narrow; | |
|
177 | @DrawSingleBar($DrawPos, $yPos, $wide , $ySize); | |
|
178 | $DrawPos += $wide; | |
|
179 | $DrawPos += $narrow; | |
|
180 | @DrawSingleBar($DrawPos, $yPos, $narrow, $ySize); | |
|
181 | $DrawPos += $narrow; | |
|
182 | $DrawPos += $narrow; # Space between chars# | |
|
183 | return $DrawPos; | |
|
184 | end | |
|
185 | ||
|
186 | # | |
|
187 | # Draws the stop code. | |
|
188 | # @param int $DrawPos Drawing position. | |
|
189 | # @param int $yPos Vertical position. | |
|
190 | # @param int $ySize Vertical size. | |
|
191 | # @param int $xres Horizontal resolution. | |
|
192 | # @return int drawing position. | |
|
193 | # @access private | |
|
194 | # | |
|
195 | def DrawStop($DrawPos, $yPos, $ySize, $xres) | |
|
196 | # Stop code is '*'# | |
|
197 | $narrow = BCD_C39_NARROW_BAR# $xres; | |
|
198 | $wide = BCD_C39_WIDE_BAR# $xres; | |
|
199 | @DrawSingleBar($DrawPos, $yPos, $narrow , $ySize); | |
|
200 | $DrawPos += $narrow; | |
|
201 | $DrawPos += $wide; | |
|
202 | @DrawSingleBar($DrawPos, $yPos, $narrow , $ySize); | |
|
203 | $DrawPos += $narrow; | |
|
204 | $DrawPos += $narrow; | |
|
205 | @DrawSingleBar($DrawPos, $yPos, $wide , $ySize); | |
|
206 | $DrawPos += $wide; | |
|
207 | $DrawPos += $narrow; | |
|
208 | @DrawSingleBar($DrawPos, $yPos, $wide , $ySize); | |
|
209 | $DrawPos += $wide; | |
|
210 | $DrawPos += $narrow; | |
|
211 | @DrawSingleBar($DrawPos, $yPos, $narrow, $ySize); | |
|
212 | $DrawPos += $narrow; | |
|
213 | return $DrawPos; | |
|
214 | end | |
|
215 | ||
|
216 | # | |
|
217 | # Draws the barcode object. | |
|
218 | # @param int $xres Horizontal resolution. | |
|
219 | # @return bool true in case of success. | |
|
220 | # | |
|
221 | def DrawObject($xres) | |
|
222 | $len = @mValue.length; | |
|
223 | ||
|
224 | $narrow = BCD_C39_NARROW_BAR# $xres; | |
|
225 | $wide = BCD_C39_WIDE_BAR# $xres; | |
|
226 | ||
|
227 | if (($size = GetSize($xres))==0) | |
|
228 | return false; | |
|
229 | end | |
|
230 | ||
|
231 | $cPos = 0; | |
|
232 | if (@mStyle & BCS_ALIGN_CENTER) $sPos = (integer)((@mWidth - $size ) / 2); | |
|
233 | elsif (@mStyle & BCS_ALIGN_RIGHT) $sPos = @mWidth - $size; | |
|
234 | else $sPos = 0; | |
|
235 | ||
|
236 | # Total height of bar code -Bars only-# | |
|
237 | if (@mStyle & BCS_DRAW_TEXT) $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2 - GetFontHeight(@mFont); | |
|
238 | else $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2; | |
|
239 | ||
|
240 | # Draw text# | |
|
241 | if (@mStyle & BCS_DRAW_TEXT) | |
|
242 | if (@mStyle & BCS_STRETCH_TEXT) | |
|
243 | for ($i=0;$i<$len;$i++) | |
|
244 | @DrawChar(@mFont, $sPos+($narrow*6+$wide*3)+($size/$len)*$i, | |
|
245 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue[$i]); | |
|
246 | else# Center# | |
|
247 | $text_width = GetFontWidth(@mFont)# @mValue.length; | |
|
248 | @DrawText(@mFont, $sPos+(($size-$text_width)/2)+($narrow*6+$wide*3), | |
|
249 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue); | |
|
250 | end | |
|
251 | end | |
|
252 | ||
|
253 | $DrawPos = @DrawStart($sPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
254 | do { | |
|
255 | $c = GetCharIndex(@mValue[$cPos]); | |
|
256 | $cset = @mCharSet[$c]; | |
|
257 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[0] == '0') ? $narrow : $wide , $ysize); | |
|
258 | $DrawPos += ($cset[0] == '0') ? $narrow : $wide; | |
|
259 | $DrawPos += ($cset[1] == '0') ? $narrow : $wide; | |
|
260 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[2] == '0') ? $narrow : $wide , $ysize); | |
|
261 | $DrawPos += ($cset[2] == '0') ? $narrow : $wide; | |
|
262 | $DrawPos += ($cset[3] == '0') ? $narrow : $wide; | |
|
263 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[4] == '0') ? $narrow : $wide , $ysize); | |
|
264 | $DrawPos += ($cset[4] == '0') ? $narrow : $wide; | |
|
265 | $DrawPos += ($cset[5] == '0') ? $narrow : $wide; | |
|
266 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[6] == '0') ? $narrow : $wide , $ysize); | |
|
267 | $DrawPos += ($cset[6] == '0') ? $narrow : $wide; | |
|
268 | $DrawPos += ($cset[7] == '0') ? $narrow : $wide; | |
|
269 | @DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[8] == '0') ? $narrow : $wide , $ysize); | |
|
270 | $DrawPos += ($cset[8] == '0') ? $narrow : $wide; | |
|
271 | $DrawPos += $narrow; # Space between chars# | |
|
272 | $cPos += 1; | |
|
273 | end while ($cPos<$len); | |
|
274 | $DrawPos = @DrawStop($DrawPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres); | |
|
275 | return true; | |
|
276 | end | |
|
277 | } | |
|
278 | ||
|
279 | #============================================================+ | |
|
280 | # END OF FILE | |
|
281 | #============================================================+ |
@@ -0,0 +1,216 | |||
|
1 | ||
|
2 | #============================================================+ | |
|
3 | # File name : i25aobject.rb | |
|
4 | # Begin : 2002-07-31 | |
|
5 | # Last Update : 2004-12-29 | |
|
6 | # Author : Karim Mribti [barcode@mribti.com] | |
|
7 | # : Nicola Asuni [info@tecnick.com] | |
|
8 | # Version : 0.0.8a 2001-04-01 (original code) | |
|
9 | # License : GNU LGPL (Lesser General Public License) 2.1 | |
|
10 | # http://www.gnu.org/copyleft/lesser.txt | |
|
11 | # Source Code : http://www.mribti.com/barcode/ | |
|
12 | # | |
|
13 | # Description : I25 Barcode Render Class for PHP using | |
|
14 | # the GD graphics library. | |
|
15 | # Interleaved 2 of 5 is a numeric only bar code | |
|
16 | # with a optional check number. | |
|
17 | # | |
|
18 | # NOTE: | |
|
19 | # This version contains changes by Nicola Asuni: | |
|
20 | # - porting to Ruby | |
|
21 | # - code style and formatting | |
|
22 | # - automatic php documentation in PhpDocumentor Style | |
|
23 | # (www.phpdoc.org) | |
|
24 | # - minor bug fixing | |
|
25 | #============================================================+ | |
|
26 | ||
|
27 | # | |
|
28 | # I25 Barcode Render Class for PHP using the GD graphics library.<br< | |
|
29 | # Interleaved 2 of 5 is a numeric only bar code with a optional check number. | |
|
30 | # @author Karim Mribti, Nicola Asuni | |
|
31 | # @name BarcodeObject | |
|
32 | # @package com.tecnick.tcpdf | |
|
33 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
34 | # @since 2001-03-25 | |
|
35 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
36 | # | |
|
37 | ||
|
38 | # | |
|
39 | # I25 Barcode Render Class for PHP using the GD graphics library.<br< | |
|
40 | # Interleaved 2 of 5 is a numeric only bar code with a optional check number. | |
|
41 | # @author Karim Mribti, Nicola Asuni | |
|
42 | # @name BarcodeObject | |
|
43 | # @package com.tecnick.tcpdf | |
|
44 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
45 | # @since 2001-03-25 | |
|
46 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
47 | # | |
|
48 | class I25Object extends BarcodeObject { | |
|
49 | ||
|
50 | # | |
|
51 | # Class Constructor. | |
|
52 | # @param int $Width Image width in pixels. | |
|
53 | # @param int $Height Image height in pixels. | |
|
54 | # @param int $Style Barcode style. | |
|
55 | # @param int $Value value to print on barcode. | |
|
56 | # | |
|
57 | def __construct($Width, $Height, $Style, $Value) | |
|
58 | parent::__construct($Width, $Height, $Style); | |
|
59 | @mValue = $Value; | |
|
60 | @mCharSet = array ( | |
|
61 | # 0# "00110", | |
|
62 | # 1# "10001", | |
|
63 | # 2# "01001", | |
|
64 | # 3# "11000", | |
|
65 | # 4# "00101", | |
|
66 | # 5# "10100", | |
|
67 | # 6# "01100", | |
|
68 | # 7# "00011", | |
|
69 | # 8# "10010", | |
|
70 | # 9# "01010" | |
|
71 | ); | |
|
72 | end | |
|
73 | ||
|
74 | # | |
|
75 | # Returns barcode size. | |
|
76 | # @param int $xres Horizontal resolution. | |
|
77 | # @return barcode size. | |
|
78 | # @access private | |
|
79 | # | |
|
80 | def GetSize($xres) | |
|
81 | $len = @mValue.length; | |
|
82 | ||
|
83 | if ($len == 0) { | |
|
84 | @mError = "Null value"; | |
|
85 | return false; | |
|
86 | end | |
|
87 | ||
|
88 | for ($i=0;$i<$len;$i++) | |
|
89 | if ((@mValue[$i][0] < 48) || (@mValue[$i][0] > 57)) | |
|
90 | @mError = "I25 is numeric only"; | |
|
91 | return false; | |
|
92 | end | |
|
93 | end | |
|
94 | ||
|
95 | if (($len%2) != 0) | |
|
96 | @mError = "The length of barcode value must be even"; | |
|
97 | return false; | |
|
98 | end | |
|
99 | $StartSize = BCD_I25_NARROW_BAR# 4 # $xres; | |
|
100 | $StopSize = BCD_I25_WIDE_BAR# $xres + 2# BCD_I25_NARROW_BAR# $xres; | |
|
101 | $cPos = 0; | |
|
102 | $sPos = 0; | |
|
103 | do { | |
|
104 | $c1 = @mValue[$cPos]; | |
|
105 | $c2 = @mValue[$cPos+1]; | |
|
106 | $cset1 = @mCharSet[$c1]; | |
|
107 | $cset2 = @mCharSet[$c2]; | |
|
108 | ||
|
109 | for ($i=0;$i<5;$i++) | |
|
110 | $type1 = ($cset1[$i]==0) ? (BCD_I25_NARROW_BAR # $xres) : (BCD_I25_WIDE_BAR# $xres); | |
|
111 | $type2 = ($cset2[$i]==0) ? (BCD_I25_NARROW_BAR # $xres) : (BCD_I25_WIDE_BAR# $xres); | |
|
112 | $sPos += ($type1 + $type2); | |
|
113 | end | |
|
114 | $cPos+=2; | |
|
115 | end while ($cPos<$len); | |
|
116 | ||
|
117 | return $sPos + $StartSize + $StopSize; | |
|
118 | end | |
|
119 | ||
|
120 | # | |
|
121 | # Draws the start code. | |
|
122 | # @param int $DrawPos Drawing position. | |
|
123 | # @param int $yPos Vertical position. | |
|
124 | # @param int $ySize Vertical size. | |
|
125 | # @param int $xres Horizontal resolution. | |
|
126 | # @return int drawing position. | |
|
127 | # @access private | |
|
128 | # | |
|
129 | def DrawStart($DrawPos, $yPos, $ySize, $xres) | |
|
130 | # Start code is "0000"# | |
|
131 | @DrawSingleBar($DrawPos, $yPos, BCD_I25_NARROW_BAR # $xres , $ySize); | |
|
132 | $DrawPos += BCD_I25_NARROW_BAR # $xres; | |
|
133 | $DrawPos += BCD_I25_NARROW_BAR # $xres; | |
|
134 | @DrawSingleBar($DrawPos, $yPos, BCD_I25_NARROW_BAR # $xres , $ySize); | |
|
135 | $DrawPos += BCD_I25_NARROW_BAR # $xres; | |
|
136 | $DrawPos += BCD_I25_NARROW_BAR # $xres; | |
|
137 | return $DrawPos; | |
|
138 | end | |
|
139 | ||
|
140 | # | |
|
141 | # Draws the stop code. | |
|
142 | # @param int $DrawPos Drawing position. | |
|
143 | # @param int $yPos Vertical position. | |
|
144 | # @param int $ySize Vertical size. | |
|
145 | # @param int $xres Horizontal resolution. | |
|
146 | # @return int drawing position. | |
|
147 | # @access private | |
|
148 | # | |
|
149 | def DrawStop($DrawPos, $yPos, $ySize, $xres) | |
|
150 | # Stop code is "100"# | |
|
151 | @DrawSingleBar($DrawPos, $yPos, BCD_I25_WIDE_BAR# $xres , $ySize); | |
|
152 | $DrawPos += BCD_I25_WIDE_BAR # $xres; | |
|
153 | $DrawPos += BCD_I25_NARROW_BAR # $xres; | |
|
154 | @DrawSingleBar($DrawPos, $yPos, BCD_I25_NARROW_BAR # $xres , $ySize); | |
|
155 | $DrawPos += BCD_I25_NARROW_BAR # $xres; | |
|
156 | return $DrawPos; | |
|
157 | end | |
|
158 | ||
|
159 | # | |
|
160 | # Draws the barcode object. | |
|
161 | # @param int $xres Horizontal resolution. | |
|
162 | # @return bool true in case of success. | |
|
163 | # | |
|
164 | def DrawObject($xres) | |
|
165 | $len = @mValue.length; | |
|
166 | ||
|
167 | if (($size = GetSize($xres))==0) | |
|
168 | return false; | |
|
169 | end | |
|
170 | ||
|
171 | $cPos = 0; | |
|
172 | ||
|
173 | if (@mStyle & BCS_DRAW_TEXT) $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2 - GetFontHeight(@mFont); | |
|
174 | else $ysize = @mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2; | |
|
175 | ||
|
176 | if (@mStyle & BCS_ALIGN_CENTER) $sPos = (integer)((@mWidth - $size ) / 2); | |
|
177 | elsif (@mStyle & BCS_ALIGN_RIGHT) $sPos = @mWidth - $size; | |
|
178 | else $sPos = 0; | |
|
179 | ||
|
180 | if (@mStyle & BCS_DRAW_TEXT) | |
|
181 | if (@mStyle & BCS_STRETCH_TEXT) | |
|
182 | # Stretch# | |
|
183 | for ($i=0;$i<$len;$i++) | |
|
184 | @DrawChar(@mFont, $sPos+BCD_I25_NARROW_BAR*4*$xres+($size/$len)*$i, | |
|
185 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET , @mValue[$i]); | |
|
186 | end | |
|
187 | endelse# Center# | |
|
188 | $text_width = GetFontWidth(@mFont) * @mValue.length; | |
|
189 | @DrawText(@mFont, $sPos+(($size-$text_width)/2)+(BCD_I25_NARROW_BAR*4*$xres), | |
|
190 | $ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, @mValue); | |
|
191 | end | |
|
192 | end | |
|
193 | ||
|
194 | $sPos = @DrawStart($sPos, BCD_DEFAULT_MAR_Y1, $ysize, $xres); | |
|
195 | do { | |
|
196 | $c1 = @mValue[$cPos]; | |
|
197 | $c2 = @mValue[$cPos+1]; | |
|
198 | $cset1 = @mCharSet[$c1]; | |
|
199 | $cset2 = @mCharSet[$c2]; | |
|
200 | ||
|
201 | for ($i=0;$i<5;$i++) | |
|
202 | $type1 = ($cset1[$i]==0) ? (BCD_I25_NARROW_BAR# $xres) : (BCD_I25_WIDE_BAR# $xres); | |
|
203 | $type2 = ($cset2[$i]==0) ? (BCD_I25_NARROW_BAR# $xres) : (BCD_I25_WIDE_BAR# $xres); | |
|
204 | @DrawSingleBar($sPos, BCD_DEFAULT_MAR_Y1, $type1 , $ysize); | |
|
205 | $sPos += ($type1 + $type2); | |
|
206 | end | |
|
207 | $cPos+=2; | |
|
208 | end while ($cPos<$len); | |
|
209 | $sPos = @DrawStop($sPos, BCD_DEFAULT_MAR_Y1, $ysize, $xres); | |
|
210 | return true; | |
|
211 | end | |
|
212 | } | |
|
213 | ||
|
214 | #============================================================+ | |
|
215 | # END OF FILE | |
|
216 | #============================================================+ |
@@ -0,0 +1,87 | |||
|
1 | ||
|
2 | #============================================================+ | |
|
3 | # File name : image.rb | |
|
4 | # Begin : 2002-07-31 | |
|
5 | # Last Update : 2005-01-08 | |
|
6 | # Author : Karim Mribti [barcode@mribti.com] | |
|
7 | # : Nicola Asuni [info@tecnick.com] | |
|
8 | # Version : 0.0.8a 2001-04-01 (original code) | |
|
9 | # License : GNU LGPL (Lesser General Public License) 2.1 | |
|
10 | # http://www.gnu.org/copyleft/lesser.txt | |
|
11 | # Source Code : http://www.mribti.com/barcode/ | |
|
12 | # | |
|
13 | # Description : Barcode Image Rendering. | |
|
14 | # | |
|
15 | # NOTE: | |
|
16 | # This version contains changes by Nicola Asuni: | |
|
17 | # - porting to Ruby | |
|
18 | # - code style and formatting | |
|
19 | # - automatic php documentation in PhpDocumentor Style | |
|
20 | # (www.phpdoc.org) | |
|
21 | # - minor bug fixing | |
|
22 | #============================================================+ | |
|
23 | ||
|
24 | # | |
|
25 | # Barcode Image Rendering. | |
|
26 | # @author Karim Mribti, Nicola Asuni | |
|
27 | # @name BarcodeObject | |
|
28 | # @package com.tecnick.tcpdf | |
|
29 | # @@version 0.0.8a 2001-04-01 (original code) | |
|
30 | # @since 2001-03-25 | |
|
31 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
32 | # | |
|
33 | ||
|
34 | # | |
|
35 | # | |
|
36 | # | |
|
37 | ||
|
38 | require("../../shared/barcode/barcode.rb"); | |
|
39 | require("../../shared/barcode/i25object.rb"); | |
|
40 | require("../../shared/barcode/c39object.rb"); | |
|
41 | require("../../shared/barcode/c128aobject.rb"); | |
|
42 | require("../../shared/barcode/c128bobject.rb"); | |
|
43 | require("../../shared/barcode/c128cobject.rb"); | |
|
44 | ||
|
45 | if (!$_REQUEST['style'].nil?) $_REQUEST['style'] = BCD_DEFAULT_STYLE; | |
|
46 | if (!$_REQUEST['width'].nil?) $_REQUEST['width'] = BCD_DEFAULT_WIDTH; | |
|
47 | if (!$_REQUEST['height'].nil?) $_REQUEST['height'] = BCD_DEFAULT_HEIGHT; | |
|
48 | if (!$_REQUEST['xres'].nil?) $_REQUEST['xres'] = BCD_DEFAULT_XRES; | |
|
49 | if (!$_REQUEST['font'].nil?) $_REQUEST['font'] = BCD_DEFAULT_FONT; | |
|
50 | if (!$_REQUEST['type'].nil?) $_REQUEST['type'] = "C39"; | |
|
51 | if (!$_REQUEST['code'].nil?) $_REQUEST['code'] = ""; | |
|
52 | ||
|
53 | switch ($_REQUEST['type'].upcase) | |
|
54 | case "I25" | |
|
55 | $obj = new I25Object($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']); | |
|
56 | break; | |
|
57 | end | |
|
58 | case "C128A" | |
|
59 | $obj = new C128AObject($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']); | |
|
60 | break; | |
|
61 | end | |
|
62 | case "C128B" | |
|
63 | $obj = new C128BObject($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']); | |
|
64 | break; | |
|
65 | end | |
|
66 | case "C128C" | |
|
67 | $obj = new C128CObject($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']); | |
|
68 | break; | |
|
69 | end | |
|
70 | case "C39": | |
|
71 | default | |
|
72 | $obj = new C39Object($_REQUEST['width'], $_REQUEST['height'], $_REQUEST['style'], $_REQUEST['code']); | |
|
73 | break; | |
|
74 | end | |
|
75 | } | |
|
76 | ||
|
77 | if ($obj) | |
|
78 | $obj->SetFont($_REQUEST['font']); | |
|
79 | $obj->DrawObject($_REQUEST['xres']); | |
|
80 | $obj->FlushObject(); | |
|
81 | $obj->DestroyObject(); | |
|
82 | unset($obj); # clean# | |
|
83 | } | |
|
84 | ||
|
85 | #============================================================+ | |
|
86 | # END OF FILE | |
|
87 | #============================================================+ |
This diff has been collapsed as it changes many lines, (504 lines changed) Show them Hide them | |||
@@ -0,0 +1,504 | |||
|
1 | GNU LESSER GENERAL PUBLIC LICENSE | |
|
2 | Version 2.1, February 1999 | |
|
3 | ||
|
4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. | |
|
5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
|
6 | Everyone is permitted to copy and distribute verbatim copies | |
|
7 | of this license document, but changing it is not allowed. | |
|
8 | ||
|
9 | [This is the first released version of the Lesser GPL. It also counts | |
|
10 | as the successor of the GNU Library Public License, version 2, hence | |
|
11 | the version number 2.1.] | |
|
12 | ||
|
13 | Preamble | |
|
14 | ||
|
15 | The licenses for most software are designed to take away your | |
|
16 | freedom to share and change it. By contrast, the GNU General Public | |
|
17 | Licenses are intended to guarantee your freedom to share and change | |
|
18 | free software--to make sure the software is free for all its users. | |
|
19 | ||
|
20 | This license, the Lesser General Public License, applies to some | |
|
21 | specially designated software packages--typically libraries--of the | |
|
22 | Free Software Foundation and other authors who decide to use it. You | |
|
23 | can use it too, but we suggest you first think carefully about whether | |
|
24 | this license or the ordinary General Public License is the better | |
|
25 | strategy to use in any particular case, based on the explanations below. | |
|
26 | ||
|
27 | When we speak of free software, we are referring to freedom of use, | |
|
28 | not price. Our General Public Licenses are designed to make sure that | |
|
29 | you have the freedom to distribute copies of free software (and charge | |
|
30 | for this service if you wish); that you receive source code or can get | |
|
31 | it if you want it; that you can change the software and use pieces of | |
|
32 | it in new free programs; and that you are informed that you can do | |
|
33 | these things. | |
|
34 | ||
|
35 | To protect your rights, we need to make restrictions that forbid | |
|
36 | distributors to deny you these rights or to ask you to surrender these | |
|
37 | rights. These restrictions translate to certain responsibilities for | |
|
38 | you if you distribute copies of the library or if you modify it. | |
|
39 | ||
|
40 | For example, if you distribute copies of the library, whether gratis | |
|
41 | or for a fee, you must give the recipients all the rights that we gave | |
|
42 | you. You must make sure that they, too, receive or can get the source | |
|
43 | code. If you link other code with the library, you must provide | |
|
44 | complete object files to the recipients, so that they can relink them | |
|
45 | with the library after making changes to the library and recompiling | |
|
46 | it. And you must show them these terms so they know their rights. | |
|
47 | ||
|
48 | We protect your rights with a two-step method: (1) we copyright the | |
|
49 | library, and (2) we offer you this license, which gives you legal | |
|
50 | permission to copy, distribute and/or modify the library. | |
|
51 | ||
|
52 | To protect each distributor, we want to make it very clear that | |
|
53 | there is no warranty for the free library. Also, if the library is | |
|
54 | modified by someone else and passed on, the recipients should know | |
|
55 | that what they have is not the original version, so that the original | |
|
56 | author's reputation will not be affected by problems that might be | |
|
57 | introduced by others. | |
|
58 | ||
|
59 | Finally, software patents pose a constant threat to the existence of | |
|
60 | any free program. We wish to make sure that a company cannot | |
|
61 | effectively restrict the users of a free program by obtaining a | |
|
62 | restrictive license from a patent holder. Therefore, we insist that | |
|
63 | any patent license obtained for a version of the library must be | |
|
64 | consistent with the full freedom of use specified in this license. | |
|
65 | ||
|
66 | Most GNU software, including some libraries, is covered by the | |
|
67 | ordinary GNU General Public License. This license, the GNU Lesser | |
|
68 | General Public License, applies to certain designated libraries, and | |
|
69 | is quite different from the ordinary General Public License. We use | |
|
70 | this license for certain libraries in order to permit linking those | |
|
71 | libraries into non-free programs. | |
|
72 | ||
|
73 | When a program is linked with a library, whether statically or using | |
|
74 | a shared library, the combination of the two is legally speaking a | |
|
75 | combined work, a derivative of the original library. The ordinary | |
|
76 | General Public License therefore permits such linking only if the | |
|
77 | entire combination fits its criteria of freedom. The Lesser General | |
|
78 | Public License permits more lax criteria for linking other code with | |
|
79 | the library. | |
|
80 | ||
|
81 | We call this license the "Lesser" General Public License because it | |
|
82 | does Less to protect the user's freedom than the ordinary General | |
|
83 | Public License. It also provides other free software developers Less | |
|
84 | of an advantage over competing non-free programs. These disadvantages | |
|
85 | are the reason we use the ordinary General Public License for many | |
|
86 | libraries. However, the Lesser license provides advantages in certain | |
|
87 | special circumstances. | |
|
88 | ||
|
89 | For example, on rare occasions, there may be a special need to | |
|
90 | encourage the widest possible use of a certain library, so that it becomes | |
|
91 | a de-facto standard. To achieve this, non-free programs must be | |
|
92 | allowed to use the library. A more frequent case is that a free | |
|
93 | library does the same job as widely used non-free libraries. In this | |
|
94 | case, there is little to gain by limiting the free library to free | |
|
95 | software only, so we use the Lesser General Public License. | |
|
96 | ||
|
97 | In other cases, permission to use a particular library in non-free | |
|
98 | programs enables a greater number of people to use a large body of | |
|
99 | free software. For example, permission to use the GNU C Library in | |
|
100 | non-free programs enables many more people to use the whole GNU | |
|
101 | operating system, as well as its variant, the GNU/Linux operating | |
|
102 | system. | |
|
103 | ||
|
104 | Although the Lesser General Public License is Less protective of the | |
|
105 | users' freedom, it does ensure that the user of a program that is | |
|
106 | linked with the Library has the freedom and the wherewithal to run | |
|
107 | that program using a modified version of the Library. | |
|
108 | ||
|
109 | The precise terms and conditions for copying, distribution and | |
|
110 | modification follow. Pay close attention to the difference between a | |
|
111 | "work based on the library" and a "work that uses the library". The | |
|
112 | former contains code derived from the library, whereas the latter must | |
|
113 | be combined with the library in order to run. | |
|
114 | ||
|
115 | GNU LESSER GENERAL PUBLIC LICENSE | |
|
116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
|
117 | ||
|
118 | 0. This License Agreement applies to any software library or other | |
|
119 | program which contains a notice placed by the copyright holder or | |
|
120 | other authorized party saying it may be distributed under the terms of | |
|
121 | this Lesser General Public License (also called "this License"). | |
|
122 | Each licensee is addressed as "you". | |
|
123 | ||
|
124 | A "library" means a collection of software functions and/or data | |
|
125 | prepared so as to be conveniently linked with application programs | |
|
126 | (which use some of those functions and data) to form executables. | |
|
127 | ||
|
128 | The "Library", below, refers to any such software library or work | |
|
129 | which has been distributed under these terms. A "work based on the | |
|
130 | Library" means either the Library or any derivative work under | |
|
131 | copyright law: that is to say, a work containing the Library or a | |
|
132 | portion of it, either verbatim or with modifications and/or translated | |
|
133 | straightforwardly into another language. (Hereinafter, translation is | |
|
134 | included without limitation in the term "modification".) | |
|
135 | ||
|
136 | "Source code" for a work means the preferred form of the work for | |
|
137 | making modifications to it. For a library, complete source code means | |
|
138 | all the source code for all modules it contains, plus any associated | |
|
139 | interface definition files, plus the scripts used to control compilation | |
|
140 | and installation of the library. | |
|
141 | ||
|
142 | Activities other than copying, distribution and modification are not | |
|
143 | covered by this License; they are outside its scope. The act of | |
|
144 | running a program using the Library is not restricted, and output from | |
|
145 | such a program is covered only if its contents constitute a work based | |
|
146 | on the Library (independent of the use of the Library in a tool for | |
|
147 | writing it). Whether that is true depends on what the Library does | |
|
148 | and what the program that uses the Library does. | |
|
149 | ||
|
150 | 1. You may copy and distribute verbatim copies of the Library's | |
|
151 | complete source code as you receive it, in any medium, provided that | |
|
152 | you conspicuously and appropriately publish on each copy an | |
|
153 | appropriate copyright notice and disclaimer of warranty; keep intact | |
|
154 | all the notices that refer to this License and to the absence of any | |
|
155 | warranty; and distribute a copy of this License along with the | |
|
156 | Library. | |
|
157 | ||
|
158 | You may charge a fee for the physical act of transferring a copy, | |
|
159 | and you may at your option offer warranty protection in exchange for a | |
|
160 | fee. | |
|
161 | ||
|
162 | 2. You may modify your copy or copies of the Library or any portion | |
|
163 | of it, thus forming a work based on the Library, and copy and | |
|
164 | distribute such modifications or work under the terms of Section 1 | |
|
165 | above, provided that you also meet all of these conditions: | |
|
166 | ||
|
167 | a) The modified work must itself be a software library. | |
|
168 | ||
|
169 | b) You must cause the files modified to carry prominent notices | |
|
170 | stating that you changed the files and the date of any change. | |
|
171 | ||
|
172 | c) You must cause the whole of the work to be licensed at no | |
|
173 | charge to all third parties under the terms of this License. | |
|
174 | ||
|
175 | d) If a facility in the modified Library refers to a function or a | |
|
176 | table of data to be supplied by an application program that uses | |
|
177 | the facility, other than as an argument passed when the facility | |
|
178 | is invoked, then you must make a good faith effort to ensure that, | |
|
179 | in the event an application does not supply such function or | |
|
180 | table, the facility still operates, and performs whatever part of | |
|
181 | its purpose remains meaningful. | |
|
182 | ||
|
183 | (For example, a function in a library to compute square roots has | |
|
184 | a purpose that is entirely well-defined independent of the | |
|
185 | application. Therefore, Subsection 2d requires that any | |
|
186 | application-supplied function or table used by this function must | |
|
187 | be optional: if the application does not supply it, the square | |
|
188 | root function must still compute square roots.) | |
|
189 | ||
|
190 | These requirements apply to the modified work as a whole. If | |
|
191 | identifiable sections of that work are not derived from the Library, | |
|
192 | and can be reasonably considered independent and separate works in | |
|
193 | themselves, then this License, and its terms, do not apply to those | |
|
194 | sections when you distribute them as separate works. But when you | |
|
195 | distribute the same sections as part of a whole which is a work based | |
|
196 | on the Library, the distribution of the whole must be on the terms of | |
|
197 | this License, whose permissions for other licensees extend to the | |
|
198 | entire whole, and thus to each and every part regardless of who wrote | |
|
199 | it. | |
|
200 | ||
|
201 | Thus, it is not the intent of this section to claim rights or contest | |
|
202 | your rights to work written entirely by you; rather, the intent is to | |
|
203 | exercise the right to control the distribution of derivative or | |
|
204 | collective works based on the Library. | |
|
205 | ||
|
206 | In addition, mere aggregation of another work not based on the Library | |
|
207 | with the Library (or with a work based on the Library) on a volume of | |
|
208 | a storage or distribution medium does not bring the other work under | |
|
209 | the scope of this License. | |
|
210 | ||
|
211 | 3. You may opt to apply the terms of the ordinary GNU General Public | |
|
212 | License instead of this License to a given copy of the Library. To do | |
|
213 | this, you must alter all the notices that refer to this License, so | |
|
214 | that they refer to the ordinary GNU General Public License, version 2, | |
|
215 | instead of to this License. (If a newer version than version 2 of the | |
|
216 | ordinary GNU General Public License has appeared, then you can specify | |
|
217 | that version instead if you wish.) Do not make any other change in | |
|
218 | these notices. | |
|
219 | ||
|
220 | Once this change is made in a given copy, it is irreversible for | |
|
221 | that copy, so the ordinary GNU General Public License applies to all | |
|
222 | subsequent copies and derivative works made from that copy. | |
|
223 | ||
|
224 | This option is useful when you wish to copy part of the code of | |
|
225 | the Library into a program that is not a library. | |
|
226 | ||
|
227 | 4. You may copy and distribute the Library (or a portion or | |
|
228 | derivative of it, under Section 2) in object code or executable form | |
|
229 | under the terms of Sections 1 and 2 above provided that you accompany | |
|
230 | it with the complete corresponding machine-readable source code, which | |
|
231 | must be distributed under the terms of Sections 1 and 2 above on a | |
|
232 | medium customarily used for software interchange. | |
|
233 | ||
|
234 | If distribution of object code is made by offering access to copy | |
|
235 | from a designated place, then offering equivalent access to copy the | |
|
236 | source code from the same place satisfies the requirement to | |
|
237 | distribute the source code, even though third parties are not | |
|
238 | compelled to copy the source along with the object code. | |
|
239 | ||
|
240 | 5. A program that contains no derivative of any portion of the | |
|
241 | Library, but is designed to work with the Library by being compiled or | |
|
242 | linked with it, is called a "work that uses the Library". Such a | |
|
243 | work, in isolation, is not a derivative work of the Library, and | |
|
244 | therefore falls outside the scope of this License. | |
|
245 | ||
|
246 | However, linking a "work that uses the Library" with the Library | |
|
247 | creates an executable that is a derivative of the Library (because it | |
|
248 | contains portions of the Library), rather than a "work that uses the | |
|
249 | library". The executable is therefore covered by this License. | |
|
250 | Section 6 states terms for distribution of such executables. | |
|
251 | ||
|
252 | When a "work that uses the Library" uses material from a header file | |
|
253 | that is part of the Library, the object code for the work may be a | |
|
254 | derivative work of the Library even though the source code is not. | |
|
255 | Whether this is true is especially significant if the work can be | |
|
256 | linked without the Library, or if the work is itself a library. The | |
|
257 | threshold for this to be true is not precisely defined by law. | |
|
258 | ||
|
259 | If such an object file uses only numerical parameters, data | |
|
260 | structure layouts and accessors, and small macros and small inline | |
|
261 | functions (ten lines or less in length), then the use of the object | |
|
262 | file is unrestricted, regardless of whether it is legally a derivative | |
|
263 | work. (Executables containing this object code plus portions of the | |
|
264 | Library will still fall under Section 6.) | |
|
265 | ||
|
266 | Otherwise, if the work is a derivative of the Library, you may | |
|
267 | distribute the object code for the work under the terms of Section 6. | |
|
268 | Any executables containing that work also fall under Section 6, | |
|
269 | whether or not they are linked directly with the Library itself. | |
|
270 | ||
|
271 | 6. As an exception to the Sections above, you may also combine or | |
|
272 | link a "work that uses the Library" with the Library to produce a | |
|
273 | work containing portions of the Library, and distribute that work | |
|
274 | under terms of your choice, provided that the terms permit | |
|
275 | modification of the work for the customer's own use and reverse | |
|
276 | engineering for debugging such modifications. | |
|
277 | ||
|
278 | You must give prominent notice with each copy of the work that the | |
|
279 | Library is used in it and that the Library and its use are covered by | |
|
280 | this License. You must supply a copy of this License. If the work | |
|
281 | during execution displays copyright notices, you must include the | |
|
282 | copyright notice for the Library among them, as well as a reference | |
|
283 | directing the user to the copy of this License. Also, you must do one | |
|
284 | of these things: | |
|
285 | ||
|
286 | a) Accompany the work with the complete corresponding | |
|
287 | machine-readable source code for the Library including whatever | |
|
288 | changes were used in the work (which must be distributed under | |
|
289 | Sections 1 and 2 above); and, if the work is an executable linked | |
|
290 | with the Library, with the complete machine-readable "work that | |
|
291 | uses the Library", as object code and/or source code, so that the | |
|
292 | user can modify the Library and then relink to produce a modified | |
|
293 | executable containing the modified Library. (It is understood | |
|
294 | that the user who changes the contents of definitions files in the | |
|
295 | Library will not necessarily be able to recompile the application | |
|
296 | to use the modified definitions.) | |
|
297 | ||
|
298 | b) Use a suitable shared library mechanism for linking with the | |
|
299 | Library. A suitable mechanism is one that (1) uses at run time a | |
|
300 | copy of the library already present on the user's computer system, | |
|
301 | rather than copying library functions into the executable, and (2) | |
|
302 | will operate properly with a modified version of the library, if | |
|
303 | the user installs one, as long as the modified version is | |
|
304 | interface-compatible with the version that the work was made with. | |
|
305 | ||
|
306 | c) Accompany the work with a written offer, valid for at | |
|
307 | least three years, to give the same user the materials | |
|
308 | specified in Subsection 6a, above, for a charge no more | |
|
309 | than the cost of performing this distribution. | |
|
310 | ||
|
311 | d) If distribution of the work is made by offering access to copy | |
|
312 | from a designated place, offer equivalent access to copy the above | |
|
313 | specified materials from the same place. | |
|
314 | ||
|
315 | e) Verify that the user has already received a copy of these | |
|
316 | materials or that you have already sent this user a copy. | |
|
317 | ||
|
318 | For an executable, the required form of the "work that uses the | |
|
319 | Library" must include any data and utility programs needed for | |
|
320 | reproducing the executable from it. However, as a special exception, | |
|
321 | the materials to be distributed need not include anything that is | |
|
322 | normally distributed (in either source or binary form) with the major | |
|
323 | components (compiler, kernel, and so on) of the operating system on | |
|
324 | which the executable runs, unless that component itself accompanies | |
|
325 | the executable. | |
|
326 | ||
|
327 | It may happen that this requirement contradicts the license | |
|
328 | restrictions of other proprietary libraries that do not normally | |
|
329 | accompany the operating system. Such a contradiction means you cannot | |
|
330 | use both them and the Library together in an executable that you | |
|
331 | distribute. | |
|
332 | ||
|
333 | 7. You may place library facilities that are a work based on the | |
|
334 | Library side-by-side in a single library together with other library | |
|
335 | facilities not covered by this License, and distribute such a combined | |
|
336 | library, provided that the separate distribution of the work based on | |
|
337 | the Library and of the other library facilities is otherwise | |
|
338 | permitted, and provided that you do these two things: | |
|
339 | ||
|
340 | a) Accompany the combined library with a copy of the same work | |
|
341 | based on the Library, uncombined with any other library | |
|
342 | facilities. This must be distributed under the terms of the | |
|
343 | Sections above. | |
|
344 | ||
|
345 | b) Give prominent notice with the combined library of the fact | |
|
346 | that part of it is a work based on the Library, and explaining | |
|
347 | where to find the accompanying uncombined form of the same work. | |
|
348 | ||
|
349 | 8. You may not copy, modify, sublicense, link with, or distribute | |
|
350 | the Library except as expressly provided under this License. Any | |
|
351 | attempt otherwise to copy, modify, sublicense, link with, or | |
|
352 | distribute the Library is void, and will automatically terminate your | |
|
353 | rights under this License. However, parties who have received copies, | |
|
354 | or rights, from you under this License will not have their licenses | |
|
355 | terminated so long as such parties remain in full compliance. | |
|
356 | ||
|
357 | 9. You are not required to accept this License, since you have not | |
|
358 | signed it. However, nothing else grants you permission to modify or | |
|
359 | distribute the Library or its derivative works. These actions are | |
|
360 | prohibited by law if you do not accept this License. Therefore, by | |
|
361 | modifying or distributing the Library (or any work based on the | |
|
362 | Library), you indicate your acceptance of this License to do so, and | |
|
363 | all its terms and conditions for copying, distributing or modifying | |
|
364 | the Library or works based on it. | |
|
365 | ||
|
366 | 10. Each time you redistribute the Library (or any work based on the | |
|
367 | Library), the recipient automatically receives a license from the | |
|
368 | original licensor to copy, distribute, link with or modify the Library | |
|
369 | subject to these terms and conditions. You may not impose any further | |
|
370 | restrictions on the recipients' exercise of the rights granted herein. | |
|
371 | You are not responsible for enforcing compliance by third parties with | |
|
372 | this License. | |
|
373 | ||
|
374 | 11. If, as a consequence of a court judgment or allegation of patent | |
|
375 | infringement or for any other reason (not limited to patent issues), | |
|
376 | conditions are imposed on you (whether by court order, agreement or | |
|
377 | otherwise) that contradict the conditions of this License, they do not | |
|
378 | excuse you from the conditions of this License. If you cannot | |
|
379 | distribute so as to satisfy simultaneously your obligations under this | |
|
380 | License and any other pertinent obligations, then as a consequence you | |
|
381 | may not distribute the Library at all. For example, if a patent | |
|
382 | license would not permit royalty-free redistribution of the Library by | |
|
383 | all those who receive copies directly or indirectly through you, then | |
|
384 | the only way you could satisfy both it and this License would be to | |
|
385 | refrain entirely from distribution of the Library. | |
|
386 | ||
|
387 | If any portion of this section is held invalid or unenforceable under any | |
|
388 | particular circumstance, the balance of the section is intended to apply, | |
|
389 | and the section as a whole is intended to apply in other circumstances. | |
|
390 | ||
|
391 | It is not the purpose of this section to induce you to infringe any | |
|
392 | patents or other property right claims or to contest validity of any | |
|
393 | such claims; this section has the sole purpose of protecting the | |
|
394 | integrity of the free software distribution system which is | |
|
395 | implemented by public license practices. Many people have made | |
|
396 | generous contributions to the wide range of software distributed | |
|
397 | through that system in reliance on consistent application of that | |
|
398 | system; it is up to the author/donor to decide if he or she is willing | |
|
399 | to distribute software through any other system and a licensee cannot | |
|
400 | impose that choice. | |
|
401 | ||
|
402 | This section is intended to make thoroughly clear what is believed to | |
|
403 | be a consequence of the rest of this License. | |
|
404 | ||
|
405 | 12. If the distribution and/or use of the Library is restricted in | |
|
406 | certain countries either by patents or by copyrighted interfaces, the | |
|
407 | original copyright holder who places the Library under this License may add | |
|
408 | an explicit geographical distribution limitation excluding those countries, | |
|
409 | so that distribution is permitted only in or among countries not thus | |
|
410 | excluded. In such case, this License incorporates the limitation as if | |
|
411 | written in the body of this License. | |
|
412 | ||
|
413 | 13. The Free Software Foundation may publish revised and/or new | |
|
414 | versions of the Lesser General Public License from time to time. | |
|
415 | Such new versions will be similar in spirit to the present version, | |
|
416 | but may differ in detail to address new problems or concerns. | |
|
417 | ||
|
418 | Each version is given a distinguishing version number. If the Library | |
|
419 | specifies a version number of this License which applies to it and | |
|
420 | "any later version", you have the option of following the terms and | |
|
421 | conditions either of that version or of any later version published by | |
|
422 | the Free Software Foundation. If the Library does not specify a | |
|
423 | license version number, you may choose any version ever published by | |
|
424 | the Free Software Foundation. | |
|
425 | ||
|
426 | 14. If you wish to incorporate parts of the Library into other free | |
|
427 | programs whose distribution conditions are incompatible with these, | |
|
428 | write to the author to ask for permission. For software which is | |
|
429 | copyrighted by the Free Software Foundation, write to the Free | |
|
430 | Software Foundation; we sometimes make exceptions for this. Our | |
|
431 | decision will be guided by the two goals of preserving the free status | |
|
432 | of all derivatives of our free software and of promoting the sharing | |
|
433 | and reuse of software generally. | |
|
434 | ||
|
435 | NO WARRANTY | |
|
436 | ||
|
437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO | |
|
438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. | |
|
439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR | |
|
440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY | |
|
441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE | |
|
442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
|
443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE | |
|
444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME | |
|
445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
|
446 | ||
|
447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN | |
|
448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY | |
|
449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU | |
|
450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR | |
|
451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE | |
|
452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | |
|
453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | |
|
454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | |
|
455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH | |
|
456 | DAMAGES. | |
|
457 | ||
|
458 | END OF TERMS AND CONDITIONS | |
|
459 | ||
|
460 | How to Apply These Terms to Your New Libraries | |
|
461 | ||
|
462 | If you develop a new library, and you want it to be of the greatest | |
|
463 | possible use to the public, we recommend making it free software that | |
|
464 | everyone can redistribute and change. You can do so by permitting | |
|
465 | redistribution under these terms (or, alternatively, under the terms of the | |
|
466 | ordinary General Public License). | |
|
467 | ||
|
468 | To apply these terms, attach the following notices to the library. It is | |
|
469 | safest to attach them to the start of each source file to most effectively | |
|
470 | convey the exclusion of warranty; and each file should have at least the | |
|
471 | "copyright" line and a pointer to where the full notice is found. | |
|
472 | ||
|
473 | <one line to give the library's name and a brief idea of what it does.> | |
|
474 | Copyright (C) <year> <name of author> | |
|
475 | ||
|
476 | This library is free software; you can redistribute it and/or | |
|
477 | modify it under the terms of the GNU Lesser General Public | |
|
478 | License as published by the Free Software Foundation; either | |
|
479 | version 2.1 of the License, or (at your option) any later version. | |
|
480 | ||
|
481 | This library is distributed in the hope that it will be useful, | |
|
482 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
|
483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
|
484 | Lesser General Public License for more details. | |
|
485 | ||
|
486 | You should have received a copy of the GNU Lesser General Public | |
|
487 | License along with this library; if not, write to the Free Software | |
|
488 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
|
489 | ||
|
490 | Also add information on how to contact you by electronic and paper mail. | |
|
491 | ||
|
492 | You should also get your employer (if you work as a programmer) or your | |
|
493 | school, if any, to sign a "copyright disclaimer" for the library, if | |
|
494 | necessary. Here is a sample; alter the names: | |
|
495 | ||
|
496 | Yoyodyne, Inc., hereby disclaims all copyright interest in the | |
|
497 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. | |
|
498 | ||
|
499 | <signature of Ty Coon>, 1 April 1990 | |
|
500 | Ty Coon, President of Vice | |
|
501 | ||
|
502 | That's all there is to it! | |
|
503 | ||
|
504 |
@@ -0,0 +1,48 | |||
|
1 | #============================================================+ | |
|
2 | # File name : eng.rb | |
|
3 | # Begin : 2004-03-03 | |
|
4 | # Last Update : 2005-03-19 | |
|
5 | # | |
|
6 | # Description : Language module for TCPDF | |
|
7 | # (contains translated texts) | |
|
8 | # | |
|
9 | # | |
|
10 | # Author: Nicola Asuni | |
|
11 | # | |
|
12 | # (c) Copyright: | |
|
13 | # Tecnick.com S.r.l. | |
|
14 | # Via Ugo Foscolo n.19 | |
|
15 | # 09045 Quartu Sant'Elena (CA) | |
|
16 | # ITALY | |
|
17 | # www.tecnick.com | |
|
18 | # info@tecnick.com | |
|
19 | #============================================================+ | |
|
20 | ||
|
21 | # | |
|
22 | # TCPDF language file (contains translated texts). | |
|
23 | # @package com.tecnick.tcpdf | |
|
24 | # @abstract TCPDF language file. | |
|
25 | # @author Nicola Asuni | |
|
26 | # @copyright 2004 Tecnick.com S.r.l (www.tecnick.com) Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com | |
|
27 | # @link http://tcpdf.sourceforge.net | |
|
28 | # @license http://www.gnu.org/copyleft/lesser.html LGPL | |
|
29 | # @since 2004-03-03 | |
|
30 | # | |
|
31 | ||
|
32 | # ENGLISH | |
|
33 | ||
|
34 | @l = [] | |
|
35 | ||
|
36 | # PAGE META DESCRIPTORS -------------------------------------- | |
|
37 | ||
|
38 | @l['a_meta_charset'] = "UTF-8"; | |
|
39 | @l['a_meta_dir'] = "ltr"; | |
|
40 | @l['a_meta_language'] = "en"; | |
|
41 | ||
|
42 | # TRANSLATIONS -------------------------------------- | |
|
43 | @l['w_page'] = "page"; | |
|
44 | ||
|
45 | #============================================================+ | |
|
46 | # END OF FILE | |
|
47 | #============================================================+ | |
|
48 |
@@ -0,0 +1,64 | |||
|
1 | # The MIT License | |
|
2 | # | |
|
3 | # Permission is hereby granted, free of charge, to any person obtaining a copy | |
|
4 | # of this software and associated documentation files (the "Software"), to deal | |
|
5 | # in the Software without restriction, including without limitation the rights | |
|
6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
|
7 | # copies of the Software, and to permit persons to whom the Software is | |
|
8 | # furnished to do so, subject to the following conditions: | |
|
9 | # | |
|
10 | # The above copyright notice and this permission notice shall be included in | |
|
11 | # all copies or substantial portions of the Software. | |
|
12 | # | |
|
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
|
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
|
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
|
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
|
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
|
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
|
19 | # THE SOFTWARE. | |
|
20 | # | |
|
21 | # This implements native php methods used by tcpdf, which have had to be | |
|
22 | # reimplemented within Ruby. | |
|
23 | ||
|
24 | module RFPDF | |
|
25 | ||
|
26 | # http://uk2.php.net/getimagesize | |
|
27 | def getimagesize(filename) | |
|
28 | out = Hash.new | |
|
29 | out[2] = ImageScience.image_type(filename) | |
|
30 | ||
|
31 | image = ImageScience.with_image(filename) do |img| | |
|
32 | out[0] = image.width | |
|
33 | out[1] = image.height | |
|
34 | ||
|
35 | # These are actually meant to return integer values But I couldn't seem to find anything saying what those values are. | |
|
36 | # So for now they return strings. The only place that uses this at the moment is the parsejpeg method, so I've changed that too. | |
|
37 | case out[2] | |
|
38 | when "GIF" | |
|
39 | out['mime'] = "image/gif" | |
|
40 | when "JPEG" | |
|
41 | out['mime'] = "image/jpeg" | |
|
42 | when "PNG" | |
|
43 | out['mime'] = "image/png" | |
|
44 | when "WBMP" | |
|
45 | out['mime'] = "image/vnd.wap.wbmp" | |
|
46 | when "XPM" | |
|
47 | out['mime'] = "image/x-xpixmap" | |
|
48 | end | |
|
49 | out[3] = "height=\"#{image.height}\" width=\"#{image.width}\"" | |
|
50 | ||
|
51 | if image.colorspace == "CMYK" || image.colorspace == "RGBA" | |
|
52 | out['channels'] = 4 | |
|
53 | elsif image.colorspace == "RGB" | |
|
54 | out['channels'] = 3 | |
|
55 | end | |
|
56 | ||
|
57 | out['bits'] = image.depth | |
|
58 | out['bits'] /= out['channels'] if out['channels'] | |
|
59 | end | |
|
60 | ||
|
61 | out | |
|
62 | end | |
|
63 | ||
|
64 | end No newline at end of file |
@@ -0,0 +1,64 | |||
|
1 | # The MIT License | |
|
2 | # | |
|
3 | # Permission is hereby granted, free of charge, to any person obtaining a copy | |
|
4 | # of this software and associated documentation files (the "Software"), to deal | |
|
5 | # in the Software without restriction, including without limitation the rights | |
|
6 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
|
7 | # copies of the Software, and to permit persons to whom the Software is | |
|
8 | # furnished to do so, subject to the following conditions: | |
|
9 | # | |
|
10 | # The above copyright notice and this permission notice shall be included in | |
|
11 | # all copies or substantial portions of the Software. | |
|
12 | # | |
|
13 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
|
14 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
|
15 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
|
16 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
|
17 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
|
18 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
|
19 | # THE SOFTWARE. | |
|
20 | # | |
|
21 | # This implements native php methods used by tcpdf, which have had to be | |
|
22 | # reimplemented within Ruby. | |
|
23 | ||
|
24 | module RFPDF | |
|
25 | ||
|
26 | # http://uk2.php.net/getimagesize | |
|
27 | def getimagesize(filename) | |
|
28 | image = Magick::ImageList.new(filename) | |
|
29 | ||
|
30 | out = Hash.new | |
|
31 | out[0] = image.columns | |
|
32 | out[1] = image.rows | |
|
33 | ||
|
34 | # These are actually meant to return integer values But I couldn't seem to find anything saying what those values are. | |
|
35 | # So for now they return strings. The only place that uses this at the moment is the parsejpeg method, so I've changed that too. | |
|
36 | case image.mime_type | |
|
37 | when "image/gif" | |
|
38 | out[2] = "GIF" | |
|
39 | when "image/jpeg" | |
|
40 | out[2] = "JPEG" | |
|
41 | when "image/png" | |
|
42 | out[2] = "PNG" | |
|
43 | when " image/vnd.wap.wbmp" | |
|
44 | out[2] = "WBMP" | |
|
45 | when "image/x-xpixmap" | |
|
46 | out[2] = "XPM" | |
|
47 | end | |
|
48 | out[3] = "height=\"#{image.rows}\" width=\"#{image.columns}\"" | |
|
49 | out['mime'] = image.mime_type | |
|
50 | ||
|
51 | # This needs work to cover more situations | |
|
52 | # I can't see how to just list the number of channels with ImageMagick / rmagick | |
|
53 | if image.colorspace.to_s == "CMYKColorspace" | |
|
54 | out['channels'] = 4 | |
|
55 | elsif image.colorspace.to_s == "RGBColorspace" | |
|
56 | out['channels'] = 3 | |
|
57 | end | |
|
58 | ||
|
59 | out['bits'] = image.channel_depth | |
|
60 | ||
|
61 | out | |
|
62 | end | |
|
63 | ||
|
64 | end No newline at end of file |
|
1 | NO CONTENT: new file 100755 |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
@@ -0,0 +1,2 | |||
|
1 | This folder contains fonts descriptions for TCPDF. | |
|
2 | Please read the documentation on subfolders for copyright, license and other information. No newline at end of file |
@@ -0,0 +1,25 | |||
|
1 | TCPDFFontDescriptor.define('courier') do |font| | |
|
2 | font[:cw] = {} | |
|
3 | 0.upto(255) do |i| | |
|
4 | font[:cw][i]=600 | |
|
5 | end | |
|
6 | end | |
|
7 | TCPDFFontDescriptor.define('courierb') do |font| | |
|
8 | font[:cw] = {} | |
|
9 | 0.upto(255) do |i| | |
|
10 | font[:cw][i]=600 | |
|
11 | end | |
|
12 | end | |
|
13 | TCPDFFontDescriptor.define('courierbi') do |font| | |
|
14 | font[:cw] = {} | |
|
15 | 0.upto(255) do |i| | |
|
16 | font[:cw][i]=600 | |
|
17 | end | |
|
18 | end | |
|
19 | TCPDFFontDescriptor.define('courieri') do |font| | |
|
20 | font[:cw] = {} | |
|
21 | 0.upto(255) do |i| | |
|
22 | font[:cw][i]=600 | |
|
23 | end | |
|
24 | end | |
|
25 |
@@ -0,0 +1,38 | |||
|
1 | Adrian Schroeter | |
|
2 | Andrey Valentinovich Panov | |
|
3 | Ben Laenen | |
|
4 | Bhikkhu Pesala | |
|
5 | Clayborne Arevalo | |
|
6 | Dafydd Harries | |
|
7 | Danilo Segan | |
|
8 | Davide Viti | |
|
9 | David Jez | |
|
10 | David Lawrence Ramsey | |
|
11 | Denis Jacquerye | |
|
12 | Dwayne Bailey | |
|
13 | Eugeniy Meshcheryakov | |
|
14 | Gee Fung Sit | |
|
15 | Heikki Lindroos | |
|
16 | James Cloos | |
|
17 | James Crippen | |
|
18 | John Karp | |
|
19 | Keenan Pepper | |
|
20 | Lars Naesbye Christensen | |
|
21 | Mashrab Kuvatov | |
|
22 | Mederic Boquien | |
|
23 | Michael Everson | |
|
24 | Misu Moldovan | |
|
25 | Nguyen Thai Ngoc Duy | |
|
26 | Ognyan Kulev | |
|
27 | Ondrej Koala Vacha | |
|
28 | Peter Cernak | |
|
29 | Remy Oudompheng | |
|
30 | Roozbeh Pournader | |
|
31 | Sander Vesik | |
|
32 | Stepan Roh | |
|
33 | Tavmjong Bah | |
|
34 | Tim May | |
|
35 | Valentin Stoykov | |
|
36 | Vasek Stodulka | |
|
37 | ||
|
38 | $Id: AUTHORS 1491 2007-01-12 20:40:12Z ben_laenen $ |
@@ -0,0 +1,3 | |||
|
1 | See http://dejavu.sourceforge.net/wiki/index.rb/Bugs | |
|
2 | ||
|
3 | $Id: BUGS 80 2004-11-13 13:12:02Z src $ |
@@ -0,0 +1,98 | |||
|
1 | Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) | |
|
2 | ||
|
3 | Bitstream Vera Fonts Copyright | |
|
4 | ------------------------------ | |
|
5 | ||
|
6 | Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is | |
|
7 | a trademark of Bitstream, Inc. | |
|
8 | ||
|
9 | Permission is hereby granted, free of charge, to any person obtaining a copy | |
|
10 | of the fonts accompanying this license ("Fonts") and associated | |
|
11 | documentation files (the "Font Software"), to reproduce and distribute the | |
|
12 | Font Software, including without limitation the rights to use, copy, merge, | |
|
13 | publish, distribute, and/or sell copies of the Font Software, and to permit | |
|
14 | persons to whom the Font Software is furnished to do so, subject to the | |
|
15 | following conditions: | |
|
16 | ||
|
17 | The above copyright and trademark notices and this permission notice shall | |
|
18 | be included in all copies of one or more of the Font Software typefaces. | |
|
19 | ||
|
20 | The Font Software may be modified, altered, or added to, and in particular | |
|
21 | the designs of glyphs or characters in the Fonts may be modified and | |
|
22 | additional glyphs or characters may be added to the Fonts, only if the fonts | |
|
23 | are renamed to names not containing either the words "Bitstream" or the word | |
|
24 | "Vera". | |
|
25 | ||
|
26 | This License becomes null and void to the extent applicable to Fonts or Font | |
|
27 | Software that has been modified and is distributed under the "Bitstream | |
|
28 | Vera" names. | |
|
29 | ||
|
30 | The Font Software may be sold as part of a larger software package but no | |
|
31 | copy of one or more of the Font Software typefaces may be sold by itself. | |
|
32 | ||
|
33 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
|
34 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, | |
|
35 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, | |
|
36 | TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME | |
|
37 | FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING | |
|
38 | ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, | |
|
39 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF | |
|
40 | THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE | |
|
41 | FONT SOFTWARE. | |
|
42 | ||
|
43 | Except as contained in this notice, the names of Gnome, the Gnome | |
|
44 | Foundation, and Bitstream Inc., shall not be used in advertising or | |
|
45 | otherwise to promote the sale, use or other dealings in this Font Software | |
|
46 | without prior written authorization from the Gnome Foundation or Bitstream | |
|
47 | Inc., respectively. For further information, contact: fonts at gnome dot | |
|
48 | org. | |
|
49 | ||
|
50 | Arev Fonts Copyright | |
|
51 | ------------------------------ | |
|
52 | ||
|
53 | Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. | |
|
54 | ||
|
55 | Permission is hereby granted, free of charge, to any person obtaining | |
|
56 | a copy of the fonts accompanying this license ("Fonts") and | |
|
57 | associated documentation files (the "Font Software"), to reproduce | |
|
58 | and distribute the modifications to the Bitstream Vera Font Software, | |
|
59 | including without limitation the rights to use, copy, merge, publish, | |
|
60 | distribute, and/or sell copies of the Font Software, and to permit | |
|
61 | persons to whom the Font Software is furnished to do so, subject to | |
|
62 | the following conditions: | |
|
63 | ||
|
64 | The above copyright and trademark notices and this permission notice | |
|
65 | shall be included in all copies of one or more of the Font Software | |
|
66 | typefaces. | |
|
67 | ||
|
68 | The Font Software may be modified, altered, or added to, and in | |
|
69 | particular the designs of glyphs or characters in the Fonts may be | |
|
70 | modified and additional glyphs or characters may be added to the | |
|
71 | Fonts, only if the fonts are renamed to names not containing either | |
|
72 | the words "Tavmjong Bah" or the word "Arev". | |
|
73 | ||
|
74 | This License becomes null and void to the extent applicable to Fonts | |
|
75 | or Font Software that has been modified and is distributed under the | |
|
76 | "Tavmjong Bah Arev" names. | |
|
77 | ||
|
78 | The Font Software may be sold as part of a larger software package but | |
|
79 | no copy of one or more of the Font Software typefaces may be sold by | |
|
80 | itself. | |
|
81 | ||
|
82 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
|
83 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF | |
|
84 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT | |
|
85 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL | |
|
86 | TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | |
|
87 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL | |
|
88 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | |
|
89 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM | |
|
90 | OTHER DEALINGS IN THE FONT SOFTWARE. | |
|
91 | ||
|
92 | Except as contained in this notice, the name of Tavmjong Bah shall not | |
|
93 | be used in advertising or otherwise to promote the sale, use or other | |
|
94 | dealings in this Font Software without prior written authorization | |
|
95 | from Tavmjong Bah. For further information, contact: tavmjong @ free | |
|
96 | . fr. | |
|
97 | ||
|
98 | $Id: LICENSE 778 2006-04-20 18:14:24Z moyogo $ |
This diff has been collapsed as it changes many lines, (789 lines changed) Show them Hide them | |||
@@ -0,0 +1,789 | |||
|
1 | Changes from 2.14 to 2.15 | |
|
2 | ||
|
3 | - improved hinting in Sans Oblique to deal with some spacing and inconsistency | |
|
4 | issues (by Ben Laenen) | |
|
5 | - added anchors to Mono Book, and added GPOS rules for combining diacritics to | |
|
6 | show up as zero width glyphs (by Ben Laenen) | |
|
7 | - removed U+F21C (PUA), it was copy of U+2C64 from Latin Extended C (by Eugeniy | |
|
8 | Meshcheryakov) | |
|
9 | - added U+27E6-U+27E7 to Sans (by Gee Fung Sit) | |
|
10 | - added U+1407, U+1409, U+140C-U+141B, U+141D-U+1425, U+1427-U+142E, | |
|
11 | U+1435-U+1438, U+143A-U+1449, U+1452, U+1454, U+1457-U+1465, U+1467-U+146A, | |
|
12 | U+1471, U+1474-U+1482, U+1484-U+1488, U+148F, U+1492, U+14A0, U+14A2, U+14A9, | |
|
13 | U+14AC-U+14BA, U+14BC, U+14BD, U+14C6, U+14C9-U+14CF, U+14D1, U+14D2, U+14D9, | |
|
14 | U+14DC-U+14E9, U+14EC, U+14F3, U+14F6-U+1504, U+1506, U+1507, U+1510-U+1525, | |
|
15 | U+152C, U+152F-U+153D, U+1540, U+1541, U+154E, U+154F, U+1552, U+155B, U+155C, | |
|
16 | U+1568, U+1569, U+1574-U+157B, U+157D, U+15A7-U+15AE, U+1646, U+1647 (by | |
|
17 | Eugeniy Meshcheryakov) | |
|
18 | - fixed several contours to not intersect, use horizontal or vertical tangents, | |
|
19 | use integer coordinates, etc in Sans Book (by Denis Jacquerye) | |
|
20 | - added U+0496-U+0497 in Serif (by Andrey V. Panov) | |
|
21 | ||
|
22 | Changes from 2.13 to 2.14 | |
|
23 | ||
|
24 | - added Philippine peso glyph U+20B1 (by Clayborne Arevalo) | |
|
25 | - made U+2012 have the same width as digits, according to Unicode 5.0, | |
|
26 | page 206 (by Roozbeh Pournader) | |
|
27 | - made all of the "above" combining characters remove the dot of "i", | |
|
28 | "j", etc (Soft_Dotted characters), according to Unicode 5.0, | |
|
29 | page 228 (by Roozbeh Pournader) | |
|
30 | - made U+012F, U+03F3, U+0456, U+0458, U+1E2D, and U+1ECB (all fonts | |
|
31 | except Mono), U+0249, U+2148, and U+2149 (Sans and Sans Condensed), | |
|
32 | U+0268 (Sans ExtraLight, Serif and Serif Condensed), and U+029D (Serif | |
|
33 | and Serif Condensed) respect the Soft_Dotted property (by Roozbeh | |
|
34 | Pournader) | |
|
35 | - added U+223E, U+223F, U+2240, U+22C2, U+22C3 to Sans (by Rémy Oudompheng) | |
|
36 | - added U+203D to Serif (by Gee Fung Sit) | |
|
37 | - added zero-width glyphs for U+2061-U+2063 to Sans and Serif (by Gee | |
|
38 | Fung Sit) | |
|
39 | - changed isolated forms of Arabic waw (U+0648, U+0624 and U+06C6) (bug #9432) | |
|
40 | (by Ben Laenen) | |
|
41 | - added Lao consonants U+0E81, U+0E82, U+0E84, U+0E87, U+0E88, U+0E8A, | |
|
42 | U+0E8D, U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA, | |
|
43 | U+0EAB, U+0EAD-0EAF to Sans Mono (by Rémy Oudompheng) | |
|
44 | - added U+0200-U+0217, U+0226-U+0229, U+02F3, U+1E00-U+1E07, | |
|
45 | U+1E0A-U+1E0B, U+1E18-U+1E1F, U+1E22-U+1E23, U+1E28-U+1E2D, | |
|
46 | U+1E3A-U+1E3B, U+1E40, U+1E48-U+1E49, U+1E56, U+1E58-U+1E59, | |
|
47 | U+1E5E-U+1E5F, U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, U+1E72-U+1E77, | |
|
48 | U+1E86-U+1E8B, U+1E92-U+1E96, U+1EA0-U+1EA1, U+1EF4-U+1EF5 to Mono | |
|
49 | (by Ben Laenen) | |
|
50 | - renamed uppercase variants of diacritics (macron, breve, double grave, | |
|
51 | double acute, inverted breve, dot above) to "uni03XX.case" in Mono | |
|
52 | (by Ben Laenen) | |
|
53 | - moved uppercase variants of diacritics up in Mono so they properly | |
|
54 | vertically align on capitals (by Ben Laenen) | |
|
55 | - precomposed glyphs with macron, breve, double grave, double acute, | |
|
56 | inverted breve, dot above, macron below, breve below, inverted breve | |
|
57 | below, dot below, cedilla, caron below, circumflex below, diaeresis | |
|
58 | below, tilde below now reference to combining diacritics instead of | |
|
59 | space modifiers in Mono (by Ben Laenen) | |
|
60 | - made ring below (U+0325), and half rings below (U+031C and U+0339) | |
|
61 | smaller in Mono (by Ben Laenen) | |
|
62 | - added U+205F to all fonts (by Roozbeh Pournader) | |
|
63 | - added U+035E-U+035F to Sans (by Roozbeh Pournader) | |
|
64 | - added empty glyphs for U+034F, U+202A-U+202E, U+2060, U+206A-206F, | |
|
65 | U+FE00-U+FE0F to non-Mono fonts (by Roozbeh Pournader) | |
|
66 | - added U+2101, U+2107-U+2108, U+210B, U+210C, U+2110, U+2112, U+211B, | |
|
67 | U+211F, U+2123, U+2125, U+2128-U+2129, U+212C-U+212D, U+212F, | |
|
68 | U+2130-U+2131, U+2133, U+2136-U+213A, U+2141-U+2144, U+2B00-U+2B11, | |
|
69 | U+2B20-U+2B23 to Sans (by John Karp) | |
|
70 | - reshaped omega (U+03C9) in Mono (by Ben Laenen) | |
|
71 | - added U+2205, U+22C6, U+2300-U+2301, U+2303-U+2306, U+230C-U+230F, | |
|
72 | U+2312-U+2315, U+231C-U+231F, U+2335, U+2337-U+233E, U+2341-U+2344, | |
|
73 | U+2347-U+2348, U+234B-U+234D, U+2349-U+2350, U+2352-U+2354, | |
|
74 | U+2357-U+2359, U+235A-U+235C, U+235E-U+2360, U+2363-U+2365, | |
|
75 | U+2368-U+2369, U+236B-U+2370, U+2373-U+237A, U+2380-U+2383, | |
|
76 | U+2388-U+238B, U+2395 in Mono (by Ben Laenen) | |
|
77 | ||
|
78 | Changes from 2.12 to 2.13 | |
|
79 | ||
|
80 | - adjusted U+0198B, U+01B3-U+01B4 in Sans, hinted U+01B4 in Sans Book | |
|
81 | (by Denis Jacquerye) | |
|
82 | - added U+27F0-U+27FF, U+2906-U+2907, U+290A-U+290B, U+2940-U+2941 to Sans | |
|
83 | (by Denis Jacquerye) | |
|
84 | - added U+01E6-U+01E9, U+01EE-U+01EF, U+01F4-U+01F5, U+01FC-U+01FF, | |
|
85 | U+021E-U+021F, U+0245, U+02BD, U+02C9, U+1E9B, U+2045-U+2046, U+2213, U+22C5, | |
|
86 | U+22EF to Sans Mono (by Roozbeh Pournader) | |
|
87 | - added U+04FA-U+04FD to Sans (by Michael Everson) | |
|
88 | - removed U+2329 and U+232A because of their CJK properties, added U+27E8 | |
|
89 | and U+27E9 in their stead, fixing part of bug #9038 (by Roozbeh Pournader) | |
|
90 | - corrected and improvised U+0466-U+0469, U+046E-U+0471, U+047C-U+047D, U+0482, | |
|
91 | U+0484-U+0486, U+0492-U+0493, U+04B0-U+04B1, U+050C-U+050D, and U+204A | |
|
92 | in Sans (by Michael Everson) | |
|
93 | - added instructions for U+0402, U+0409, U+040A, U+040B, U+044D, U+040F, | |
|
94 | U+0452, U+0459-U+045B, U+045F to Sans Book (by Eugeniy Meshcheryakov) | |
|
95 | - made italic shape for U+431, U+432, U+437, U+43B, U+43C, U+43D, U+444, U+447, | |
|
96 | U+44D, U+44F, U+459, U+45A in SerifOblique and SerifBoldOblique | |
|
97 | (by Andrey V. Panov) | |
|
98 | - modified U+024C to match glyph in Unicode chart, fixing bug #9039 | |
|
99 | (by Denis Jacquerye) | |
|
100 | - made some canonically equivalent characters share the same glyph: | |
|
101 | U+02B9 = U+0374, U+0343 = U+0313, and U+0387 = U+00B7 also adjusting U+02BA | |
|
102 | to look like double U+02B9, fixing parts of bug #9038 (by Roozbeh Pournader) | |
|
103 | - changed shapes for U+0478 and U+0479 in Sans to those in the Unicode charts, | |
|
104 | based on a recent decision by Unicode Technical Committee to only use | |
|
105 | the digraph form (by Michael Everson) | |
|
106 | - adjusted width of NBSP U+00A0 and NNBSP U+202F, fixing bug #8401 | |
|
107 | (by Denis Jacquerye) | |
|
108 | - fixed several contours to not intersect, use horizontal or vertical tangents, | |
|
109 | use integer coordinates, etc (by Roozbeh Pournader and Denis Jacquerye) | |
|
110 | - added U+1402, U+1430, U+144D, U+146C, U+148A, U+14A4, U+14C1, U+14D4, U+14EE, | |
|
111 | U+1527, U+1545, U+157E, U+158E, U+15AF to Sans (by Eugeniy Meshcheryakov) | |
|
112 | - enlarged width of U+459 and U+45A in Serif (by Andrey V. Panov) | |
|
113 | - made traditional shape for U+452, U+45B (by Andrey V. Panov) | |
|
114 | - added euro sign U+20AC to Sans ExtraLight, making fontconfig recognize | |
|
115 | the font as supporting English (by Denis Jacquerye) | |
|
116 | ||
|
117 | Changes from 2.11 to 2.12 | |
|
118 | ||
|
119 | - added U+0180 to Serif (by Denis Jacquerye) | |
|
120 | - improved and/or hinted Armenian letters U+0542, U+0546, U+0562, | |
|
121 | U+0563, U+0564, U+0577, U+0582 in Sans (by Ben Laenen) | |
|
122 | - added U+4FE-U+4FF, U+512-U+513, U+2114, U+214E, U+26B2 to Sans | |
|
123 | (by Gee Fung Sit) | |
|
124 | - adjusted U+0496-U+0497, U+049A-U+04A1 in Sans to match U+0416, | |
|
125 | U+041A, U+0436 and U+043A (by Gee Fung Sit) | |
|
126 | - Mathematical Operators in Sans: changed U+22C0-U+22C1 to match | |
|
127 | other n-ary operators, adjusted U+2203-U+2204, changed U+2220 in | |
|
128 | Sans to match the style of U+2221 (by Gee Fung Sit) | |
|
129 | - added U+1401, U+1403-U+1406, U+140A, U+140B, U+1426, U+142F, | |
|
130 | U+1431-U+1434, U+1438, U+1439, U+1449, U+144A, U+144C, | |
|
131 | U+144E-U+1451, U+1455, U+1456, U+1466, U+146B, U+146D-U+1470, | |
|
132 | U+1472, U+1473, U+1483, U+1489, U+148B-U+148E, U+1490, U+1491, | |
|
133 | U+14A1, U+14A3, U+14A5-U+14A8, U+14AA, U+14AB, U+14BB, U+14C0, | |
|
134 | U+14C2-U+14C5, U+14C7, U+14C8, U+14D0, U+14D3, U+14D5-U+14D8, | |
|
135 | U+14DA, U+14DB, U+14EA, U+14ED, U+14EF-U+14F2, U+14F4, U+14F5, | |
|
136 | U+1405, U+1526, U+1528-U+152B, U+152D, U+152E, U+153E, | |
|
137 | U+1542-U+1544, U+1546-U+154D, U+1550, U+1553, U+1555-U+155A, | |
|
138 | U+1567, U+156A, U+157C, U+157F-U+1585, U+158A-U+158D, | |
|
139 | U+158F-U+1596, U+15A0-U+15A6, U+15DE, U+15E1, U+166E-U+1676 to | |
|
140 | Sans (by Eugeniy Meshcheryakov) | |
|
141 | - re-enabled Latin ligatures fi, ffi, fl, ffl and ff in Sans | |
|
142 | (by Ben Laenen) | |
|
143 | - made italic shape for U+436, U+44A, U+44B, U+44C, U+44E, U+45F, | |
|
144 | U+463 in SerifOblique and SerifBoldOblique (by Andrey V. Panov) | |
|
145 | - fixed sub- and superscript metrics in Condensed Sans (bug #8848) | |
|
146 | (by Ben Laenen) | |
|
147 | - added U+474, U+475 in Serif (by Andrey V. Panov) | |
|
148 | - hinted Greek glyphs U+03B7, U+30B8, U+03B9, U+03C1, U+03C3, | |
|
149 | U+03C6 in Mono Book (by Ben Laenen) | |
|
150 | ||
|
151 | Changes from 2.10 to 2.11 | |
|
152 | ||
|
153 | - added instructions for Hebrew glyphs (Sans Book, by Eugeniy | |
|
154 | Meshcheryakov) | |
|
155 | - changed U+01A6 (Latin Yr) after bug #8212, in Sans, Serif and | |
|
156 | Sans Mono fonts (by Denis Jacquerye). | |
|
157 | - removed instruction for U+2600-U+26A1 (by Mederic Boquien) | |
|
158 | - added U+202F and set width of U+00A0 (nobreakingspace) to the | |
|
159 | same as U+0020, space (by Denis Jacquerye). | |
|
160 | - added and improved instructions for various Cyrillic letters | |
|
161 | (by Eugeniy Meshcheryakov) | |
|
162 | - Changed U+416, U+42F, U+427 (non-Bold), U+436, U+447 (non-Bold), | |
|
163 | U+44F, U+437 (Bold), corrected U+40F, U+414, U+424, U+426, U+429, | |
|
164 | U+434, U+438 (Bold), U+446, U+449, U+44D (non-Bold), U+45F in | |
|
165 | Sans Mono (by Andrey V. Panov) | |
|
166 | - made small corrections to Cyrillic, most appreciable to U+409, | |
|
167 | U+413, U+41B, U+427 and U+433, U+434, U+43B, U+447, U+459 | |
|
168 | (upright fonts) to Serif (by Andrey V. Panov) | |
|
169 | - adjusted bearings of U+410, U+416, U+41A, U+42F, U+436, U+43A, | |
|
170 | U+443, U+44F in Serif (by Andrey V. Panov) | |
|
171 | - enlarged width of U+44A, U+44B, U+44C, U+463 in Serif | |
|
172 | (by Andrey V. Panov) | |
|
173 | - added ligature "iacute" as "afii10103" (U+456) "acutecomb" in | |
|
174 | Serif (by Andrey V. Panov) | |
|
175 | - made italic shape to U+446, U+448, U+449 in Serif (by Andrey V. | |
|
176 | Panov) | |
|
177 | - added "afii10831" (U+F6C7), "afii10832" (U+F6C8) in Serif (by | |
|
178 | Andrey V. Panov) | |
|
179 | - new minimum version of fontforge is 20061014 (by Ben Laenen) | |
|
180 | ||
|
181 | Changes from 2.9 to 2.10: | |
|
182 | ||
|
183 | - added U+0242, U+024A-U+024B, U+024E-U+024F, U+037C-U+037D, U+0E3F, | |
|
184 | U+1D2C-U+1D2E, U+1D30-U+1D42, U+1D5D-U+1D6A, U+1D78, U+1DB8, | |
|
185 | U+2090-U+2094, U+20D0-U+20D1, U+2C60-U+2C66, U+2C6B-U+2C6C, U+2C74 and | |
|
186 | U+FB29 to Sans (by Gee Fung Sit) | |
|
187 | - added Lao glyphs : U+0E81-0E82, U+E084, U+0E87-0E88, U+0E8A, U+0E8D, | |
|
188 | U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA-0EAB, | |
|
189 | U+0EAD-0EB9, U+0EBB-0EBD, U+0EC0-0EC4, U+0EC6, U+0EC8-0ECD, U+0EDC-0EDD | |
|
190 | (by Rémy Oudompheng) | |
|
191 | - fixed U+0193 not showing in Windows (bug #7897) (by Ben Laenen) | |
|
192 | - changes to U+222B-222D in Sans Mono (by Rémy Oudompheng) | |
|
193 | - ported the three remaining currency symbols from Arev (U+20B0, | |
|
194 | U+20B2-U+20B3), and replaced one (U+20AF) in Sans (by Lars Naesbye | |
|
195 | Christensen) | |
|
196 | - corrected U+20A5 in Sans (by Gee Fung Sit) | |
|
197 | - merged Double-Struck Letters from Arev: U+2102, U+210D, U+2115, | |
|
198 | U+2119-U+211A, U+2124, U+213C-U+2140 (by Gee Fung Sit) | |
|
199 | - added U+2308-U+230B and U+2329-U+232A to Sans Mono and Serif faces, | |
|
200 | fixed incorrect direction of U+2329 in Sans faces, and improved | |
|
201 | U+2308-U+230B in Sans faces per Ben Laenen's suggestions (by David | |
|
202 | Lawrence Ramsey) | |
|
203 | - added U+06D5 and final form of it (needed for Kurdish) (by Ben Laenen) | |
|
204 | - added two special glyphs U+F000 and U+F001 in Sans Book that show the | |
|
205 | current ppem size (horizontal and vertical) (by Ben Laenen) | |
|
206 | - added U+2318 and U+2325 to Sans Mono faces, based on the Sans versions | |
|
207 | (by David Lawrence Ramsey) | |
|
208 | - added U+2B14-U+2B1A to all faces except Sans ExtraLight (by David | |
|
209 | Lawrence Ramsey) | |
|
210 | - respaced all Geometric Shapes characters in Serif faces to match those | |
|
211 | in Sans faces again, respaced U+23CF in Sans, Sans ExtraLight, and | |
|
212 | Serif faces to match U+25A0 (or Sans in Sans ExtraLight's case) again, | |
|
213 | and respaced U+2B12-U+2B13 in Sans and Serif faces to match U+25A1 | |
|
214 | again (by David Lawrence Ramsey) | |
|
215 | - corrected width of Modifier Small Letters U+1D43-1D5B in Sans Oblique | |
|
216 | and U+1D9B-U+1DBF in Sans Oblique and Sans Bold Oblique (by Gee Fung Sit) | |
|
217 | - added a bunch of glyphs to Sans ExtraLight (see SVN for details) (by | |
|
218 | Gee Fung Sit) | |
|
219 | - adjusted Cyrillic descenders in Sans ExtraLight to sync with Sans (by | |
|
220 | Gee Fung Sit) | |
|
221 | - added U+0242, U+0245 to Serif (by Gee Fung Sit) | |
|
222 | - replaced the SHPIX routines which gave them bad spacing at certain | |
|
223 | sizes in FreeType for A, V, Z, v and z in Sans Bold (by Ben Laenen) | |
|
224 | ||
|
225 | Changes from 2.8 to 2.9: | |
|
226 | ||
|
227 | - DejaVuSansExtraLight.sfd: changed family name from "DejaVu Sans" to | |
|
228 | "DejaVu Sans Light" (in case we add a Light weight variant), so legacy | |
|
229 | apps that understand only 4 styles are happy. (by Denis Jacquerye) | |
|
230 | - added Name ID 16, aka preferred family name, and Name ID 17, aka | |
|
231 | preferred style name, so contemporary apps that understand more that 4 | |
|
232 | styles can use big fonts families "DejaVu Sans" and "DejaVu Serif". For | |
|
233 | those, Extralight and Condensed are just styles not different families. | |
|
234 | (by Denis Jacquerye) | |
|
235 | - added U+22B6-22BD, U+22C0-22C1, U+22D6-22D7 to Sans. (by Remy Oudompheng) | |
|
236 | - added U+037B, U+2184, U+2C67-U+2C6A and U+2C75-U+2C77 to Sans (by Gee | |
|
237 | Fung Sit) | |
|
238 | - adjusted asteriskmath (U+2217) for consistency with other mathematical | |
|
239 | operators in Sans (by Ben Laenen) | |
|
240 | - hinted some Armenian capitals in Sans Book (by Ben Laenen) | |
|
241 | - added U+0246 - U+0249 (by Ben Laenen) | |
|
242 | - BUGFIX : swapped U+224E and U+224F, in Sans, Sans Condensed and Sans Mono | |
|
243 | (by Remy Oudompheng) | |
|
244 | - adjusted U+20B5 (by Mederic Boquien) | |
|
245 | - swapped U+21DA and U+21DB which were in wrong order (by Heikki Lindroos) | |
|
246 | - added U+222E-2233, U+239B-23AD, U+2A00-2A02, U+2A0F-2A1C to Sans (by Remy | |
|
247 | Oudompheng) | |
|
248 | - added U+239B-23AD to Mono (by Remy Oudompheng) | |
|
249 | - added U+2024-2025 to Serif (by Mederic Boquien) | |
|
250 | - added U+222C-222D, U+2A0C-2A0E to Serif (by Remy Oudompheng) | |
|
251 | - added U+2190-21FF to Mono (by Heikki Lindroos) | |
|
252 | - added Hebrew glyphs - U+05B0-U+05BD, U+05BF-U+05C3, U+05C6, U+05C7, | |
|
253 | U+05D0-U+05EA, U+05F0-U+05F2, U+FB1F, U+FB20, U+FB2A-U+FB36, | |
|
254 | U+FB38-U+FB3C, U+FB3E, U+FB40, U+FB41, U+FB43, U+FB44, U+FB46-U+FB4E (by | |
|
255 | Gee Fung Sit and Eugeniy Meshcheryakov) | |
|
256 | - adjustments for Cyrillic in Sans (by Andrey V. Panov) | |
|
257 | - made italic shape for U+0434, U+0456, U+0457 in SerifOblique and Serif | |
|
258 | Bold Oblique (by Andrey V. Panov) | |
|
259 | ||
|
260 | Changes from 2.7 to 2.8: | |
|
261 | ||
|
262 | - fixed instructions for U+0423, U+0427, U+0447, U+0448 in Serif, so they | |
|
263 | look good at large sizes too (by Eugeniy Meshcheryakov) | |
|
264 | - added U+FB00 and U+FB03 to U+FB06 to Serif typefaces (by Heikki Lindroos) | |
|
265 | - added U+26B0-U+26B1, U+2701-U+2704, U+2706-U+2709, U+270C-U+2727, U+2729 | |
|
266 | to U+274B, U+274D, U+274F to U+2752, U+2756, U+2758-U+275E, U+2761 to | |
|
267 | U+2775 (by Heikki Lindroos) | |
|
268 | - added and improved instructions for Cyrillic letters in Mono and Serif | |
|
269 | (Book, by Eugeniy Meshcheryakov) | |
|
270 | - rotated U+26B0 (was too small in mono) (by Gee Fung Sit) | |
|
271 | - adjusted U+1EDA-U+1EDD, U+1EE8-U+1EEB, capitals using capital specific | |
|
272 | accent and moved diacritics to match position on U+00F2 (ograve), etc. | |
|
273 | (by Denis Jacquerye) | |
|
274 | - added U+20D6, U+20D7 to Sans (by Gee Fung Sit) | |
|
275 | - made Armenian ligatures discretionary since the Firefox ligature problem | |
|
276 | still isn't fixed (by Ben Laenen) | |
|
277 | - moved Armenian hyphen U+058A to a higher position (bug #7436) (by Ben | |
|
278 | Laenen) | |
|
279 | - hinted Greek glyphs in Sans Bold (by Ben Laenen) | |
|
280 | - enabled Arabic lam-alif ligatures when diacritics are used (by Ben Laenen) | |
|
281 | ||
|
282 | Changes from 2.6 to 2.7: | |
|
283 | ||
|
284 | - added glyphs needed for Kurdish: U+0695, U+06B5, U+06C6, U+06CE and their | |
|
285 | init/medi/fina forms in Sans (by Ben Laenen) | |
|
286 | - added U+02CD, U+01F8 - U+01F9, U+1E3E - U+1E3F, U+1E30 - U+1E35, U+1EBC - | |
|
287 | U+1EBD, U+1EF8 - U+1EF9 (includes glyphs needed for Yoruba, Maori, Guarani | |
|
288 | and Twi) (by Ben Laenen) | |
|
289 | - added U+22C8-22CC, U+29CE-29D5, U+2A7D-2AA0, U+2AAE-2ABA, U+2AF9-2AFA to | |
|
290 | Sans (by Remy Oudompheng) | |
|
291 | - adjusted diacritics on Vietnamese, Pinyin and other characters: | |
|
292 | U+01A0-U+01A1, U+01AF-U+01B0, U+01D5-U+01DC, U+01DE-01E1, U+01FA-U+01FB | |
|
293 | U+022A-U+022D, U+0230-U+0231, U+1E14-U+1E17, U+1E4C-U+1E53, U+1E78-U+1E7B, | |
|
294 | U+1EA4-U+1EF1 in Sans (Book, Bold and Oblique) (by Denis Jacquerye) | |
|
295 | - added basic arrows U+2190-U+2193 in Serif, which completes MES-1 compliance | |
|
296 | for Serif (by Ben Laenen) | |
|
297 | - added U+01E4, U+01E5, U+01FA, U+01FB, U+02BD, U+02C9 and U+02EE to Serif | |
|
298 | (by Ben Laenen) | |
|
299 | - fixed U+0209 in Serif Bold Oblique (by Ben Laenen) | |
|
300 | - adjusted Box Drawing block characters U+2500-257F in Mono to fit character | |
|
301 | cell, shifting them up by 416 (Denis Jacquerye) | |
|
302 | - redid U+0194 in Sans (by Ben Laenen) | |
|
303 | - added U+2217-2218, U+2295-22A1 to Mono (by Remy Oudompheng) | |
|
304 | - added U+0462 to Serif (by Andrey V. Panov) | |
|
305 | - added U+226C, U+228C-228E, U+2293-2294, U+22F2-22FF to Sans (by Remy | |
|
306 | Oudompheng) | |
|
307 | - adjusted U+2208-220D in Sans (by Remy Oudompheng) | |
|
308 | - improved some Cyrillic glyphs in Mono (by Andrey V. Panov), rewritten | |
|
309 | instructions for changed glyphs (by Eugeniy Meshcheryakov) | |
|
310 | - added U+1E0E-1E0F, U+1E8E-1E8F to Mono fonts (by Denis Jacquerye). (bug | |
|
311 | #7166) | |
|
312 | - renamed 'Dotabove' to 'Dotaccent' in Mono Sans Oblique to match other fonts | |
|
313 | (by Denis Jacquerye). | |
|
314 | - added U+200B-U+200F in Sans faces and Serif faces, U+200B and U+200C were | |
|
315 | in Sans already (by Lars Naesbye Christensen) | |
|
316 | - added U+2601-U+262F, U+263D, U+263E, U+2648-U+265F, U+2668, U+2670-U+268B, | |
|
317 | U+2690-U+269C, U+26A0, U+26A1, U+2794, U+2798-U+27AF, U+27B1-U+27BE to Mono | |
|
318 | (by Heikki Lindroos) | |
|
319 | - replaced the references with unshifted ones for both κ U+03BA and к U+043A | |
|
320 | in Mono Book (by Denis Jacquerye) | |
|
321 | - fixing glyph for U+04ED in Mono Book, consisted only of dieresis (by Andrey | |
|
322 | V. Panov). | |
|
323 | ||
|
324 | Changes from 2.5 to 2.6: | |
|
325 | ||
|
326 | - redid U+2032 - U+2037, U+2057 based on Arev in Sans (by Gee Fung Sit) | |
|
327 | - added U+0195, corrected U+039E, U+204B in Sans ExtraLight (by Gee Fung Sit) | |
|
328 | - added instructions for some Cyrillic letters in Sans Bold (by Eugeniy | |
|
329 | Meshcheryakov) | |
|
330 | - added vulgar fractions U+2153-U+215F for Serif, made with references (by | |
|
331 | Lars Naesbye Christensen) | |
|
332 | - added U+228F-2292, U+2299-22AF, U+22B2-22B5, U+22CD, U+22D8-22ED to Sans | |
|
333 | (by Remy Oudompheng) | |
|
334 | - added U+2208-220D, U+2238-223D, U+2278-2281, U+228A-228B, U+228F-2292, | |
|
335 | U+22CD, U+22DA-22E9 to Mono (by Remy Oudompheng) | |
|
336 | - fixed misplaced dot in U+2250 in Mono (by Remy Oudompheng) | |
|
337 | - added instructions for some Cyrillic letters in Mono Book and Bold(by | |
|
338 | Eugeniy Meshcheryakov) | |
|
339 | - minor changes to U+2241, U+2261-2263, U+22A4, U+22A5 in Sans (by Remy | |
|
340 | Oudompheng) | |
|
341 | - added hinting instructions to lowercase Armenian glyphs in Sans Book (by | |
|
342 | Ben Laenen) | |
|
343 | - changed U+2208, U+220B to match U+2209 and U+220C in Sans Bold (by Remy | |
|
344 | Oudompheng) | |
|
345 | - added Braille patterns U+2800-U+28FF to Sans (by Mederic Boquien) | |
|
346 | - added instructions for some Cyrillic letters in Serif Book (by Eugeniy | |
|
347 | Meshcheryakov) | |
|
348 | - renamed BoldOblique fonts to Bold Oblique in TTF Name as originally in | |
|
349 | Bitstream Vera fonts (by Denis Jacquerye) | |
|
350 | - added hinting instructions to some Latin-B Extended and IPA characters in | |
|
351 | Sans Book (by Denis Jacquerye and Ben Laenen) | |
|
352 | - adjusted bearings, replaced diacritics, hinted hook and horn for | |
|
353 | Vietnamese in Sans Book (by Denis Jacquerye) | |
|
354 | - made FAX, TM, TEL, etc. discritionary ligatures in Sans and Serif fonts | |
|
355 | (by Denis Jacquerye) | |
|
356 | - removed ligatures of precomposed characters in Sans and Serif fonts (by | |
|
357 | Denis Jacquerye) | |
|
358 | - added U+F208, U+F20A, U+F215-F217, U+F21A-F21B, U+F25F in PUA (from SIL's | |
|
359 | PUA, probably in Unicode 5.0): U+0243, U+0244, U+0245, U+024C, U+024D, | |
|
360 | U+2C64, (U+2C6D), (U+2C71) | |
|
361 | - modified some glyphs in Serif Oblique to make them more italic (by Denis | |
|
362 | Jacquerye) | |
|
363 | ||
|
364 | Changes from 2.4 to 2.5: | |
|
365 | ||
|
366 | - fixed excessive kerning bug that occurs with Pango (by Denis Jacquerye) | |
|
367 | - added U+20AF to Sans and Serif (by Lars Naesbye Christensen) | |
|
368 | - regenerated Condensed faces (by Ben Laenen) | |
|
369 | - added U+035C-U+035D to Sans, fixed U+0361 (by Denis Jacquerye) | |
|
370 | - integrated 255 characters from Arev fonts: Latin Extended-B, Spacing | |
|
371 | Modifiers, Combining Diacritical Marks, Cyrillic, Cyrillic supplement, | |
|
372 | General Punctuation, Letterlike Symbols, Arrows, Mathematical Operators, | |
|
373 | Miscellaneous Technical, Dingbats, Alphabetic Presentation Forms (by Denis | |
|
374 | Jacquerye) | |
|
375 | - added basic Cyrillic and basic Greek to Sans ExtraLight (by Denis Jacquerye) | |
|
376 | - added U+0498, U+049A, U+04AA, U+04AB, U+04AF to Serif (by Eugeniy | |
|
377 | Meshcheryakov) | |
|
378 | - added U+0494, U+0495, U+0498, U+0499, U+04AA, U+04AB, U+04C3, U+04C4, | |
|
379 | U+04C7, U+04C8 to Mono (by Eugeniy Meshcheryakov) | |
|
380 | - adjusted weight of U+0256, U+0257, U+0260, U+0272, U+0273, U+0277, U+029B, | |
|
381 | U+02A0 and modifed U+028B and U+027A in Mono (by Denis Jacquerye) | |
|
382 | - added U+2000-200A to Mono (by Denis Jacquerye) | |
|
383 | - added vulgar fractions U+2153 - U+215F to Mono (by Gee Fung Sit) | |
|
384 | - adapted metrics of Arabic glyphs so they stay above cut-off height in Sans | |
|
385 | (by Ben Laenen) | |
|
386 | - fixed mkmk anchors for Arabic diacritics so they stack properly in Sans (by | |
|
387 | Ben Laenen) | |
|
388 | - fixed weight of lowercase upsilon in Sans Bold, make small adjustment to | |
|
389 | lowercase omega in Sans (by Ben Laenen) | |
|
390 | - added U+210E (by Mederic Boquien) | |
|
391 | - unslanted U+2201, U+221B and U+221C in Sans Oblique (by Mederic Boquien) | |
|
392 | - added several mathematical relation symbols to Sans and Mono (U+2241-224C, | |
|
393 | U+2250-2255, U+2260-2269, U+226E-2277, U+2282-2287) modified U+223C to match | |
|
394 | other tildes, and U+2282-2284 to have the same shape. (by Remy Oudompheng) | |
|
395 | - made U+2234-U+2237 refer to U+2219 instead of U+00B7 in Sans (by Mederic | |
|
396 | Boquien) | |
|
397 | - added U+2238-223B, U+226A-226B, U+2278-2281, U+2288-228B to Sans (by Remy | |
|
398 | Oudompheng) | |
|
399 | - unslanted and changed reference of U+22C5 from U+00B7 to U+2219 in Sans (by | |
|
400 | Mederic Boquien) | |
|
401 | - added U+224D-225F, U+226D, U+22C6 to Sans and unslanted U+2219 in Sans | |
|
402 | Oblique. (by Remy Oudompheng) | |
|
403 | - added U+224D-225F, U+226D to Mono, shifted U+2266-2269 higher upwards and | |
|
404 | unslanted U+2219 in Oblique. (by Remy Oudompheng) | |
|
405 | - merged Coptic glyphs from Arev 0.2 (by Lars Naesbye Christensen) | |
|
406 | - fixed and adjusted various Cyrillic glyphs in Serif (by Andrey V. Panov) | |
|
407 | - made fi, fl... ligatures discretionary ligatures (by Ben Laenen) | |
|
408 | ||
|
409 | Changes from 2.3 to 2.4: | |
|
410 | ||
|
411 | - added U+04A2, U+04A3, U+04AC - U+04AF, U+04BA, U+04BB, U+04C0 - | |
|
412 | U+04C2, U+04CB, U+04CD, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04E8 - U+04F5, | |
|
413 | U+04F6 - U+04F9 to Mono (by Eugeniy Meshcheryakov) | |
|
414 | - added U+048C, U+048D, U+0494, U+0495, U+049E - U+04A7, U+04AC - | |
|
415 | U+04AE, U+04B4- U+04B7, U+04BA, U+04BB, U+04C0 - U+04C4, U+04C7, U+04C8, | |
|
416 | U+04CB, U+04CC, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04EC - U+04F9 to Serif | |
|
417 | (by Eugeniy Meshcheryakov) | |
|
418 | - added U+2134 to Sans (by Gee Fung Sit) | |
|
419 | - added U+2080 - U+2089 to all faces (by Gee Fung Sit) | |
|
420 | - several minor corrections to Sans (by Gee Fung Sit) | |
|
421 | - major corrections to Sans Condensed (by Gee Fung Sit) | |
|
422 | - corrected Superscripts and Subscripts in Sans (by Gee Fung Sit) | |
|
423 | - corrected anchors of U+0316-U+0319 (by Denis Jacquerye) | |
|
424 | - Verajja integrated (by Stepan Roh) | |
|
425 | - copied U+2328, U+2600, U+2639-U+263C, U+263F-U+2647, U+2660-U+2667, | |
|
426 | and U+2669-U+266F from Sans to Serif, and copied scaled-down versions of | |
|
427 | them to Sans Mono (by David Lawrence Ramsey) | |
|
428 | - added U+20B4 to all faces (by Eugeniy Meshcheryakov) | |
|
429 | - added more minor positional adjustments to U+2638 in all faces to | |
|
430 | match the other miscellaneous symbols in Verajja, and rescale it in Sans | |
|
431 | Mono so that it looks better (by David Lawrence Ramsey) | |
|
432 | - added U+2242, U+2243 and U+22A4 (by Mederic Boquien) | |
|
433 | - corrected U+2245 in Sans (by Mederic Boquien) | |
|
434 | - added U+0221, U+0234-0236 (by Denis Jacquerye) | |
|
435 | - added in Arabic block to Sans: U+060C, U+0615, U+061B, U+061F, U+0621 | |
|
436 | - U+063A, U+0640 - U+0655, U+0660 - U+066F, U+0679 - U+0687, U+0698, U+06A1, | |
|
437 | U+06A9, U+06AF, U+06BA, U+06BF, U+06CC, U+06F0 - U+06F9 (by Ben Laenen) | |
|
438 | - added in Arabic Presentation Forms A to Sans: U+FB52 - U+FB81, U+FB8A | |
|
439 | - U+FB95, U+FB9E - U+FB9F, U+FBE8 - U+FBE9, U+FBFC - U+FBFF (by Ben Laenen) | |
|
440 | - added complete Arabic Presentation Forms B to Sans: U+FE70 - U+FE74, | |
|
441 | U+FE76 - U+FEFC, U+FEFF (by Ben Laenen) | |
|
442 | - added complete Greek Extended block to Mono (by Ben Laenen) | |
|
443 | - modified Greek capitals with tonos in Mono (by Ben Laenen) | |
|
444 | - added U+01C4-01CC, U+01D5, U+01DE, U+01E0-U+01E1, U+01E6-U+01E9, | |
|
445 | U+01EE-U+01F5, U+01F8-U+0217, U+021E-U+021F, U+0226-U+022A, U+022C to Serif | |
|
446 | (by Denis Jacquerye) | |
|
447 | - adjusted U+043B and U+044F in Serif (by Denis Jacquerye) | |
|
448 | - added U+2000-U+200A (by Denis Jacquerye) | |
|
449 | - added U+1E00-U+1E0B, U+1E0E-U+1E11, U+1E14-U+1E1C, U+1E1E-U+1E23, | |
|
450 | U+1E26-U+1E2D, U+1E30-U+1E35, U+1E3A-U+1E3B, U+1E3E-U+1E40, U+1E48-U+1E49, | |
|
451 | U+1E50-U+1E56, U+1E58-U+1E59, U+1E5E-U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, | |
|
452 | U+1E72-U+1E7D, U+1E86-U+1E9B, U+1EA0-U+1EA3, U+1EAC-U+1EB7, U+1EBA-U+1EBD, | |
|
453 | U+1EC6-U+1ECF, U+1ED8-U+1ED9, U+1EE6-U+1EE7, U+1EF4-U+1EF9 to Serif (by | |
|
454 | Denis Jacquerye) | |
|
455 | - added U+048E, U+048F, U+049C-U+049F, U+04B8, U+04B9, U+04BC-U+04BF, | |
|
456 | U+04C3, U+04C4 to Sans (by Eugeniy Meshcheryakov) | |
|
457 | - added DejaVu Sans Extra Light (by Denis Jacquerye) | |
|
458 | - Adjusted underline position for (hopefully) improved legibility in | |
|
459 | Sans, Serif, Mono (Tim May) | |
|
460 | - added auto-generated DejaVu LGC (by Stepan Roh) | |
|
461 | ||
|
462 | Changes from 2.2 to 2.3: | |
|
463 | ||
|
464 | - fixed bug U+042B and U+044B behave badly in Sans Bold or Oblique (by | |
|
465 | Keenan Pepper) | |
|
466 | - added and improved TrueType instructions and related settings (by | |
|
467 | Keenan Pepper) | |
|
468 | - added U+04D0-U+04D7, U+04E6, U+04E7 to Mono (by Eugeniy Meshcheryakov) | |
|
469 | - added U+048A - U+048D, U+0498, U+0499, U+04AA, U+04AB, U+04B0, U+04B1, | |
|
470 | U+04C0, U+04C9, U+04CA, U+04CE, U+04CD, U+04DA, U+04DB, U+04DE, U+04DF, | |
|
471 | U+04E2 - U+04E5, U+04EC - U+04F8, U+04F9 to Sans (by Eugeniy Meshcheryakov) | |
|
472 | - added U+04E0, U+04E1 to all faces (by Eugeniy Meshcheryakov) | |
|
473 | - added Greek Extended to Sans and Serif: U+1F00-U+1F15, U+1F18-U+1F1D, | |
|
474 | U+1F20-U+1F45, U+1F48-U+1F4D, U+1F50-U+1F57, U+1F59, U+1F5B, U+1F5D, | |
|
475 | U+1F5F-U+1F7D, U+1F80-U+1FB4, U+1FB6-U+1FC4, U+1FC6-U+1FD3, U+1FD6-U+1FDB, | |
|
476 | U+1FDD-U+1FEF, U+1FF2-U+1FF4, U+1FF6-U+1FFE (by Ben Laenen) | |
|
477 | - added Greek variant letterforms, archaic letters and symbols to Mono: | |
|
478 | U+03D0-U+03E1, U+03F0-U+03FF (by Ben Laenen) | |
|
479 | - added Armenian block and Armenian ligatures to Sans (U+0531 - U+0556, | |
|
480 | U+0559 - U+055F, U+0561 - U+0587, U+0589 - U+058A, U+FB13 - U+FB17) (by Ben | |
|
481 | Laenen) | |
|
482 | - redid some Greek characters in Sans and Mono to make them look better | |
|
483 | and to correct some errors (by Ben Laenen) | |
|
484 | - added U+27E0 to all faces (by David Lawrence Ramsey) | |
|
485 | - added underscore (U+005F) consistency fixes: extended the Sans Mono | |
|
486 | and Sans Mono Oblique underscores to touch both horizontal edges, and | |
|
487 | reduced the height of the Sans Bold Oblique underscore to match the Sans | |
|
488 | Bold underscore (by David Lawrence Ramsey) | |
|
489 | - added underscore (U+005F) derivatives and consistency fixes for them: | |
|
490 | made U+0332 a reference to underscore at Denis Jacquerye's suggestion; made | |
|
491 | U+0333 two references to underscore; made U+033F two references to U+203E; | |
|
492 | added U+2017 as two references to underscore, and made U+0333 a reference to | |
|
493 | it; and added U+203E as a reference to underscore, and made U+0305 a | |
|
494 | reference to it (by David Lawrence Ramsey) | |
|
495 | - added U+201B, U+2220, U+2320-U+2321, U+23AE, U+23CF, all remaining | |
|
496 | Geometric Shapes glyphs (U+25A0-U+25C9, U+25CB-U+25D7, U+25D9-U+25E5, | |
|
497 | U+25E7-U+25FF), and U+2B12-U+2B13 to all faces (by David Lawrence Ramsey) | |
|
498 | - added minor positional adjustments to U+2638 in all faces (by David | |
|
499 | Lawrence Ramsey) | |
|
500 | - added U+201F to Sans Mono and Serif faces (by David Lawrence Ramsey) | |
|
501 | - added U+01B7, U+01F6, U+0464 - U+0465, U+2160 - U+2180, U+2183, | |
|
502 | U+220A, U+220D, U+2329, U+232A, U+2422, U+27E8 - U+27EB, U+2680 - U+2685 to | |
|
503 | Sans (by Gee Fung Sit ???) | |
|
504 | - added U+2116 to Sans and Serif (by Gee Fung Sit) | |
|
505 | - changed florin sign U+0192 in Sans (by Gee Fung Sit) | |
|
506 | - added anchor points to some glyphs (by Denis Jacquerye) | |
|
507 | - adjusted height of IPA superscripts U+02B0-02B8, U+02C0-02C1, | |
|
508 | U+02E0-02E4, U+207F to match with height of U+00B2 (by Denis Jacquerye) | |
|
509 | - added U+0184-U+0185, U+019C, U+019F, U+01A0-U+01A3, U+01A6, U+01AA, | |
|
510 | U+01AF-U+01B0, U+01B2-U+01B4, U+01B7-U+01B8, U+01BC-U+01BC, U+0224-U+0225, | |
|
511 | U+023A-U+0240, U+1D16-U+1D17, U+1D1D-U+1D1E, U+1D43-U+1D5B, U+1D7B, | |
|
512 | U+1D85,U+1D9B-1DB7, U+1DB9-U+1DBF, U+20A6 to all fonts (by Denis Jacquerye) | |
|
513 | - added added U+0182, U+018B, U+018E, U+01A0-U+01A1, U+01B1, U+01B9, | |
|
514 | U+01C0-U+01C3, U+0238-U+0239, U+1D02, U+1D08-U+1D09, U+1D14, U+1D1F, U+1D77 | |
|
515 | to Serif and Mono (by Denis Jacquerye) | |
|
516 | - added U+0181, U+0183, U+0187-U+0188, U+018A-U+018F, U+0191, U+0193, | |
|
517 | U+0195-U+019B, U+019D-U+019E, U+01A4-U+01A5, U+01AC-U+01AE, U+01B5-U+01B6, | |
|
518 | U+01B9, U+01BB, U+01F6 to Serif (by Denis Jacquerye) | |
|
519 | - added U+0181, U+0187-U+0188, U+018A, U+018D, U+018F, U+0191, U+0193, | |
|
520 | U+0195-U+019F, U+01A4-01A5, U+01AC-01AD, U+01B5-U+01B6, U+1BB, U+01F6, | |
|
521 | U+01D7-U+01DC, U+0238-U+0239, U+0241 to Mono (by Denis Jacquerye) | |
|
522 | - added to Mono and Serif (by Denis Jacquerye) | |
|
523 | ||
|
524 | Changes from 2.1 to 2.2: | |
|
525 | ||
|
526 | - reworked the vertical orientation of the Blocks Elements characters | |
|
527 | in all faces to remove their overly large descenders, in order to fix | |
|
528 | problems with e.g. terminal emulators (by David Lawrence Ramsey) | |
|
529 | - copied bullet in Sans faces to Serif faces for consistency (by David | |
|
530 | Lawrence Ramsey) | |
|
531 | - added U+2023, U+25D8, U+25E6, and U+29EB to all faces (by David | |
|
532 | Lawrence Ramsey) | |
|
533 | - added U+1EB8, U+1EB9, U+1ECA - U+1ECD, U+1EE4, U+1EE5 (by Tim May) | |
|
534 | - added U+01DD, U+02BE, U+02BF, U+02D3 to all, changed U+02D2 in | |
|
535 | non-Condensed and U+1EE5 in Serif (by Tim May) | |
|
536 | - fixed U+01CE, replacing wrong circumflex by caron (by Denis Jacquerye) | |
|
537 | - added anchor points to some glyphs (by Denis Jacquerye) | |
|
538 | - added U+20B5 (by Denis Jacquerye) | |
|
539 | - added U+0181 - U+0183, U+0187, U+0188, U+018A - U+018D, U+0191, | |
|
540 | U+0193, U+0195 - U+019B, U+019D, U+019E, U+01A4, U+01A7 - U+01A9, U+01AB - | |
|
541 | U+01AE, U+01B1, U+01B5, U+01B6, U+01BB, U+01C0 - U+01C3, U+01F1 - U+01F3, | |
|
542 | U+0238, U+0239, U+1D02, U+1D08, U+1D09, U+1D14, U+1D1F, U+1D77, U+2103, | |
|
543 | U+2126, U+2127, U+212A, U+212B, U+2132, U+214B, U+2210, U+2217, U+2218, | |
|
544 | U+2A0C - U+2A0E, U+FB00, U+FB03 and U+FB04 to Sans (by Gee Fung Sit) | |
|
545 | - added U+01A9, U+01C3 and U+2126 to Mono and Serif (by Gee Fung Sit) | |
|
546 | - adjusted bearings of U+028B in Sans (by Gee Fung Sit) | |
|
547 | - added U+018F, U+0494-U+0497, U+04A0-U+04A7, U+04AC-U+04AF, | |
|
548 | U+04B4-U+04B7, U+04BA-U+04BB, U+04C1-U+04C2, U+04C5-U+04C8, U+04CB-U+04CC, | |
|
549 | U+04D0-U+04D9, U+04DC-U+04DD, U+04E6-U+04EB to Sans (by Eugeniy | |
|
550 | Meshcheryakov) | |
|
551 | - replaced with references U+0391-U+0393, U+0395-U+0397, U+0399, U+039A, | |
|
552 | U+039C, U+039D, U+039F-U+03A1, U+03A4, U+03A5, U+03A7, U+03BF, U+03DC, | |
|
553 | U+0405, U+0406, U+0408, U+0410, U+0412, U+0415, U+0417, U+041A, | |
|
554 | U+041C-U+041E, U+0420-U+0422, U+0425, U+0430, U+0435, U+043E, U+0440, | |
|
555 | U+0441, U+0443, U+0445, U+0455-U+0458 in Serif and Mono (by Eugeniy | |
|
556 | Meshcheryakov) | |
|
557 | - added U+04D0-U+04D7, U+04E6-U+04EB to Serif (by Eugeniy Meshcheryakov) | |
|
558 | - added U+212A and U+212B to the rest of the faces (by Lars Naesbye | |
|
559 | Christensen) | |
|
560 | - added U+2318 and U+2325 to Sans and Serif (by Lars Naesbye Christensen) | |
|
561 | - added and improved TrueType instructions and related settings (by | |
|
562 | Keenan Pepper) | |
|
563 | - completed basic Greek alphabet: added U+0374-U+0375, U+037A, U+037E, | |
|
564 | U+0384-U+038A, U+038C, U+038E-U+0390, U+03AC-U+03BF, U+03C1-U+03CE (by Ben | |
|
565 | Laenen) | |
|
566 | - added U+2070 and U+2074-U+2079 (by Mederic Boquien) | |
|
567 | ||
|
568 | Changes from 2.0 to 2.1: | |
|
569 | ||
|
570 | **# Be aware that names of some TTF files changed since version 2.0.#** | |
|
571 | ||
|
572 | - added U+0323, U+1E0C, U+1E0D, U+1E24, U+1E25, U+1E36 - U+1E39, U+1E42, | |
|
573 | U+1E43, U+1E46, U+1E47, U+1E5A - U+1E5D, U+1E62, U+1E63, U+1E6C, U+1E6D, | |
|
574 | U+1E7E, U+1E7F (by Tim May) | |
|
575 | - fixed bug where GNOME applications used Mono Bold Oblique instead of | |
|
576 | Mono Oblique (by Keenan Pepper) | |
|
577 | - added and improved TrueType instructions and related settings (by | |
|
578 | Keenan Pepper) | |
|
579 | - added U+1E41, U+1E57, U+1E61 (by Sander Vesik) | |
|
580 | - added U+0189, U+0309, U+0313, U+0314, U+031A, U+031B, U+0327, U+0328, | |
|
581 | U+032B, U+0333, U+033C (by Denis Jacquerye) | |
|
582 | - adjusted and fixed U+0186, U+0254, U+0291, U+0316 - U+0319, U+031C - | |
|
583 | U+0320, U+0323 - U+0326, U+0329 - U+032A, U+032C - U+0332, U+0339 - U+033B, | |
|
584 | U+033E, U+033F (by Denis Jacquerye) | |
|
585 | - fixed U+1E12, U+1E3C, U+1E4A, U+1E70 to have normal below diacritics | |
|
586 | (by Denis Jacquerye) | |
|
587 | - fixed U+1E82, U+1E84 and U+1EF2 to have uppercase above diacritics (by | |
|
588 | Denis Jacquerye) | |
|
589 | - added anchor points to some glyphs (by Denis Jacquerye) | |
|
590 | - dropped "-Roman" from font names - affects both internal TTF names and | |
|
591 | names of generated files (by Stepan Roh) | |
|
592 | - attempt to fix bug Vertical spacing too big for Mono by exchanging | |
|
593 | LineGap and OS2TypoLinegap values (proofed by Stefan Rank) | |
|
594 | - added Greek capitals U+0391 - U+03A1, U+03A3 - U+03A9, U+03AA, U+03AB | |
|
595 | in Mono (by Ben Laenen) | |
|
596 | - added the per ten thousand sign U+2031 (by Mederic Boquien) | |
|
597 | - added U+2207, U+221D, U+221F, U+2227 - U+222A, and U+2261 (by David | |
|
598 | Lawrence Ramsey) | |
|
599 | - new logo (by Gee Fung Sit) | |
|
600 | - added U+0180, U+018E, U+201F, U+2024, U+2025, U+203D, U+2200, U+2203, | |
|
601 | U+2213, U+222C, U+222D, U+2263 to Sans (by Gee Fung Sit) | |
|
602 | ||
|
603 | Changes from 1.15 to 2.0: | |
|
604 | ||
|
605 | - "Italized" basic glyphs in all Serif Oblique and their Condensed faces | |
|
606 | (by David Jez) | |
|
607 | - added and improved TrueType instructions and related settings (by Keenan | |
|
608 | Pepper) | |
|
609 | - added anchor points to some glyphs (by Denis Jacquerye) | |
|
610 | - many new spacing and combining accents (by Denis Jacquerye) | |
|
611 | - smart substitutions for transforming i and j to dottless form and for | |
|
612 | using uppercase diacritics (by Denis Jacquerye) | |
|
613 | - fixed remaining erroneously slanted characters in Serif Oblique faces (by | |
|
614 | David Lawrence Ramsey) | |
|
615 | - copied bullet in Sans faces to Sans Oblique faces for consistency (by | |
|
616 | David Lawrence Ramsey) | |
|
617 | - added U+203C and U+2047-U+2049 (by David Lawrence Ramsey) | |
|
618 | - added Greek glyphs to Serif (by Ben Laenen, Condensed merge by David Jez) | |
|
619 | - fixed bug LTR glyphs behaving like RTL (by Ben Laenen) | |
|
620 | - fixed wrong glyph directions (by David Jez) | |
|
621 | - fixed repositioned accents in Condensed faces (by David Jez) | |
|
622 | ||
|
623 | Changes from 1.14 to 1.15: | |
|
624 | ||
|
625 | - added and improved TrueType instructions and related settings (by Keenan | |
|
626 | Pepper) | |
|
627 | - fixed U+2302, U+2319 (by David Lawrence Ramsey) | |
|
628 | - fixed yet another monospace bug (by Stepan Roh) | |
|
629 | - fixed potential "too big ascender/descender" bug (by Stepan Roh) | |
|
630 | - fixed U+026E and U+028E (by Denis Jacquerye) | |
|
631 | - added U+0186, U+0190, U+0300 - U+0304, U+0306 - U+0308, U+030A - U+030C, | |
|
632 | U+0321, U+0322 (by Denis Jacquerye) | |
|
633 | - added rest of Block Elements: U+2591 - U+2593 (by David Lawrence Ramsey) | |
|
634 | - added U+2311, U+237D and U+2638 (by David Lawrence Ramsey) | |
|
635 | - added U+01CD - U+01D4 (by Denis Jacquerye) | |
|
636 | - fixed accents of U+00F2 - U+00F6 by replacing them with references in Mono | |
|
637 | Bold (by David Jez) | |
|
638 | - added U+0490, U+0491 (by Eugeniy Meshcheryakov) | |
|
639 | - added hints to U+0404 and U+0454 in Sans (by Eugeniy Meshcheryakov) | |
|
640 | - completed Greek glyphs from U+0370 to U+03CF in Serif (by Ben Laenen) | |
|
641 | - fixed shape of U+0255 in Sans Bold and Sans Bold Oblique (by Denis | |
|
642 | Jacquerye) | |
|
643 | ||
|
644 | Changes from 1.13 to 1.14: | |
|
645 | ||
|
646 | - fixed bug where Mono faces were not recognized as fixed pitch in Windows | |
|
647 | by correcting Venda glyphs (by David Jez) | |
|
648 | - added and improved TrueType instructions (by Keenan Pepper) | |
|
649 | - added 6 Uzbekian glyphs (by Mashrab Kuvatov) | |
|
650 | - added Greek glyphs to Sans and Serif, changed pi and omega to fit in (by | |
|
651 | Ben Laenen) | |
|
652 | - added IPA and related superscript glyphs (by Denis Jacquerye) | |
|
653 | - fixed buggy Venda glyphs (by David Lawrence Ramsey and Stepan Roh) | |
|
654 | - added U+2302, U+2310, U+2319 (by David Lawrence Ramsey) | |
|
655 | - fixed slanted U+00AC in Serif Oblique faces (by David Lawrence Ramsey) | |
|
656 | - added 29 glyphs from Block Elements (by David Lawrence Ramsey) | |
|
657 | ||
|
658 | Changes from 1.12 to 1.13: | |
|
659 | ||
|
660 | - removed all stems (PS hints) (requested by David Jez) | |
|
661 | - added U+01D6, U+01DF, U+022B, U+022D and U+0231 (by Sander Vesik) | |
|
662 | - added 10 Venda glyphs (by Dwayne Bailey) | |
|
663 | - fixed bug when fonts had no name on Microsoft Windows (by Stepan Roh) | |
|
664 | - updated 'missing' glyph U+FFFD (by David Jez) | |
|
665 | - set TTF flag fsType to 'Installable Embedding' (= unrestricted usage) | |
|
666 | (idea by C. Tiffany) | |
|
667 | ||
|
668 | Changes from 1.11 to 1.12: | |
|
669 | ||
|
670 | - added long s (by James Cloos) | |
|
671 | - prettier comma accent in gcommaaccent (by David Jez) | |
|
672 | - added Hbar, hbar, kgreenlandic, napostrophe, Eng, eng, Tbar, tbar, | |
|
673 | afii57929 (by David Jez) | |
|
674 | - changed Iogonek, iogonek, IJ, ij to look better (by David Jez) | |
|
675 | - glyph uni0237 renamed to dotlessj (requested by David Jez) | |
|
676 | - fixed accents for dcaron, lcaron, tcaron, Uogonek, uogonek in Serif (by | |
|
677 | David Jez) | |
|
678 | - added U+2500 - U+257F box drawing glyphs to Sans Mono (by David Jez) | |
|
679 | - fixed accents in Wcircumflex, Ycircumflex and Zdotaccent (by David Jez) | |
|
680 | - extra kerning for F (by Sander Vesik) | |
|
681 | - added 'missing' glyph U+FFFD (by David Jez) | |
|
682 | ||
|
683 | Changes from 1.10 to 1.11: | |
|
684 | ||
|
685 | - kerning updates (by Sander Vesik) | |
|
686 | - added Iogonek, iogonek, IJ, ij, Uogonek, uogonek (from SuSE standard fonts | |
|
687 | by Adrian Schroeter, SuSE AG) | |
|
688 | - added Gcommaaccent, gcommaaccent, Kcommaaccent, kcommaaccent, | |
|
689 | Lcommaaccent, lcommaaccent, Ncommaaccent, ncommaaccent, Rcommaaccent, | |
|
690 | rcommaaccent (by Stepan Roh) | |
|
691 | ||
|
692 | Changes from 1.9 to 1.10: | |
|
693 | ||
|
694 | - added U+022E, U+022F (by Sander Vesik) | |
|
695 | - kerning updates for DejaVu Sans (by Sander Vesik) | |
|
696 | - fixed too wide cyrillic glyphs in DejaVu Sans Mono (by Valentin Stoykov) | |
|
697 | - fixed ligatures bug in Mono (by Stepan Roh) | |
|
698 | ||
|
699 | Changes from 1.8 to 1.9: | |
|
700 | ||
|
701 | - integrated Arev Cyrillics (by Danilo Segan) | |
|
702 | - added U+01EA, U+01EB, U+01EC, U+01ED (by Sander Vesik) | |
|
703 | ||
|
704 | Changes from 1.7 to 1.8: | |
|
705 | ||
|
706 | - fixed accents in Serif Oblique and Serif Bold Oblique (by Stepan Roh) | |
|
707 | ||
|
708 | Changes from 1.6 to 1.7: | |
|
709 | ||
|
710 | - added automatically generated Condensed typefaces (by Stepan Roh) | |
|
711 | ||
|
712 | Changes from 1.5 to 1.6: | |
|
713 | ||
|
714 | - monospace bug fixed (by Stepan Roh) | |
|
715 | - incorrect Bitstream foundry assigned by fontconfig and KDE Font Installer | |
|
716 | fixed (by Stepan Roh) | |
|
717 | - added automatically generated Oblique version of Serif typefaces (by | |
|
718 | Stepan Roh) | |
|
719 | - corrected cyrillic D and d (by Danilo Segan and David Jez) | |
|
720 | - fixed accents position in Oblique version of Serif typefaces (by Danilo | |
|
721 | Segan and Sander Vesik) | |
|
722 | - fixed incorrect computation of OS2Win# fields (by Stepan Roh) | |
|
723 | - added visiblespace U+2423 (by David Jez) | |
|
724 | - fixed 'line height' bug by fixing ascender and descender values (by David | |
|
725 | Jez and Stepan Roh) | |
|
726 | - fixed part of 'worse than Vera' bug (by Peter Cernak) | |
|
727 | - smaller comma accent U+0326 (by David Jez) | |
|
728 | ||
|
729 | Changes from 1.4 to 1.5: | |
|
730 | ||
|
731 | - added Cyrillics (96 characters) and Dcroat to the rest of typefaces (by | |
|
732 | Danilo Segan) | |
|
733 | - fixed bugs in some Cyrillic characters, some of them reported by Sander | |
|
734 | Vesik (by Danilo Segan) | |
|
735 | - added U+0100, U+0101, U+0112, U+0113, U+012A, U+012B, U+014C, U+014D, | |
|
736 | U+016A, U+016B, U+01E2, U+01E3, U+0232 and U+0233 (by Sander Vesik) | |
|
737 | - added Romanian characters (by Misu Moldovan) | |
|
738 | - added U+0108, U+0109, U+010A, U+010B, U+0114, U+0115, U+0116, U+0117, | |
|
739 | U+011C, U+011D, U+0120, U+0121, U+0124, U+0125, U+0128, U+0129, U+012C, | |
|
740 | U+012D, U+0134, U+0135, U+014E, U+014F, U+0150, U+0151, U+015C, U+015D, | |
|
741 | U+0168, U+0169, U+016C, U+016D, U+0170, U+0171 and U+0237 (by James | |
|
742 | Crippen) | |
|
743 | - added U+02BB, U+2010, U+2011, U+2012 and U+2015 (by Stepan Roh) | |
|
744 | ||
|
745 | Changes from 1.3 to 1.4: | |
|
746 | ||
|
747 | - added Polish characters (Aogonek, aogonek, Eogonek, eogonek, Nacute, | |
|
748 | nacute, Sacute, sacute, Zacute, zacute, Zdotaccent, zdotaccent) (by Stepan | |
|
749 | Roh) | |
|
750 | ||
|
751 | Changes from 1.2 to 1.3: | |
|
752 | ||
|
753 | - added Cyrillics (96 characters) and Dcroat to Sans typefaces (by Danilo | |
|
754 | Segan from his BePa fonts) | |
|
755 | ||
|
756 | Changes from 1.1 to 1.2: | |
|
757 | ||
|
758 | - added Ldot, ldot, Wcircumflex, wcircumflex, Ycircumflex, ycircumflex, | |
|
759 | Wgrave, wgrave, Wacute, wacute, Wdieresis, wdieresis, Ygrave and ygrave | |
|
760 | (from The Olwen Font Family 0.2 by Dafydd Harries) | |
|
761 | ||
|
762 | Changes from 1.0 to 1.1: | |
|
763 | ||
|
764 | - added Lacute, lacute, Lcaron, lcaron, Racute and racute (by Peter Cernak) | |
|
765 | ||
|
766 | Changes from 0.9.4 to 1.0: | |
|
767 | ||
|
768 | - none, just changed version and updated README | |
|
769 | ||
|
770 | Changes from 0.9.3 to 0.9.4: | |
|
771 | ||
|
772 | - fixed TTF generation (kerning tables were missing) | |
|
773 | ||
|
774 | Changes from 0.9.2 to 0.9.3: | |
|
775 | ||
|
776 | - kerning of added characters | |
|
777 | - proper caron shape for dcaron in Mono (by Ondrej Koala Vacha) | |
|
778 | - minor visual changes | |
|
779 | ||
|
780 | Changes from 0.9.1 to 0.9.2: | |
|
781 | ||
|
782 | - internal bugged version | |
|
783 | ||
|
784 | Changes from 0.9 to 0.9.1: | |
|
785 | ||
|
786 | - proper caron shape for dcaron and tcaron | |
|
787 | - minor visual changes | |
|
788 | ||
|
789 | $Id: NEWS 1587 2007-02-18 16:20:38Z ben_laenen $ |
@@ -0,0 +1,59 | |||
|
1 | DejaVu fonts 2.15 (c)2004-2007 DejaVu fonts team | |
|
2 | ----------------------------------------------- | |
|
3 | ||
|
4 | The DejaVu fonts are a font family based on the Bitstream Vera Fonts | |
|
5 | (http://gnome.org/fonts/). Its purpose is to provide a wider range of | |
|
6 | characters (see status.txt for more information) while maintaining the | |
|
7 | original look and feel. | |
|
8 | ||
|
9 | DejaVu fonts are based on Bitstream Vera fonts version 1.10. | |
|
10 | ||
|
11 | Available fonts (Sans = sans serif, Mono = monospaced): | |
|
12 | ||
|
13 | DejaVu Sans Mono | |
|
14 | DejaVu Sans Mono Bold | |
|
15 | DejaVu Sans Mono Bold Oblique | |
|
16 | DejaVu Sans Mono Oblique | |
|
17 | DejaVu Sans | |
|
18 | DejaVu Sans Bold | |
|
19 | DejaVu Sans Bold Oblique | |
|
20 | DejaVu Sans Oblique | |
|
21 | DejaVu Sans ExtraLight (experimental) | |
|
22 | DejaVu Serif | |
|
23 | DejaVu Serif Bold | |
|
24 | DejaVu Serif Bold Oblique (experimental) | |
|
25 | DejaVu Serif Oblique (experimental) | |
|
26 | DejaVu Sans Condensed (experimental) | |
|
27 | DejaVu Sans Condensed Bold (experimental) | |
|
28 | DejaVu Sans Condensed Bold Oblique (experimental) | |
|
29 | DejaVu Sans Condensed Oblique (experimental) | |
|
30 | DejaVu Serif Condensed (experimental) | |
|
31 | DejaVu Serif Condensed Bold (experimental) | |
|
32 | DejaVu Serif Condensed Bold Oblique (experimental) | |
|
33 | DejaVu Serif Condensed Oblique (experimental) | |
|
34 | ||
|
35 | All fonts are also available as derivative called DejaVu LGC with support | |
|
36 | only for Latin, Greek and Cyrillic scripts. | |
|
37 | ||
|
38 | For license information see LICENSE. What's new is described in NEWS. Known | |
|
39 | bugs are in BUGS. All authors are mentioned in AUTHORS. | |
|
40 | ||
|
41 | Fonts are published in source form as SFD files (Spline Font Database from | |
|
42 | FontForge - http://fontforge.sf.net/) and in compiled form as TTF files | |
|
43 | (TrueType fonts). | |
|
44 | ||
|
45 | For more information go to http://dejavu.sourceforge.net/. | |
|
46 | ||
|
47 | Characters from Arev fonts, Copyright (c) 2006 by Tavmjong Bah: | |
|
48 | --------------------------- | |
|
49 | U+01ba, U+01bf, U+01f7, U+021c, U+021d, U+0220, U+0222, U+0223, | |
|
50 | U+02b9, U+02ba, U+02bd, U+02c2, U+02c3, U+02c4, U+02c5, U+02d4, | |
|
51 | U+02d5, U+02d7, U+02ec, U+02ed, U+02ee, U+0346-034e, U+0360, U+0362, | |
|
52 | U+03e2-03ef, U+0460-0463, U+0466-0486, U+0488-0489, U+04a8-04a9, | |
|
53 | U+0500-050f, U+2055-205e, U+20B0, U+20B2-20B3, U+2102, U+210D, U+210f, | |
|
54 | U+2111, U+2113, U+2115, U+2118-U+211A, U+211c-211d, U+2124,U+2135, | |
|
55 | U+213C-U+2140, U+2295-2298, U+2308-230b, U+26A2-U+26B1, U+2701-2704, | |
|
56 | U+2706-2709, U+270c-274b, U+2758-275a, U+2761-2775, U+2780-2794, | |
|
57 | U+2798-27af, U+27b1-27be, U+fb05-fb06 | |
|
58 | ||
|
59 | $Id: README 1587 2007-02-18 16:20:38Z ben_laenen $ |
@@ -0,0 +1,187 | |||
|
1 | This is the language coverage file for DejaVu fonts | |
|
2 | ($Id: langcover.txt 1586 2007-02-18 16:07:32Z ben_laenen $) | |
|
3 | ||
|
4 | Sans Serif Sans Mono | |
|
5 | aa Afar 100% (62/62) 100% (62/62) 100% (62/62) | |
|
6 | ab Abkhazia 100% (90/90) 93% (84/90) 84% (76/90) | |
|
7 | af Afrikaans 100% (69/69) 100% (69/69) 100% (69/69) | |
|
8 | am Amharic (0/264) (0/264) (0/264) | |
|
9 | ar Arabic 100% (125/125) (0/125) (0/125) | |
|
10 | ast Asturian 100% (72/72) 100% (72/72) 100% (72/72) | |
|
11 | ava Avaric 100% (67/67) 100% (67/67) 100% (67/67) | |
|
12 | ay Aymara 100% (60/60) 100% (60/60) 100% (60/60) | |
|
13 | az Azerbaijani 100% (148/148) 97% (144/148) 97% (144/148) | |
|
14 | az-ir Azerbaijani in Iran 100% (130/130) (0/130) (0/130) | |
|
15 | ba Bashkir 100% (82/82) 100% (82/82) 97% (80/82) | |
|
16 | bam Bambara 100% (60/60) 100% (60/60) 100% (60/60) | |
|
17 | be Byelorussian 100% (68/68) 100% (68/68) 100% (68/68) | |
|
18 | bg Bulgarian 100% (60/60) 100% (60/60) 100% (60/60) | |
|
19 | bh Bihari (Devanagari script) (0/68) (0/68) (0/68) | |
|
20 | bho Bhojpuri (Devanagari script) (0/68) (0/68) (0/68) | |
|
21 | bi Bislama 100% (58/58) 100% (58/58) 100% (58/58) | |
|
22 | bin Edo or Bini 100% (78/78) 100% (78/78) 100% (78/78) | |
|
23 | bn Bengali (0/89) (0/89) (0/89) | |
|
24 | bo Tibetan (0/95) (0/95) (0/95) | |
|
25 | br Breton 100% (64/64) 100% (64/64) 100% (64/64) | |
|
26 | bs Bosnian 100% (62/62) 100% (62/62) 100% (62/62) | |
|
27 | bua Buriat (Buryat) 100% (70/70) 100% (70/70) 100% (70/70) | |
|
28 | ca Catalan 100% (74/74) 100% (74/74) 100% (74/74) | |
|
29 | ce Chechen 100% (67/67) 100% (67/67) 100% (67/67) | |
|
30 | ch Chamorro 100% (58/58) 100% (58/58) 100% (58/58) | |
|
31 | chm Mari (Lower Cheremis / Upper Cheremis) 100% (76/76) 100% (76/76) 97% (74/76) | |
|
32 | chr Cherokee (0/85) (0/85) (0/85) | |
|
33 | co Corsican 100% (84/84) 100% (84/84) 100% (84/84) | |
|
34 | cs Czech 100% (82/82) 100% (82/82) 100% (82/82) | |
|
35 | cu Old Church Slavonic 100% (103/103) 80% (83/103) 74% (77/103) | |
|
36 | cv Chuvash 100% (74/74) 100% (74/74) 100% (74/74) | |
|
37 | cy Welsh 100% (78/78) 100% (78/78) 100% (78/78) | |
|
38 | da Danish 100% (70/70) 100% (70/70) 100% (70/70) | |
|
39 | de German 100% (59/59) 100% (59/59) 100% (59/59) | |
|
40 | dz Dzongkha (0/95) (0/95) (0/95) | |
|
41 | el Greek 100% (69/69) 100% (69/69) 100% (69/69) | |
|
42 | en English 100% (72/72) 100% (72/72) 100% (72/72) | |
|
43 | eo Esperanto 100% (64/64) 100% (64/64) 100% (64/64) | |
|
44 | es Spanish 100% (66/66) 100% (66/66) 100% (66/66) | |
|
45 | et Estonian 100% (64/64) 100% (64/64) 100% (64/64) | |
|
46 | eu Basque 100% (56/56) 100% (56/56) 100% (56/56) | |
|
47 | fa Persian 100% (129/129) (0/129) (0/129) | |
|
48 | fi Finnish 100% (62/62) 100% (62/62) 100% (62/62) | |
|
49 | fj Fijian 100% (52/52) 100% (52/52) 100% (52/52) | |
|
50 | fo Faroese 100% (68/68) 100% (68/68) 100% (68/68) | |
|
51 | fr French 100% (84/84) 100% (84/84) 100% (84/84) | |
|
52 | ful Fulah (Fula) 100% (62/62) 100% (62/62) 100% (62/62) | |
|
53 | fur Friulian 100% (66/66) 100% (66/66) 100% (66/66) | |
|
54 | fy Frisian 100% (75/75) 100% (75/75) 100% (75/75) | |
|
55 | ga Irish 100% (80/80) 100% (80/80) 100% (80/80) | |
|
56 | gd Scots Gaelic 100% (70/70) 100% (70/70) 100% (70/70) | |
|
57 | gez Ethiopic (Geez) (0/218) (0/218) (0/218) | |
|
58 | gl Galician 100% (66/66) 100% (66/66) 100% (66/66) | |
|
59 | gn Guarani 100% (70/70) 100% (70/70) 100% (70/70) | |
|
60 | gu Gujarati (0/78) (0/78) (0/78) | |
|
61 | gv Manx Gaelic 100% (54/54) 100% (54/54) 100% (54/54) | |
|
62 | ha Hausa 100% (60/60) 100% (60/60) 100% (60/60) | |
|
63 | haw Hawaiian 100% (63/63) 100% (63/63) 100% (63/63) | |
|
64 | he Hebrew 100% (27/27) (0/27) (0/27) | |
|
65 | hi Hindi (Devanagari script) (0/68) (0/68) (0/68) | |
|
66 | ho Hiri Motu 100% (52/52) 100% (52/52) 100% (52/52) | |
|
67 | hr Croatian 100% (62/62) 100% (62/62) 100% (62/62) | |
|
68 | hu Hungarian 100% (70/70) 100% (70/70) 100% (70/70) | |
|
69 | hy Armenian 100% (77/77) (0/77) (0/77) | |
|
70 | ia Interlingua 100% (52/52) 100% (52/52) 100% (52/52) | |
|
71 | ibo Igbo 100% (58/58) 100% (58/58) 100% (58/58) | |
|
72 | id Indonesian 100% (54/54) 100% (54/54) 100% (54/54) | |
|
73 | ie Interlingue 100% (52/52) 100% (52/52) 100% (52/52) | |
|
74 | ik Inupiaq (Inupiak, Eskimo) 100% (68/68) 100% (68/68) 100% (68/68) | |
|
75 | io Ido 100% (52/52) 100% (52/52) 100% (52/52) | |
|
76 | is Icelandic 100% (70/70) 100% (70/70) 100% (70/70) | |
|
77 | it Italian 100% (72/72) 100% (72/72) 100% (72/72) | |
|
78 | iu Inuktitut 100% (161/161) (0/161) (0/161) | |
|
79 | ja Japanese (0/6538) (0/6538) (0/6538) | |
|
80 | ka Georgian (0/34) (0/34) (0/34) | |
|
81 | kaa Kara-Kalpak (Karakalpak) 100% (78/78) 100% (78/78) 100% (78/78) | |
|
82 | ki Kikuyu 100% (56/56) 100% (56/56) 100% (56/56) | |
|
83 | kk Kazakh 100% (77/77) 100% (77/77) 100% (77/77) | |
|
84 | kl Greenlandic 100% (81/81) 100% (81/81) 100% (81/81) | |
|
85 | km Khmer (0/70) (0/70) (0/70) | |
|
86 | kn Kannada (0/80) (0/80) (0/80) | |
|
87 | ko Korean (0/2443) (0/2443) (0/2443) | |
|
88 | kok Kokani (Devanagari script) (0/68) (0/68) (0/68) | |
|
89 | ks Kashmiri (Devanagari script) (0/68) (0/68) (0/68) | |
|
90 | ku Kurdish 100% (64/64) 100% (64/64) 100% (64/64) | |
|
91 | ku-ir Kurdish in Iran 100% (32/32) (0/32) (0/32) | |
|
92 | kum Kumyk 100% (66/66) 100% (66/66) 100% (66/66) | |
|
93 | kv Komi (Komi-Permyak/Komi-Siryan) 100% (70/70) 100% (70/70) 100% (70/70) | |
|
94 | kw Cornish 100% (64/64) 100% (64/64) 100% (64/64) | |
|
95 | ky Kirgiz 100% (70/70) 100% (70/70) 100% (70/70) | |
|
96 | la Latin 100% (68/68) 100% (68/68) 100% (68/68) | |
|
97 | lb Luxembourgish (Letzeburgesch) 100% (75/75) 100% (75/75) 100% (75/75) | |
|
98 | lez Lezghian (Lezgian) 100% (67/67) 100% (67/67) 100% (67/67) | |
|
99 | lo Lao 84% (55/65) (0/65) 43% (28/65) | |
|
100 | lt Lithuanian 100% (70/70) 100% (70/70) 100% (70/70) | |
|
101 | lv Latvian 100% (78/78) 100% (78/78) 100% (78/78) | |
|
102 | mg Malagasy 100% (56/56) 100% (56/56) 100% (56/56) | |
|
103 | mh Marshallese 100% (62/62) 100% (62/62) 100% (62/62) | |
|
104 | mi Maori 100% (64/64) 100% (64/64) 100% (64/64) | |
|
105 | mk Macedonian 100% (42/42) 100% (42/42) 100% (42/42) | |
|
106 | ml Malayalam (0/78) (0/78) (0/78) | |
|
107 | mn Mongolian (0/130) (0/130) (0/130) | |
|
108 | mo Moldavian 100% (128/128) 100% (128/128) 100% (128/128) | |
|
109 | mr Marathi (Devanagari script) (0/68) (0/68) (0/68) | |
|
110 | mt Maltese 100% (72/72) 100% (72/72) 100% (72/72) | |
|
111 | my Burmese (Myanmar) (0/48) (0/48) (0/48) | |
|
112 | nb Norwegian Bokmal 100% (70/70) 100% (70/70) 100% (70/70) | |
|
113 | nds Low Saxon 100% (59/59) 100% (59/59) 100% (59/59) | |
|
114 | ne Nepali (Devanagari script) (0/68) (0/68) (0/68) | |
|
115 | nl Dutch 100% (82/82) 100% (82/82) 100% (82/82) | |
|
116 | nn Norwegian Nynorsk 100% (76/76) 100% (76/76) 100% (76/76) | |
|
117 | no Norwegian (Bokmal) 100% (70/70) 100% (70/70) 100% (70/70) | |
|
118 | ny Chichewa 100% (54/54) 100% (54/54) 100% (54/54) | |
|
119 | oc Occitan 100% (70/70) 100% (70/70) 100% (70/70) | |
|
120 | om Oromo or Galla 100% (52/52) 100% (52/52) 100% (52/52) | |
|
121 | or Oriya (0/79) (0/79) (0/79) | |
|
122 | os Ossetic 100% (66/66) 100% (66/66) 100% (66/66) | |
|
123 | pa Punjabi (Gurumukhi script) (0/63) (0/63) (0/63) | |
|
124 | pl Polish 100% (70/70) 100% (70/70) 100% (70/70) | |
|
125 | ps-af Pashto in Afghanistan 83% (41/49) (0/49) (0/49) | |
|
126 | ps-pk Pashto in Pakistan 81% (40/49) (0/49) (0/49) | |
|
127 | pt Portuguese 100% (82/82) 100% (82/82) 100% (82/82) | |
|
128 | rm Rhaeto-Romance (Romansch) 100% (66/66) 100% (66/66) 100% (66/66) | |
|
129 | ro Romanian 100% (62/62) 100% (62/62) 100% (62/62) | |
|
130 | ru Russian 100% (66/66) 100% (66/66) 100% (66/66) | |
|
131 | sa Sanskrit (Devanagari script) (0/68) (0/68) (0/68) | |
|
132 | sah Yakut 100% (76/76) 100% (76/76) 97% (74/76) | |
|
133 | sco Scots 100% (56/56) 96% (54/56) 96% (54/56) | |
|
134 | se North Sami 100% (66/66) 100% (66/66) 100% (66/66) | |
|
135 | sel Selkup (Ostyak-Samoyed) 100% (66/66) 100% (66/66) 100% (66/66) | |
|
136 | sh Serbo-Croatian 100% (76/76) 100% (76/76) 100% (76/76) | |
|
137 | si Sinhala (Sinhalese) (0/77) (0/77) (0/77) | |
|
138 | sk Slovak 100% (86/86) 100% (86/86) 100% (86/86) | |
|
139 | sl Slovenian 100% (62/62) 100% (62/62) 100% (62/62) | |
|
140 | sm Samoan 100% (53/53) 100% (53/53) 100% (53/53) | |
|
141 | sma South Sami 100% (60/60) 100% (60/60) 100% (60/60) | |
|
142 | smj Lule Sami 100% (60/60) 100% (60/60) 100% (60/60) | |
|
143 | smn Inari Sami 100% (68/68) 100% (68/68) 100% (68/68) | |
|
144 | sms Skolt Sami 100% (80/80) 100% (80/80) 97% (78/80) | |
|
145 | so Somali 100% (52/52) 100% (52/52) 100% (52/52) | |
|
146 | sq Albanian 100% (56/56) 100% (56/56) 100% (56/56) | |
|
147 | sr Serbian 100% (76/76) 100% (76/76) 100% (76/76) | |
|
148 | sv Swedish 100% (68/68) 100% (68/68) 100% (68/68) | |
|
149 | sw Swahili 100% (52/52) 100% (52/52) 100% (52/52) | |
|
150 | syr Syriac (0/45) (0/45) (0/45) | |
|
151 | ta Tamil (0/48) (0/48) (0/48) | |
|
152 | te Telugu (0/80) (0/80) (0/80) | |
|
153 | tg Tajik 100% (78/78) 100% (78/78) 97% (76/78) | |
|
154 | th Thai 1% (1/87) (0/87) (0/87) | |
|
155 | ti-er Eritrean Tigrinya (0/256) (0/256) (0/256) | |
|
156 | ti-et Ethiopian Tigrinya (0/282) (0/282) (0/282) | |
|
157 | tig Tigre (0/221) (0/221) (0/221) | |
|
158 | tk Turkmen 100% (74/74) 100% (74/74) 97% (72/74) | |
|
159 | tl Tagalog (0/19) (0/19) (0/19) | |
|
160 | tn Tswana 100% (56/56) 100% (56/56) 100% (56/56) | |
|
161 | to Tonga 100% (53/53) 100% (53/53) 100% (53/53) | |
|
162 | tr Turkish 100% (70/70) 100% (70/70) 100% (70/70) | |
|
163 | ts Tsonga 100% (52/52) 100% (52/52) 100% (52/52) | |
|
164 | tt Tatar 100% (76/76) 100% (76/76) 97% (74/76) | |
|
165 | tw Twi 100% (73/73) 100% (73/73) 100% (73/73) | |
|
166 | tyv Tuvinian 100% (70/70) 100% (70/70) 100% (70/70) | |
|
167 | ug Uighur 100% (125/125) (0/125) (0/125) | |
|
168 | uk Ukrainian 100% (72/72) 100% (72/72) 100% (72/72) | |
|
169 | ur Urdu 94% (137/145) (0/145) (0/145) | |
|
170 | uz Uzbek 100% (68/68) 100% (68/68) 100% (68/68) | |
|
171 | ven Venda 100% (62/62) 100% (62/62) 100% (62/62) | |
|
172 | vi Vietnamese 100% (194/194) 77% (150/194) 62% (122/194) | |
|
173 | vo Volapuk 100% (54/54) 100% (54/54) 100% (54/54) | |
|
174 | vot Votic 100% (62/62) 100% (62/62) 100% (62/62) | |
|
175 | wa Walloon 100% (70/70) 100% (70/70) 100% (70/70) | |
|
176 | wen Sorbian languages (lower and upper) 100% (76/76) 100% (76/76) 100% (76/76) | |
|
177 | wo Wolof 100% (66/66) 100% (66/66) 100% (66/66) | |
|
178 | xh Xhosa 100% (52/52) 100% (52/52) 100% (52/52) | |
|
179 | yap Yapese 100% (58/58) 100% (58/58) 100% (58/58) | |
|
180 | yi Yiddish 100% (27/27) (0/27) (0/27) | |
|
181 | yo Yoruba 100% (119/119) 100% (119/119) 100% (119/119) | |
|
182 | zh-cn Chinese (simplified) 0% (2/6765) 0% (2/6765) 0% (2/6765) | |
|
183 | zh-hk Chinese Hong Kong Supplementary Character Set (0/2213) (0/2213) (0/2213) | |
|
184 | zh-mo Chinese in Macau (0/13063) (0/13063) (0/13063) | |
|
185 | zh-sg Chinese in Singapore 0% (2/6765) 0% (2/6765) 0% (2/6765) | |
|
186 | zh-tw Chinese (traditional) (0/13063) (0/13063) (0/13063) | |
|
187 | zu Zulu 100% (52/52) 100% (52/52) 100% (52/52) |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100644 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100644 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100644 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100644 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100644 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100644 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755, binary diff hidden |
|
1 | NO CONTENT: new file 100644 | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: new file 100755 | |
The requested commit or file is too big and content was truncated. Show full diff |
@@ -11,3 +11,4 | |||
|
11 | 11 | * Added :filename option in this hash |
|
12 | 12 | If you're using the same settings for @options_for_rfpdf often, you might want to |
|
13 | 13 | put your assignment in a before_filter (perhaps overriding :filename, etc in your actions). |
|
14 | 1.15 2009-11-20 Rails 2.* support - Thanks to Prawnto plugin for showing the way to the new TemplateHandler No newline at end of file |
@@ -1,99 +1,45 | |||
|
1 | FWIW - I am migrating my apps to Prawn and Prawnto | |
|
2 | ||
|
1 | 3 | = RFPDF Template Plugin |
|
2 | 4 | |
|
3 | 5 | A template plugin allowing the inclusion of ERB-enabled RFPDF template files. |
|
4 | 6 | |
|
5 | == Example .rb method Usage | |
|
7 | == | |
|
8 | == | |
|
9 | == TCPDF Version (The New or UTF8 Version) | |
|
10 | == | |
|
11 | == | |
|
12 | ||
|
13 | If you are using HTML, it is recommended you install: | |
|
6 | 14 | |
|
7 | In the controller, something like: | |
|
15 | gem install -r htmlentities | |
|
8 | 16 | |
|
9 | def mypdf | |
|
10 | pdf = FPDF.new() | |
|
17 | TCPDF Documentation located at: | |
|
11 | 18 | |
|
12 | # | |
|
13 | # Chinese | |
|
14 | # | |
|
15 | pdf.extend(PDF_Chinese) | |
|
16 | pdf.AddPage | |
|
17 | pdf.AddBig5Font | |
|
18 | pdf.SetFont('Big5','',18) | |
|
19 | pdf.Write(5, '²{®É®ð·Å 18 C Àã«× 83 %') | |
|
20 | icBig5 = Iconv.new('Big5', 'UTF-8') | |
|
21 | pdf.Write(15, icBig5.iconv("宋体 should be working")) | |
|
22 | send_data pdf.Output, :filename => "something.pdf", :type => "application/pdf" | |
|
23 | end | |
|
19 | http://phpdocs.moodle.org/com-tecnick-tcpdf/TCPDF.html | |
|
24 | 20 | |
|
25 | == Example .rfdf Usage | |
|
21 | Example of simple use in .rhtml: | |
|
26 | 22 | |
|
27 | In the controller, something like: | |
|
23 | <% | |
|
24 | @pdf = TCPDF.new() | |
|
25 | @pdf.SetMargins(15, 27, 15); | |
|
26 | @pdf.AddPage(); | |
|
27 | text_options = {:font => "freeserif"} | |
|
28 | @pdf.draw_text(15, 10, "text", {:font_size => 12, :font => "freeserif"}) | |
|
29 | %><%=@pdf.Output()%> | |
|
28 | 30 | |
|
29 | def mypdf | |
|
30 | @options_for_rfpdf ||= {} | |
|
31 | @options_for_rfpdf[:file_name] = "nice_looking.pdf" | |
|
32 | end | |
|
31 | See the following files for sample of useage: | |
|
33 | 32 | |
|
34 | In the layout (make sure this is the only item in the layout): | |
|
35 | <%= @content_for_layout %> | |
|
33 | test_unicode.rfpdf | |
|
34 | utf8test.txt | |
|
35 | logo_example.png | |
|
36 | 36 | |
|
37 | In the view (mypdf.rfpdf): | |
|
37 | FPDF users can migrate to TCPDF by changing the following from: | |
|
38 | 38 | |
|
39 | <% | |
|
40 | pdf = FPDF.new() | |
|
41 | # | |
|
42 | # Chinese | |
|
43 | # | |
|
44 | pdf.extend(PDF_Chinese) | |
|
45 | pdf.AddPage | |
|
46 | pdf.AddBig5Font | |
|
47 | pdf.SetFont('Big5','',18) | |
|
48 | pdf.Write(5, '²{®É®ð·Å 18 C Àã«× 83 %') | |
|
49 | icBig5 = Iconv.new('Big5', 'UTF-8') | |
|
50 | pdf.Write(15, icBig5.iconv("宋体 should be working")) | |
|
51 | ||
|
52 | # | |
|
53 | # Japanese | |
|
54 | # | |
|
55 | pdf.extend(PDF_Japanese) | |
|
56 | pdf.AddSJISFont(); | |
|
57 | pdf.AddPage(); | |
|
58 | pdf.SetFont('SJIS','',18); | |
|
59 | pdf.Write(5,'9ÉñåéÇÃåˆäJÉeÉXÉgÇåoǃPHP 3.0ÇÕ1998îN6åéÇ…åˆéÆÇ…ÉäÉäÅ[ÉXÇ≥ÇÍNjǵÇΩÅB'); | |
|
60 | icSJIS = Iconv.new('SJIS', 'UTF-8') | |
|
61 | pdf.Write(15, icSJIS.iconv("これはテキストである should be working")) | |
|
62 | ||
|
63 | # | |
|
64 | # Korean | |
|
65 | # | |
|
66 | pdf.extend(PDF_Korean) | |
|
67 | pdf.AddUHCFont(); | |
|
68 | pdf.AddPage(); | |
|
69 | pdf.SetFont('UHC','',18); | |
|
70 | pdf.Write(5,'PHP 3.0Àº 1998³â 6¿ù¿¡ °ø½ÄÀûÀ¸·Î ¸±¸®ÁîµÇ¾ú´Ù. °ø°³ÀûÀÎ Å×½ºÆ® ÀÌÈľà 9°³¿ù¸¸À̾ú´Ù.'); | |
|
71 | icUHC = Iconv.new('UHC', 'UTF-8') | |
|
72 | pdf.Write(15, icUHC.iconv("이것은 원본 이다")) | |
|
73 | ||
|
74 | # | |
|
75 | # English | |
|
76 | # | |
|
77 | pdf.AddPage(); | |
|
78 | pdf.SetFont('Arial', '', 10) | |
|
79 | pdf.Write(5, "should be working") | |
|
80 | %> | |
|
81 | <%= pdf.Output() %> | |
|
82 | ||
|
83 | ||
|
84 | == Configuring | |
|
85 | ||
|
86 | You can configure Rfpdf by using an @options_for_rfpdf hash in your controllers. | |
|
87 | ||
|
88 | Here are a few options: | |
|
89 | ||
|
90 | :filename (default: action_name.pdf) | |
|
91 | Filename of PDF to generate | |
|
92 | ||
|
93 | Note: If you're using the same settings for @options_for_rfpdf often, you might want to | |
|
94 | put your assignment in a before_filter (perhaps overriding :filename, etc in your actions). | |
|
95 | ||
|
96 | == Problems | |
|
97 | ||
|
98 | Layouts and partials are currently not supported; just need | |
|
99 | to wrap the PDF generation differently. | |
|
39 | pdf = FPDF.new | |
|
40 | ||
|
41 | to: | |
|
42 | ||
|
43 | pdf = TCPDF.new | |
|
44 | ||
|
45 | ENJOY! No newline at end of file |
@@ -1,9 +1,10 | |||
|
1 | require 'rfpdf' | |
|
2 | ||
|
3 | 1 |
|
|
4 | ActionView::Template::register_template_handler 'rfpdf', RFPDF::View | |
|
5 |
rescue |
|
|
6 | # Rails < 2.1 | |
|
7 | RFPDF::View.backward_compatibility_mode = true | |
|
8 | ActionView::Base::register_template_handler 'rfpdf', RFPDF::View | |
|
2 | require('htmlentities') | |
|
3 | rescue LoadError | |
|
4 | # This gem is not required - just nice to have. | |
|
9 | 5 | end |
|
6 | require('cgi') | |
|
7 | require 'rfpdf' | |
|
8 | ||
|
9 | Mime::Type.register "application/pdf", :pdf | |
|
10 | ActionView::Template::register_template_handler 'rfpdf', RFPDF::TemplateHandlers::Base |
@@ -1,9 +1,39 | |||
|
1 | module RFPDF | |
|
1 | module Core::RFPDF | |
|
2 | 2 | COLOR_PALETTE = { |
|
3 | 3 |
|
|
4 | 4 |
|
|
5 | 5 | }.freeze |
|
6 | 6 | |
|
7 | # Draw a circle at (<tt>mid_x, mid_y</tt>) with <tt>radius</tt>. | |
|
8 | # | |
|
9 | # Options are: | |
|
10 | # * <tt>:border</tt> - Draw a border, 0 = no, 1 = yes? Default value is <tt>1</tt>. | |
|
11 | # * <tt>:border_color</tt> - Default value is <tt>COLOR_PALETTE[:black]</tt>. | |
|
12 | # * <tt>:border_width</tt> - Default value is <tt>0.5</tt>. | |
|
13 | # * <tt>:fill</tt> - Fill the box, 0 = no, 1 = yes? Default value is <tt>1</tt>. | |
|
14 | # * <tt>:fill_color</tt> - Default value is nothing or <tt>COLOR_PALETTE[:white]</tt>. | |
|
15 | # * <tt>:fill_colorspace</tt> - Default value is :rgb or <tt>''</tt>. | |
|
16 | # | |
|
17 | # Example: | |
|
18 | # | |
|
19 | # draw_circle(x, y, radius, :border_color => ReportHelper::COLOR_PALETTE[:dark_blue], :border_width => 1) | |
|
20 | # | |
|
21 | def draw_circle(mid_x, mid_y, radius, options = {}) | |
|
22 | options[:border] ||= 1 | |
|
23 | options[:border_color] ||= Core::RFPDF::COLOR_PALETTE[:black] | |
|
24 | options[:border_width] ||= 0.5 | |
|
25 | options[:fill] ||= 1 | |
|
26 | options[:fill_color] ||= Core::RFPDF::COLOR_PALETTE[:white] | |
|
27 | options[:fill_colorspace] ||= :rgb | |
|
28 | SetLineWidth(options[:border_width]) | |
|
29 | set_draw_color_a(options[:border_color]) | |
|
30 | set_fill_color_a(options[:fill_color], options[:colorspace]) | |
|
31 | fd = "" | |
|
32 | fd = "D" if options[:border] == 1 | |
|
33 | fd += "F" if options[:fill] == 1 | |
|
34 | Circle(mid_x, mid_y, radius, fd) | |
|
35 | end | |
|
36 | ||
|
7 | 37 | # Draw a line from (<tt>x1, y1</tt>) to (<tt>x2, y2</tt>). |
|
8 | 38 | # |
|
9 | 39 | # Options are: |
@@ -15,9 +45,9 module RFPDF | |||
|
15 | 45 | # draw_line(x1, y1, x1, y1+h, :line_color => ReportHelper::COLOR_PALETTE[:dark_blue], :line_width => 1) |
|
16 | 46 | # |
|
17 | 47 | def draw_line(x1, y1, x2, y2, options = {}) |
|
18 | options[:line_color] ||= COLOR_PALETTE[:black] | |
|
48 | options[:line_color] ||= Core::RFPDF::COLOR_PALETTE[:black] | |
|
19 | 49 | options[:line_width] ||= 0.5 |
|
20 | set_draw_color(options[:line_color]) | |
|
50 | set_draw_color_a(options[:line_color]) | |
|
21 | 51 | SetLineWidth(options[:line_width]) |
|
22 | 52 | Line(x1, y1, x2, y2) |
|
23 | 53 | end |
@@ -28,28 +58,31 module RFPDF | |||
|
28 | 58 | # * <tt>:font_color</tt> - Default value is <tt>COLOR_PALETTE[:black]</tt>. |
|
29 | 59 | # * <tt>:font_size</tt> - Default value is <tt>10</tt>. |
|
30 | 60 | # * <tt>:font_style</tt> - Default value is nothing or <tt>''</tt>. |
|
61 | # * <tt>:colorspace</tt> - Default value is :rgb or <tt>''</tt>. | |
|
31 | 62 | # |
|
32 | 63 | # Example: |
|
33 | 64 | # |
|
34 | 65 | # draw_text(x, y, header_left, :font_size => 10) |
|
35 | 66 | # |
|
36 | 67 | def draw_text(x, y, text, options = {}) |
|
37 | options[:font_color] ||= COLOR_PALETTE[:black] | |
|
68 | options[:font_color] ||= Core::RFPDF::COLOR_PALETTE[:black] | |
|
69 | options[:font] ||= default_font | |
|
38 | 70 | options[:font_size] ||= 10 |
|
39 | 71 | options[:font_style] ||= '' |
|
40 | set_text_color(options[:font_color]) | |
|
41 |
SetFont( |
|
|
72 | set_text_color_a(options[:font_color], options[:colorspace]) | |
|
73 | SetFont(options[:font], options[:font_style], options[:font_size]) | |
|
42 | 74 | SetXY(x, y) |
|
43 | 75 | Write(options[:font_size] + 4, text) |
|
44 | 76 | end |
|
45 | 77 | |
|
46 | # Draw a block of <tt>text</tt> at (<tt>x, y</tt>) bounded by <tt>left_margin</tt> and <tt>right_margin</tt>. Both | |
|
78 | # Draw a block of <tt>text</tt> at (<tt>x, y</tt>) bounded by <tt>left_margin</tt> and <tt>right_margin_from_right_edge</tt>. Both | |
|
47 | 79 | # margins are measured from their corresponding edge. |
|
48 | 80 | # |
|
49 | 81 | # Options are: |
|
50 | 82 | # * <tt>:font_color</tt> - Default value is <tt>COLOR_PALETTE[:black]</tt>. |
|
51 | 83 | # * <tt>:font_size</tt> - Default value is <tt>10</tt>. |
|
52 | 84 | # * <tt>:font_style</tt> - Default value is nothing or <tt>''</tt>. |
|
85 | # * <tt>:colorspace</tt> - Default value is :rgb or <tt>''</tt>. | |
|
53 | 86 | # |
|
54 | 87 | # Example: |
|
55 | 88 | # |
@@ -58,15 +91,16 module RFPDF | |||
|
58 | 91 | # :font_size => 12, |
|
59 | 92 | # :font_style => 'I') |
|
60 | 93 | # |
|
61 | def draw_text_block(x, y, text, left_margin, right_margin, options = {}) | |
|
62 | options[:font_color] ||= COLOR_PALETTE[:black] | |
|
94 | def draw_text_block(x, y, text, left_margin, right_margin_from_right_edge, options = {}) | |
|
95 | options[:font] ||= default_font | |
|
96 | options[:font_color] ||= Core::RFPDF::COLOR_PALETTE[:black] | |
|
63 | 97 | options[:font_size] ||= 10 |
|
64 | 98 | options[:font_style] ||= '' |
|
65 | set_text_color(options[:font_color]) | |
|
66 |
SetFont( |
|
|
99 | set_text_color_a(options[:font_color], options[:colorspace]) | |
|
100 | SetFont(options[:font], options[:font_style], options[:font_size]) | |
|
67 | 101 | SetXY(x, y) |
|
68 | 102 | SetLeftMargin(left_margin) |
|
69 | SetRightMargin(right_margin) | |
|
103 | SetRightMargin(right_margin_from_right_edge) | |
|
70 | 104 | Write(options[:font_size] + 4, text) |
|
71 | 105 | SetMargins(0,0,0) |
|
72 | 106 | end |
@@ -79,6 +113,7 module RFPDF | |||
|
79 | 113 | # * <tt>:border_width</tt> - Default value is <tt>0.5</tt>. |
|
80 | 114 | # * <tt>:fill</tt> - Fill the box, 0 = no, 1 = yes? Default value is <tt>1</tt>. |
|
81 | 115 | # * <tt>:fill_color</tt> - Default value is nothing or <tt>COLOR_PALETTE[:white]</tt>. |
|
116 | # * <tt>:fill_colorspace</tt> - Default value is :rgb or <tt>''</tt>. | |
|
82 | 117 | # |
|
83 | 118 | # Example: |
|
84 | 119 | # |
@@ -86,13 +121,14 module RFPDF | |||
|
86 | 121 | # |
|
87 | 122 | def draw_box(x, y, w, h, options = {}) |
|
88 | 123 | options[:border] ||= 1 |
|
89 | options[:border_color] ||= COLOR_PALETTE[:black] | |
|
124 | options[:border_color] ||= Core::RFPDF::COLOR_PALETTE[:black] | |
|
90 | 125 | options[:border_width] ||= 0.5 |
|
91 | 126 | options[:fill] ||= 1 |
|
92 | options[:fill_color] ||= COLOR_PALETTE[:white] | |
|
127 | options[:fill_color] ||= Core::RFPDF::COLOR_PALETTE[:white] | |
|
128 | options[:fill_colorspace] ||= :rgb | |
|
93 | 129 | SetLineWidth(options[:border_width]) |
|
94 | set_draw_color(options[:border_color]) | |
|
95 | set_fill_color(options[:fill_color]) | |
|
130 | set_draw_color_a(options[:border_color]) | |
|
131 | set_fill_color_a(options[:fill_color], options[:fill_colorspace]) | |
|
96 | 132 | fd = "" |
|
97 | 133 | fd = "D" if options[:border] == 1 |
|
98 | 134 | fd += "F" if options[:fill] == 1 |
@@ -112,7 +148,9 module RFPDF | |||
|
112 | 148 | # * <tt>:font_size</tt> - Default value is nothing or <tt>8</tt>. |
|
113 | 149 | # * <tt>:font_style</tt> - 'B' = bold, 'I' = italic, 'U' = underline. Default value is nothing <tt>''</tt>. |
|
114 | 150 | # * <tt>:padding</tt> - Default value is nothing or <tt>2</tt>. |
|
151 | # * <tt>:x_padding</tt> - Default value is nothing. | |
|
115 | 152 | # * <tt>:valign</tt> - 'M' = middle, 'T' = top, 'B' = bottom. Default value is nothing or <tt>'M'</tt>. |
|
153 | # * <tt>:colorspace</tt> - Default value is :rgb or <tt>''</tt>. | |
|
116 | 154 | # |
|
117 | 155 | # Example: |
|
118 | 156 | # |
@@ -127,36 +165,50 module RFPDF | |||
|
127 | 165 | def draw_text_box(x, y, w, h, text, options = {}) |
|
128 | 166 | options[:align] ||= 'C' |
|
129 | 167 | options[:border] ||= 0 |
|
130 | options[:border_color] ||= COLOR_PALETTE[:black] | |
|
168 | options[:border_color] ||= Core::RFPDF::COLOR_PALETTE[:black] | |
|
131 | 169 | options[:border_width] ||= 0.5 |
|
132 | 170 | options[:fill] ||= 1 |
|
133 | options[:fill_color] ||= COLOR_PALETTE[:white] | |
|
134 | options[:font_color] ||= COLOR_PALETTE[:black] | |
|
171 | options[:fill_color] ||= Core::RFPDF::COLOR_PALETTE[:white] | |
|
172 | options[:font] ||= default_font | |
|
173 | options[:font_color] ||= Core::RFPDF::COLOR_PALETTE[:black] | |
|
135 | 174 | options[:font_size] ||= 8 |
|
136 | 175 | options[:font_line_spacing] ||= options[:font_size] * 0.3 |
|
137 | 176 | options[:font_style] ||= '' |
|
138 | 177 | options[:padding] ||= 2 |
|
178 | options[:x_padding] ||= 0 | |
|
139 | 179 | options[:valign] ||= "M" |
|
140 | 180 | if options[:fill] == 1 or options[:border] == 1 |
|
141 | 181 | draw_box(x, y, w, h, options) |
|
142 | 182 | end |
|
143 | 183 | SetMargins(0,0,0) |
|
144 | set_text_color(options[:font_color]) | |
|
184 | set_text_color_a(options[:font_color], options[:colorspace]) | |
|
145 | 185 | font_size = options[:font_size] |
|
146 |
SetFont( |
|
|
186 | SetFont(options[:font], options[:font_style], font_size) | |
|
147 | 187 | font_size += options[:font_line_spacing] |
|
148 | 188 | case options[:valign] |
|
149 | when "B" | |
|
189 | when "B", "bottom" | |
|
150 | 190 | y -= options[:padding] |
|
151 | text = "\n" + text if text["\n"].nil? | |
|
152 | when "T" | |
|
191 | when "T", "top" | |
|
153 | 192 | y += options[:padding] |
|
154 | 193 | end |
|
194 | case options[:align] | |
|
195 | when "L", "left" | |
|
196 | x += options[:x_padding] | |
|
197 | w -= options[:x_padding] | |
|
198 | w -= options[:x_padding] | |
|
199 | when "R", "right" | |
|
200 | x += options[:x_padding] | |
|
201 | w -= options[:x_padding] | |
|
202 | w -= options[:x_padding] | |
|
203 | end | |
|
155 | 204 | SetXY(x, y) |
|
156 |
|
|
|
205 | if GetStringWidth(text) < w or not text["\n"].nil? and (options[:valign] == "T" || options[:valign] == "top") | |
|
206 | text = text + "\n" | |
|
207 | end | |
|
208 | if GetStringWidth(text) > w or not text["\n"].nil? or (options[:valign] == "B" || options[:valign] == "bottom") | |
|
157 | 209 |
|
|
158 | 210 |
|
|
159 |
|
|
|
211 | SetXY(x, y + ((h - (font_size * 2)) / 2)) if (options[:valign] == "M" || options[:valign] == "middle") | |
|
160 | 212 | MultiCell(w, font_size, text, 0, options[:align]) |
|
161 | 213 | else |
|
162 | 214 | Cell(w, h, text, 0, 0, options[:align]) |
@@ -169,6 +221,7 module RFPDF | |||
|
169 | 221 | # * <tt>:font_color</tt> - Default value is <tt>COLOR_PALETTE[:black]</tt>. |
|
170 | 222 | # * <tt>:font_size</tt> - Default value is <tt>18</tt>. |
|
171 | 223 | # * <tt>:font_style</tt> - Default value is nothing or <tt>''</tt>. |
|
224 | # * <tt>:colorspace</tt> - Default value is :rgb or <tt>''</tt>. | |
|
172 | 225 | # |
|
173 | 226 | # Example: |
|
174 | 227 | # |
@@ -177,11 +230,12 module RFPDF | |||
|
177 | 230 | # :font_color => ReportHelper::COLOR_PALETTE[:dark_blue]) |
|
178 | 231 | # |
|
179 | 232 | def draw_title(x, y, title, options = {}) |
|
180 | options[:font_color] ||= COLOR_PALETTE[:black] | |
|
233 | options[:font_color] ||= Core::RFPDF::COLOR_PALETTE[:black] | |
|
234 | options[:font] ||= default_font | |
|
181 | 235 | options[:font_size] ||= 18 |
|
182 | 236 | options[:font_style] ||= '' |
|
183 | set_text_color(options[:font_color]) | |
|
184 |
SetFont( |
|
|
237 | set_text_color_a(options[:font_color], options[:colorspace]) | |
|
238 | SetFont(options[:font], options[:font_style], options[:font_size]) | |
|
185 | 239 | SetXY(x, y) |
|
186 | 240 | Write(options[:font_size] + 2, title) |
|
187 | 241 | end |
@@ -190,9 +244,9 module RFPDF | |||
|
190 | 244 | # |
|
191 | 245 | # Example: |
|
192 | 246 | # |
|
193 | # set_draw_color(ReportHelper::COLOR_PALETTE[:dark_blue]) | |
|
247 | # set_draw_color_a(ReportHelper::COLOR_PALETTE[:dark_blue]) | |
|
194 | 248 | # |
|
195 | def set_draw_color(color = COLOR_PALETTE[:black]) | |
|
249 | def set_draw_color_a(color = Core::RFPDF::COLOR_PALETTE[:black]) | |
|
196 | 250 | SetDrawColor(color[0], color[1], color[2]) |
|
197 | 251 | end |
|
198 | 252 | |
@@ -200,21 +254,29 module RFPDF | |||
|
200 | 254 | # |
|
201 | 255 | # Example: |
|
202 | 256 | # |
|
203 | # set_fill_color(ReportHelper::COLOR_PALETTE[:dark_blue]) | |
|
257 | # set_fill_color_a(ReportHelper::COLOR_PALETTE[:dark_blue]) | |
|
204 | 258 | # |
|
205 | def set_fill_color(color = COLOR_PALETTE[:white]) | |
|
259 | def set_fill_color_a(color = Core::RFPDF::COLOR_PALETTE[:white], colorspace = :rgb) | |
|
260 | if colorspace == :cmyk | |
|
261 | SetCmykFillColor(color[0], color[1], color[2], color[3]) | |
|
262 | else | |
|
206 | 263 | SetFillColor(color[0], color[1], color[2]) |
|
207 | 264 | end |
|
265 | end | |
|
208 | 266 | |
|
209 | 267 | # Set the text color. Default value is <tt>COLOR_PALETTE[:white]</tt>. |
|
210 | 268 | # |
|
211 | 269 | # Example: |
|
212 | 270 | # |
|
213 | # set_text_color(ReportHelper::COLOR_PALETTE[:dark_blue]) | |
|
271 | # set_text_color_a(ReportHelper::COLOR_PALETTE[:dark_blue]) | |
|
214 | 272 | # |
|
215 | def set_text_color(color = COLOR_PALETTE[:black]) | |
|
273 | def set_text_color_a(color = Core::RFPDF::COLOR_PALETTE[:black], colorspace = :rgb) | |
|
274 | if colorspace == :cmyk | |
|
275 | SetCmykTextColor(color[0], color[1], color[2], color[3]) | |
|
276 | else | |
|
216 | 277 | SetTextColor(color[0], color[1], color[2]) |
|
217 | 278 | end |
|
279 | end | |
|
218 | 280 | |
|
219 | 281 | # Write a string containing html characters. Default value is <tt>COLOR_PALETTE[:white]</tt>. |
|
220 | 282 | # |
@@ -223,124 +285,14 module RFPDF | |||
|
223 | 285 | # |
|
224 | 286 | # Example: |
|
225 | 287 | # |
|
226 | # write_html(html, :height => 12) | |
|
288 | # write_html_with_options(html, :height => 12) | |
|
227 | 289 | # |
|
228 | def write_html(html, options = {}) | |
|
290 | #FIXME 2007-08-07 (EJM) Level=0 - This needs to call the TCPDF version. | |
|
291 | def write_html_with_options(html, options = {}) | |
|
292 | options[:fill] ||= 0 | |
|
229 | 293 | options[:height] ||= 20 |
|
230 | #HTML parser | |
|
231 | @href = nil | |
|
232 | @style = {} | |
|
233 | html.gsub!("\n",' ') | |
|
234 | re = %r{ ( <!--.*?--> | | |
|
235 | < (?: | |
|
236 | [^<>"] + | |
|
237 | | | |
|
238 | " (?: \\. | [^\\"]+ ) * " | |
|
239 | ) * | |
|
240 | > | |
|
241 | ) }xm | |
|
242 | ||
|
243 | html.split(re).each do |value| | |
|
244 | if "<" == value[0,1] | |
|
245 | #Tag | |
|
246 | if (value[1, 1] == '/') | |
|
247 | close_tag(value[2..-2], options) | |
|
248 | else | |
|
249 | tag = value[1..-2] | |
|
250 | open_tag(tag, options) | |
|
251 | end | |
|
252 | else | |
|
253 | #Text | |
|
254 | if @href | |
|
255 | put_link(@href,value) | |
|
256 | else | |
|
257 | Write(options[:height], value) | |
|
258 | end | |
|
259 | end | |
|
294 | options[:new_line_after] ||= false | |
|
295 | write_html(html, options[:new_line_after], options[:fill], options[:height]) | |
|
296 | return | |
|
260 | 297 |
|
|
261 | 298 |
|
|
No newline at end of file | ||
|
262 | ||
|
263 | def open_tag(tag, options = {}) #:nodoc: | |
|
264 | #Opening tag | |
|
265 | tag = tag.to_s.upcase | |
|
266 | set_style(tag, true) if tag == 'B' or tag == 'I' or tag == 'U' | |
|
267 | @href = options['HREF'] if tag == 'A' | |
|
268 | Ln(options[:height]) if tag == 'BR' | |
|
269 | end | |
|
270 | ||
|
271 | def close_tag(tag, options = {}) #:nodoc: | |
|
272 | #Closing tag | |
|
273 | tag = tag.to_s.upcase | |
|
274 | set_style(tag, false) if tag == 'B' or tag == 'I' or tag == 'U' | |
|
275 | @href = '' if $tag == 'A' | |
|
276 | end | |
|
277 | ||
|
278 | def set_style(tag, enable = true) #:nodoc: | |
|
279 | #Modify style and select corresponding font | |
|
280 | style = "" | |
|
281 | @style[tag] = enable | |
|
282 | ['B','I','U'].each do |s| | |
|
283 | style += s if not @style[s].nil? and @style[s] | |
|
284 | end | |
|
285 | SetFont('', style) | |
|
286 | end | |
|
287 | ||
|
288 | def put_link(url, txt) #:nodoc: | |
|
289 | #Put a hyperlink | |
|
290 | SetTextColor(0,0,255) | |
|
291 | set_style('U',true) | |
|
292 | Write(5, txt, url) | |
|
293 | set_style('U',false) | |
|
294 | SetTextColor(0) | |
|
295 | end | |
|
296 | end | |
|
297 | ||
|
298 | # class FPDF | |
|
299 | # alias_method :set_margins , :SetMargins | |
|
300 | # alias_method :set_left_margin , :SetLeftMargin | |
|
301 | # alias_method :set_top_margin , :SetTopMargin | |
|
302 | # alias_method :set_right_margin , :SetRightMargin | |
|
303 | # alias_method :set_auto_pagebreak , :SetAutoPageBreak | |
|
304 | # alias_method :set_display_mode , :SetDisplayMode | |
|
305 | # alias_method :set_compression , :SetCompression | |
|
306 | # alias_method :set_title , :SetTitle | |
|
307 | # alias_method :set_subject , :SetSubject | |
|
308 | # alias_method :set_author , :SetAuthor | |
|
309 | # alias_method :set_keywords , :SetKeywords | |
|
310 | # alias_method :set_creator , :SetCreator | |
|
311 | # alias_method :set_draw_color , :SetDrawColor | |
|
312 | # alias_method :set_fill_color , :SetFillColor | |
|
313 | # alias_method :set_text_color , :SetTextColor | |
|
314 | # alias_method :set_line_width , :SetLineWidth | |
|
315 | # alias_method :set_font , :SetFont | |
|
316 | # alias_method :set_font_size , :SetFontSize | |
|
317 | # alias_method :set_link , :SetLink | |
|
318 | # alias_method :set_y , :SetY | |
|
319 | # alias_method :set_xy , :SetXY | |
|
320 | # alias_method :get_string_width , :GetStringWidth | |
|
321 | # alias_method :get_x , :GetX | |
|
322 | # alias_method :set_x , :SetX | |
|
323 | # alias_method :get_y , :GetY | |
|
324 | # alias_method :accept_pagev_break , :AcceptPageBreak | |
|
325 | # alias_method :add_font , :AddFont | |
|
326 | # alias_method :add_link , :AddLink | |
|
327 | # alias_method :add_page , :AddPage | |
|
328 | # alias_method :alias_nb_pages , :AliasNbPages | |
|
329 | # alias_method :cell , :Cell | |
|
330 | # alias_method :close , :Close | |
|
331 | # alias_method :error , :Error | |
|
332 | # alias_method :footer , :Footer | |
|
333 | # alias_method :header , :Header | |
|
334 | # alias_method :image , :Image | |
|
335 | # alias_method :line , :Line | |
|
336 | # alias_method :link , :Link | |
|
337 | # alias_method :ln , :Ln | |
|
338 | # alias_method :multi_cell , :MultiCell | |
|
339 | # alias_method :open , :Open | |
|
340 | # alias_method :Open , :open | |
|
341 | # alias_method :output , :Output | |
|
342 | # alias_method :page_no , :PageNo | |
|
343 | # alias_method :rect , :Rect | |
|
344 | # alias_method :text , :Text | |
|
345 | # alias_method :write , :Write | |
|
346 | # end |
|
1 | NO CONTENT: file renamed from vendor/plugins/rfpdf/lib/rfpdf/bookmark.rb to vendor/plugins/rfpdf/lib/fpdf/bookmark.rb |
|
1 | NO CONTENT: file renamed from vendor/plugins/rfpdf/lib/rfpdf/chinese.rb to vendor/plugins/rfpdf/lib/fpdf/chinese.rb | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: file renamed from vendor/plugins/rfpdf/lib/rfpdf/fpdf_eps.rb to vendor/plugins/rfpdf/lib/fpdf/fpdf_eps.rb |
|
1 | NO CONTENT: file renamed from vendor/plugins/rfpdf/lib/rfpdf/japanese.rb to vendor/plugins/rfpdf/lib/fpdf/japanese.rb | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: file renamed from vendor/plugins/rfpdf/lib/rfpdf/korean.rb to vendor/plugins/rfpdf/lib/fpdf/korean.rb | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: file renamed from vendor/plugins/rfpdf/lib/rfpdf/makefont.rb to vendor/plugins/rfpdf/lib/fpdf/makefont.rb | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: modified file | |
The requested commit or file is too big and content was truncated. Show full diff |
|
1 | NO CONTENT: file was removed | |
The requested commit or file is too big and content was truncated. Show full diff |
General Comments 0
You need to be logged in to leave comments.
Login now