Skip to content

Commit

Permalink
add setShowText to interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemorroj committed Dec 12, 2015
1 parent d1a2e2f commit 98be6c5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions Image/Barcode2/Driver.php
Expand Up @@ -68,4 +68,13 @@ public function setBarcode($barcode);
* @throws Image_Barcode2_Exception
*/
public function validate();

/**
* Set if text will be placed under the barcode
*
* @param boolean $showText The text should be placed under barcode
*
* @return void
*/
public function setShowText($showText);
}
6 changes: 3 additions & 3 deletions Image/Barcode2/Driver/Code39.php
Expand Up @@ -143,11 +143,11 @@ public function draw()
$barcode = '';
foreach (str_split($final_text) as $character) {
$prefix = '';
if($character > 'a' && $character < 'z'){
$prefix+=$this->_codingmap['+'].'0';
if ($character > 'a' && $character < 'z') {
$prefix += $this->_codingmap['+'] . '0';
$character = strtoupper($character);
}
$barcode .= $this->_dumpCode($prefix.$this->_codingmap[$character] . '0');
$barcode .= $this->_dumpCode($prefix . $this->_codingmap[$character] . '0');
}

$barcode_len = strlen($barcode);
Expand Down

0 comments on commit 98be6c5

Please sign in to comment.