13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Barcode |
16 * @package Zend_Barcode |
17 * @subpackage Object |
17 * @subpackage Object |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: Code25.php 20096 2010-01-06 02:05:09Z bkarwin $ |
20 * @version $Id: Code25.php 24593 2012-01-05 20:35:02Z matthew $ |
21 */ |
21 */ |
22 |
22 |
23 /** |
23 /** |
24 * @see Zend_Barcode_Object_ObjectAbstract |
24 * @see Zend_Barcode_Object_ObjectAbstract |
25 */ |
25 */ |
33 /** |
33 /** |
34 * Class for generate Interleaved 2 of 5 barcode |
34 * Class for generate Interleaved 2 of 5 barcode |
35 * |
35 * |
36 * @category Zend |
36 * @category Zend |
37 * @package Zend_Barcode |
37 * @package Zend_Barcode |
38 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
38 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
39 * @license http://framework.zend.com/license/new-bsd New BSD License |
39 * @license http://framework.zend.com/license/new-bsd New BSD License |
40 */ |
40 */ |
41 class Zend_Barcode_Object_Code25 extends Zend_Barcode_Object_ObjectAbstract |
41 class Zend_Barcode_Object_Code25 extends Zend_Barcode_Object_ObjectAbstract |
42 { |
42 { |
43 /** |
43 /** |
95 $barcodeTable[] = array(1 , $this->_barThickWidth , 0 , 1); |
95 $barcodeTable[] = array(1 , $this->_barThickWidth , 0 , 1); |
96 $barcodeTable[] = array(0 , $this->_barThinWidth , 0 , 1); |
96 $barcodeTable[] = array(0 , $this->_barThinWidth , 0 , 1); |
97 $barcodeTable[] = array(1 , $this->_barThickWidth , 0 , 1); |
97 $barcodeTable[] = array(1 , $this->_barThickWidth , 0 , 1); |
98 $barcodeTable[] = array(0 , $this->_barThinWidth , 0 , 1); |
98 $barcodeTable[] = array(0 , $this->_barThinWidth , 0 , 1); |
99 $barcodeTable[] = array(1 , $this->_barThinWidth , 0 , 1); |
99 $barcodeTable[] = array(1 , $this->_barThinWidth , 0 , 1); |
100 $barcodeTable[] = array(0 , 1); |
100 $barcodeTable[] = array(0 , $this->_barThinWidth); |
101 |
101 |
102 $text = str_split($this->getText()); |
102 $text = str_split($this->getText()); |
103 foreach ($text as $char) { |
103 foreach ($text as $char) { |
104 $barcodeChar = str_split($this->_codingMap[$char]); |
104 $barcodeChar = str_split($this->_codingMap[$char]); |
105 foreach ($barcodeChar as $c) { |
105 foreach ($barcodeChar as $c) { |
106 /* visible, width, top, length */ |
106 /* visible, width, top, length */ |
107 $width = $c ? $this->_barThickWidth : $this->_barThinWidth; |
107 $width = $c ? $this->_barThickWidth : $this->_barThinWidth; |
108 $barcodeTable[] = array(1 , $width , 0 , 1); |
108 $barcodeTable[] = array(1 , $width , 0 , 1); |
109 $barcodeTable[] = array(0 , 1); |
109 $barcodeTable[] = array(0 , $this->_barThinWidth); |
110 } |
110 } |
111 } |
111 } |
112 |
112 |
113 // Stop character (30103) |
113 // Stop character (30103) |
114 $barcodeTable[] = array(1 , $this->_barThickWidth , 0 , 1); |
114 $barcodeTable[] = array(1 , $this->_barThickWidth , 0 , 1); |