コード例 #1
0
ファイル: Ean13.php プロジェクト: rafsalvioni/zeus-barcode
 /**
  * Draw a text specifically to Ean13.
  * 
  * @param RendererInterface $renderer
  */
 protected function drawText(RendererInterface &$renderer)
 {
     $text = $this->getData();
     $text = [$text[0], \substr($text, 1, 6), \substr($text, 7)];
     $foreColor =& $this->options['forecolor'];
     $font =& $this->options['font'];
     $fontSize =& $this->options['fontsize'];
     $barWidth =& $this->options['barwidth'];
     $offX = $this->getContentOffsetLeft() + 1;
     $y = $this->getTextY();
     $x = $offX - 3;
     $renderer->drawText([$x, $y], $text[0], $foreColor, $font, $fontSize, 'right');
     $x += 3 + $barWidth * 24;
     $renderer->drawText([$x, $y], $text[1], $foreColor, $font, $fontSize, 'center');
     $x += $barWidth * 46;
     $renderer->drawText([$x, $y], $text[2], $foreColor, $font, $fontSize, 'center');
 }
コード例 #2
0
 /**
  * Draws the barcode text.
  * 
  * @param Renderer\RendererInterface $renderer
  */
 protected function drawText(Renderer\RendererInterface &$renderer)
 {
     $text = $this->getDataToDisplay();
     $x = $this->getTextX();
     $y = $this->getTextY();
     $renderer->drawText([$x, $y], $text, $this->options['forecolor'], $this->options['font'], $this->options['fontsize'], $this->options['textalign']);
 }
コード例 #3
0
ファイル: Upca.php プロジェクト: rafsalvioni/zeus-barcode
 /**
  * Draw a text specifically to Upca.
  * 
  * @param RendererInterface $renderer
  */
 protected function drawText(RendererInterface &$renderer)
 {
     $text = $this->getData();
     $text = [$text[0], \substr($text, 1, 5), \substr($text, 6, 5), \substr($text, -1)];
     $foreColor =& $this->options['forecolor'];
     $font =& $this->options['font'];
     $fontSize =& $this->options['fontsize'];
     $barWidth =& $this->options['barwidth'];
     $fontSize2 = \floor(\max($fontSize * 0.8, 1));
     $offX = $this->getContentOffsetLeft();
     $y = $this->getTextY();
     $x = $offX - 1;
     $renderer->drawText([$x, $y], $text[0], $foreColor, $font, $fontSize2, 'right');
     $x = $offX + $barWidth * 24;
     $renderer->drawText([$x, $y], $text[1], $foreColor, $font, $fontSize, 'center');
     $x += $barWidth * 47;
     $renderer->drawText([$x, $y], $text[2], $foreColor, $font, $fontSize, 'center');
     $x += $barWidth * 24;
     $renderer->drawText([$x, $y], $text[3], $foreColor, $font, $fontSize2, 'left');
 }