__renderText($text, 48, "headlines", 3, array(1,0,-4,0)); } function renderSub($text, $maxWidth = 270) { return $this->__renderText($text, 24, "subheadlines", 5, array(0,0,-4,0), $maxWidth); } function renderSmall($text, $maxWidth = 270) { $this->TextImage->linespacing = 1; return $this->__renderText($text, 14, "small_text", 5, array(0,0,0,0), $maxWidth); } function __renderText($text, $ps, $dir, $softenFactor, $margins, $maxWidth = FULL_WIDTH) { $this->TextImage->setImageDirectory("dynimg/$dir/"); $this->TextImage->fontFile = 'myFont.ttf'; $this->TextImage->softenFactor = $softenFactor; $this->TextImage->setPointSize($ps); $this->TextImage->setColor(333333); $this->TextImage->setPadding($margins[0], $margins[1],$margins[2],$margins[3]); return $this->TextImage->image($text, $maxWidth); } }