Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/Zend/Barcode/Object/AbstractObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ protected function rotate($x1, $y1)
$y2 = $y1 * cos($this->orientation / 180 * pi())
+ $x1 * sin($this->orientation / 180 * pi())
+ $this->getOffsetTop();
return array(intval($x2) , intval($y2));
return array(intval($x2), intval($y2));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Barcode/Object/Codabar.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ protected function prepareBarcode()
$barcodeChar = str_split($this->codingMap[$char]);
foreach ($barcodeChar as $c) {
// visible, width, top, length
$barcodeTable[] = array($c , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array($c, $this->barThinWidth, 0, 1);
}
$barcodeTable[] = array(0 , $this->barThinWidth);
$barcodeTable[] = array(0, $this->barThinWidth);
}
return $barcodeTable;
}
Expand Down
26 changes: 13 additions & 13 deletions library/Zend/Barcode/Object/Code25.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,30 @@ protected function prepareBarcode()
$barcodeTable = array();

// Start character (30301)
$barcodeTable[] = array(1 , $this->barThickWidth , 0 , 1);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1 , $this->barThickWidth , 0 , 1);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(0 , $this->barThinWidth);
$barcodeTable[] = array(1, $this->barThickWidth, 0, 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThickWidth, 0, 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(0, $this->barThinWidth);

$text = str_split($this->getText());
foreach ($text as $char) {
$barcodeChar = str_split($this->codingMap[$char]);
foreach ($barcodeChar as $c) {
/* visible, width, top, length */
$width = $c ? $this->barThickWidth : $this->barThinWidth;
$barcodeTable[] = array(1 , $width , 0 , 1);
$barcodeTable[] = array(0 , $this->barThinWidth);
$barcodeTable[] = array(1, $width, 0, 1);
$barcodeTable[] = array(0, $this->barThinWidth);
}
}

// Stop character (30103)
$barcodeTable[] = array(1 , $this->barThickWidth , 0 , 1);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1 , $this->barThickWidth , 0 , 1);
$barcodeTable[] = array(1, $this->barThickWidth, 0, 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThickWidth, 0, 1);
return $barcodeTable;
}

Expand Down
8 changes: 4 additions & 4 deletions library/Zend/Barcode/Object/Code25interleaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ protected function prepareBarcode()
$barWidth = (substr($this->codingMap[$char2], $ibar, 1))
? $this->barThickWidth
: $this->barThinWidth;
$barcodeTable[] = array(0, $barWidth, 0 , 1);
$barcodeTable[] = array(0, $barWidth, 0, 1);
}
}

// Stop character (100)
$barcodeTable[] = array(1 , $this->barThickWidth, 0, 1);
$barcodeTable[] = array(0 , $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1 , $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThickWidth, 0, 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
return $barcodeTable;
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Barcode/Object/Code39.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected function prepareBarcode()
$barcodeTable[] = array((int) $visible, $width, 0, 1);
$visible = ! $visible;
}
$barcodeTable[] = array(0 , $this->barThinWidth);
$barcodeTable[] = array(0, $this->barThinWidth);
}
return $barcodeTable;
}
Expand Down
26 changes: 13 additions & 13 deletions library/Zend/Barcode/Object/Ean13.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ protected function prepareBarcode()
$height = ($this->drawText) ? 1.1 : 1;

// Start character (101)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);

$textTable = str_split($this->getText());
$parity = $this->parities[$textTable[0]];
Expand All @@ -101,29 +101,29 @@ protected function prepareBarcode()
for ($i = 1; $i < 7; $i++) {
$bars = str_split($this->codingMap[$parity[$i - 1]][$textTable[$i]]);
foreach ($bars as $b) {
$barcodeTable[] = array($b , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array($b, $this->barThinWidth, 0, 1);
}
}

// Middle character (01010)
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);

// Second part
for ($i = 7; $i < 13; $i++) {
$bars = str_split($this->codingMap['C'][$textTable[$i]]);
foreach ($bars as $b) {
$barcodeTable[] = array($b , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array($b, $this->barThinWidth, 0, 1);
}
}

// Stop character (101)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
return $barcodeTable;
}

Expand Down
16 changes: 8 additions & 8 deletions library/Zend/Barcode/Object/Ean5.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ protected function prepareBarcode()
$barcodeTable = array();

// Start character (01011)
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);

$firstCharacter = true;
$textTable = str_split($this->getText());
Expand All @@ -74,12 +74,12 @@ protected function prepareBarcode()
$firstCharacter = false;
} else {
// Intermediate character (01)
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
}
$bars = str_split($this->codingMap[$this->getParity($i)][$textTable[$i]]);
foreach ($bars as $b) {
$barcodeTable[] = array($b , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array($b, $this->barThinWidth, 0, 1);
}
}

