public function measureText($text) { if (self::DEBUG) { echo __FUNCTION__ . "\n"; } $style = $this->getStyle(); $font = $this->getFont($style->fontFamily, $style->fontStyle); return $this->canvas->stringwidth($text, $font, $this->getStyle()->fontSize); }