예제 #1
0
 /**
  * (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;
 }
예제 #2
0
파일: Font.php 프로젝트: ccq18/EduSoho
 /**
  * {@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;
 }