4 * @link http://github.com/PhenX/php-svg-lib
5 * @author Fabien Ménager <fabien.menager@gmail.com>
6 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
11 class Text
extends Shape
17 public function start($attribs)
19 $document = $this->document
;
20 $height = $this->document
->getHeight();
23 if (isset($attribs['x'])) {
24 $this->x
= $attribs['x'];
26 if (isset($attribs['y'])) {
27 $this->y
= $height - $attribs['y'];
30 $document->getSurface()->transform(1, 0, 0, -1, 0, $height);
35 $surface = $this->document
->getSurface();
39 if ($surface->getStyle()->textAnchor
== "middle") {
40 $width = $surface->measureText($this->text
);
44 $surface->fillText($this->text
, $x, $y);
47 protected function after()
49 $this->document
->getSurface()->restore();
52 public function appendText($text)