Expand Down
26 changes: 13 additions & 13 deletions library/Zend/Barcode/Object/Ean8.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,39 +51,39 @@ protected function prepareBarcode()
$height = ($this->drawText) ? 1.1 : 1;

// Start character (101)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);

$textTable = str_split($this->getText());

// First part
for ($i = 0; $i < 4; $i++) {
$bars = str_split($this->codingMap['A'][$textTable[$i]]);
foreach ($bars as $b) {
$barcodeTable[] = array($b , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array($b, $this->barThinWidth, 0, 1);
}
}

// Middle character (01010)
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);

// Second part
for ($i = 4; $i < 8; $i++) {
$bars = str_split($this->codingMap['C'][$textTable[$i]]);
foreach ($bars as $b) {
$barcodeTable[] = array($b , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array($b, $this->barThinWidth, 0, 1);
}
}

// Stop character (101)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
return $barcodeTable;
}

Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Barcode/Object/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public function getWidth($recalculate = false)
public function draw()
{
$this->instructions = array();
$this->addText('ERROR:', 10, array(5 , 18), $this->font, 0, 'left');
$this->addText($this->text, 10, array(5 , 32), $this->font, 0, 'left');
$this->addText('ERROR:', 10, array(5, 18), $this->font, 0, 'left');
$this->addText($this->text, 10, array(5, 32), $this->font, 0, 'left');
return $this->instructions;
}

Expand Down
10 changes: 5 additions & 5 deletions library/Zend/Barcode/Object/Postnet.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ protected function prepareBarcode()
$barcodeTable = array();

// Start character (1)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);

// Text to encode
$textTable = str_split($this->getText());
foreach ($textTable as $char) {
$bars = str_split($this->codingMap[$char]);
foreach ($bars as $b) {
$barcodeTable[] = array(1 , $this->barThinWidth , 0.5 - $b * 0.5 , 1);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0.5 - $b * 0.5, 1);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
}
}

// Stop character (1)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
return $barcodeTable;
}

Expand Down
10 changes: 5 additions & 5 deletions library/Zend/Barcode/Object/Royalmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,21 @@ protected function prepareBarcode()
$barcodeTable = array();

// Start character (1)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 5/8);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 5/8);
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);

// Text to encode
$textTable = str_split($this->getText());
foreach ($textTable as $char) {
$bars = str_split($this->codingMap[$char]);
foreach ($bars as $b) {
$barcodeTable[] = array(1 , $this->barThinWidth , ($b > 1 ? 3/8 : 0) , ($b % 2 ? 5/8 : 1));
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1, $this->barThinWidth, ($b > 1 ? 3/8 : 0), ($b % 2 ? 5/8 : 1));
$barcodeTable[] = array(0, $this->barThinWidth, 0, 1);
}
}

// Stop character (1)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array(1, $this->barThinWidth, 0, 1);
return $barcodeTable;
}

Expand Down
30 changes: 15 additions & 15 deletions library/Zend/Barcode/Object/Upca.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,51 +50,51 @@ protected function prepareBarcode()
$height = ($this->drawText) ? 1.1 : 1;

// Start character (101)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);

$textTable = str_split($this->getText());

// First character
$bars = str_split($this->codingMap['A'][$textTable[0]]);
foreach ($bars as $b) {
$barcodeTable[] = array($b , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array($b, $this->barThinWidth, 0, $height);
}

// First part
for ($i = 1; $i < 6; $i++) {
$bars = str_split($this->codingMap['A'][$textTable[$i]]);
foreach ($bars as $b) {
$barcodeTable[] = array($b , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array($b, $this->barThinWidth, 0, 1);
}
}

// Middle character (01010)
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);

// Second part
for ($i = 6; $i < 11; $i++) {
$bars = str_split($this->codingMap['C'][$textTable[$i]]);
foreach ($bars as $b) {
$barcodeTable[] = array($b , $this->barThinWidth , 0 , 1);
$barcodeTable[] = array($b, $this->barThinWidth, 0, 1);
}
}

// Last character
$bars = str_split($this->codingMap['C'][$textTable[11]]);
foreach ($bars as $b) {
$barcodeTable[] = array($b , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array($b, $this->barThinWidth, 0, $height);
}

// Stop character (101)
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(0 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1 , $this->barThinWidth , 0 , $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(0, $this->barThinWidth, 0, $height);
$barcodeTable[] = array(1, $this->barThinWidth, 0, $height);
return $barcodeTable;
}

Expand Down
Loading