protected function createDocument() { parent::createDocument(); $svg = $this->dom->getElementsByTagName('svg')->item(0); $svg->setAttribute('viewBox', '0 0 ' . $this->options->width . ' ' . $this->options->height); if (!$this->percent) { $svg->removeAttribute('width'); $svg->removeAttribute('height'); } else { $svg->setAttribute('width', $this->percent); $svg->setAttribute('height', $this->percent); } }
public function testISO_8859_15SpecialCharsSVG() { $filename = $this->tempDir . __FUNCTION__ . '.svg'; $driver = new ezcGraphSvgDriver(); $driver->options->width = 200; $driver->options->height = 100; $driver->options->encoding = 'ISO-8859-15'; $driver->drawPolygon(array(new ezcGraphCoordinate(10, 10), new ezcGraphCoordinate(160, 10), new ezcGraphCoordinate(160, 80), new ezcGraphCoordinate(10, 80)), ezcGraphColor::fromHex('#eeeeec'), true); $driver->drawTextBox(iconv('UTF-8', 'ISO-8859-15', 'öäüÖÄÜß'), new ezcGraphCoordinate(10, 10), 150, 70, ezcGraph::LEFT); $driver->render($filename); $this->compare($filename, $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'); }