Beispiel #1
0
 /**
  * Get a text from the labele
  *
  * @param mixed $key Key in the array text
  * @return Text
  */
 public function getText($key)
 {
     if (is_array($this->texts) and array_key_exists($key, $this->texts)) {
         $value = $this->texts[$key];
         if (is_string($this->function)) {
             $value = call_user_func($this->function, $value);
         }
         $text = new awText($value);
         $text->setFont($this->font);
         $text->setAngle($this->angle);
         $text->setColor($this->color);
         if ($this->background instanceof awColor) {
             $text->setBackgroundColor($this->background);
         } else {
             if ($this->background instanceof awGradient) {
                 $text->setBackgroundGradient($this->background);
             }
         }
         $text->border = $this->border;
         if ($this->padding !== NULL) {
             call_user_func_array(array($text, 'setPadding'), $this->padding);
         }
         return $text;
     } else {
         return NULL;
     }
 }