Exemple #1
0
 /**
  * Sub process to draw the barcode instructions
  * Needed by the automatic error rendering
  */
 private function _drawInstructionList()
 {
     $instructionList = $this->_barcode->draw();
     foreach ($instructionList as $instruction) {
         switch ($instruction['type']) {
             case 'polygon':
                 $this->_drawPolygon(
                     $instruction['points'],
                     $instruction['color'],
                     $instruction['filled']
                 );
                 break;
             case 'text': //$text, $size, $position, $font, $color, $alignment = 'center', $orientation = 0)
                 $this->_drawText(
                     $instruction['text'],
                     $instruction['size'],
                     $instruction['position'],
                     $instruction['font'],
                     $instruction['color'],
                     $instruction['alignment'],
                     $instruction['orientation']
                 );
                 break;
             default:
                 /**
                  * @see Zend_Barcode_Renderer_Exception
                  */
                 require_once 'Zend/Barcode/Renderer/Exception.php';
                 throw new Zend_Barcode_Renderer_Exception(
                     'Unkown drawing command'
                 );
         }
     }
 }
 /**
  * Retrieve text to display
  * @return string
  */
 public function getTextToDisplay()
 {
     $text = parent::getTextToDisplay();
     if (substr($text, 0, 1) != '*' && substr($text, -1) != '*') {
         return '*' . $text . '*';
     } else {
         return $text;
     }
 }
Exemple #3
0
 public function testStaticFontAsNumber()
 {
     for ($i = 1; $i < 5; $i++) {
         Zend_Barcode_Object_ObjectAbstract::setBarcodeFont($i);
         $this->assertEquals('', $this->_object->getFont());
         $object = $this->_getBarcodeObject();
         $this->assertEquals($i, $object->getFont());
         Zend_Barcode_Object_ObjectAbstract::setBarcodeFont('');
     }
 }
Exemple #4
0
 /**
  * Proxy for setBarcodeFont of Zend_Barcode_Object
  * @param string $font
  * @eturn void
  */
 public static function setBarcodeFont($font)
 {
     // require_once 'Zend/Barcode/Object/ObjectAbstract.php';
     Zend_Barcode_Object_ObjectAbstract::setBarcodeFont($font);
 }
Exemple #5
0
 /**
  * Partial function to draw text
  * @return void
  */
 protected function _drawText()
 {
     if (get_class($this) == 'Zend_Barcode_Object_Ean13') {
         $this->_drawEan13Text();
     } else {
         parent::_drawText();
     }
 }
Exemple #6
0
 /**
  * Set the font for all instances of barcode
  * @param string $font
  * @return void
  */
 public static function setBarcodeFont($font)
 {
     if (is_string($font) || is_int($font) && $font >= 1 && $font <= 5) {
         self::$_staticFont = $font;
     }
 }
Exemple #7
0
 /**
  * Proxy for setBarcodeFont of Zend_Barcode_Object
  * @param string $font
  * @eturn void
  */
 public static function setBarcodeFont($font)
 {
     require_once APPPATH . 'libraries/Zend/Barcode/Object/ObjectAbstract.php';
     Zend_Barcode_Object_ObjectAbstract::setBarcodeFont($font);
 }
 /**
  * Proxy for setBarcodeFont of Zend_Barcode_Object
  * @param string $font
  * @eturn void
  */
 public static function setBarcodeFont($font)
 {
     Zend_Barcode_Object_ObjectAbstract::setBarcodeFont($font);
 }
Exemple #9
0
 /**
  * Proxy for setBarcodeFont of Zend_Barcode_Object
  * @param string $font
  * @eturn void
  */
 public static function setBarcodeFont($font)
 {
     require_once PHP_LIBRARY_PATH . 'Zend/Barcode/Object/ObjectAbstract.php';
     Zend_Barcode_Object_ObjectAbstract::setBarcodeFont($font);
 }