/** * (non-PHPdoc) * @see Imagine\Image\FontInterface::box() */ public function box($string, $angle = 0) { $text = new \GmagickDraw(); $text->setfont($this->file); $text->setfontsize($this->size); $text->setfontstyle(\Gmagick::STYLE_OBLIQUE); $info = $this->gmagick->queryfontmetrics($text, $string); $box = new Box($info['textWidth'], $info['textHeight']); return $box; }
/** * {@inheritdoc} */ public function box($string, $angle = 0) { $text = new \GmagickDraw(); $text->setfont($this->file); /** * @see http://www.php.net/manual/en/imagick.queryfontmetrics.php#101027 * * ensure font resolution is the same as GD's hard-coded 96 */ $text->setfontsize((int) ($this->size * (96 / 72))); $text->setfontstyle(\Gmagick::STYLE_OBLIQUE); $info = $this->gmagick->queryfontmetrics($text, $string); $box = new Box($info['textWidth'], $info['textHeight']); return $box; }