setText($text); $this->textfont = $textfont; $this->a1 = $a1; } /** * Saves Text * * @param string $text */ public function setText($text) { $this->text = $text; } /** * Draws the barcode * * @param ressource $im */ public function draw($im) { $this->DrawChar($im,$this->text,1); $this->lastX = $this->positionX; $this->lastY = $this->maxHeight; $this->DrawText($im); } /** * Overloaded method for drawing special label * * @param ressource $im */ protected function DrawText($im) { if($this->textfont != 0 && $this->a1!='') { $bar_color = (is_null($this->color1))?NULL:$this->color1->allocate($im); if(!is_null($bar_color)) { $xPosition = ($this->positionX / 2) - (strlen($this->a1)/2)*imagefontwidth($this->textfont); $text_color = (is_null($this->color1))?NULL:$this->color1->allocate($im); imagestring($im,$this->textfont,$xPosition,$this->maxHeight,$this->a1,$text_color); } $this->lastY = $this->maxHeight + imagefontheight($this->textfont); } } }; ?>