diff --git a/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Gradient/Stop.php b/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Gradient/Stop.php new file mode 100644 index 000000000..531d0bde6 --- /dev/null +++ b/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Gradient/Stop.php @@ -0,0 +1,16 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace Svg\Gradient; + +class Stop +{ + public $offset; + public $color; + public $opacity = 1.0; +} \ No newline at end of file diff --git a/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Tag/ClipPath.php b/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Tag/ClipPath.php new file mode 100644 index 000000000..76599fd4e --- /dev/null +++ b/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Tag/ClipPath.php @@ -0,0 +1,33 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace Svg\Tag; + +use Svg\Style; + +class ClipPath extends AbstractTag +{ + protected function before($attributes) + { + $surface = $this->document->getSurface(); + + $surface->save(); + + $style = $this->makeStyle($attributes); + + $this->setStyle($style); + $surface->setStyle($style); + + $this->applyTransform($attributes); + } + + protected function after() + { + $this->document->getSurface()->restore(); + } +} \ No newline at end of file diff --git a/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Tag/StyleTag.php b/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Tag/StyleTag.php new file mode 100644 index 000000000..a26562d82 --- /dev/null +++ b/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Tag/StyleTag.php @@ -0,0 +1,27 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace Svg\Tag; + +use Sabberworm\CSS; + +class StyleTag extends AbstractTag +{ + protected $text = ""; + + public function end() + { + $parser = new CSS\Parser($this->text); + $this->document->appendStyleSheet($parser->parse()); + } + + public function appendText($text) + { + $this->text .= $text; + } +} \ No newline at end of file diff --git a/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Tag/UseTag.php b/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Tag/UseTag.php new file mode 100644 index 000000000..442cb6e45 --- /dev/null +++ b/library/vendor/dompdf/lib/php-svg-lib/src/Svg/Tag/UseTag.php @@ -0,0 +1,96 @@ + + * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License + */ + +namespace Svg\Tag; + +class UseTag extends AbstractTag +{ + protected $x = 0; + protected $y = 0; + protected $width; + protected $height; + + /** @var AbstractTag */ + protected $reference; + + protected function before($attributes) + { + if (isset($attributes['x'])) { + $this->x = $attributes['x']; + } + if (isset($attributes['y'])) { + $this->y = $attributes['y']; + } + + if (isset($attributes['width'])) { + $this->width = $attributes['width']; + } + if (isset($attributes['height'])) { + $this->height = $attributes['height']; + } + + parent::before($attributes); + + $document = $this->getDocument(); + + $link = $attributes["xlink:href"]; + $this->reference = $document->getDef($link); + + if ($this->reference) { + $this->reference->before($attributes); + } + + $surface = $document->getSurface(); + $surface->save(); + + $surface->translate($this->x, $this->y); + } + + protected function after() { + parent::after(); + + if ($this->reference) { + $this->reference->after(); + } + + $this->getDocument()->getSurface()->restore(); + } + + public function handle($attributes) + { + parent::handle($attributes); + + if (!$this->reference) { + return; + } + + $attributes = array_merge($this->reference->attributes, $attributes); + + $this->reference->handle($attributes); + + foreach ($this->reference->children as $_child) { + $_attributes = array_merge($_child->attributes, $attributes); + $_child->handle($_attributes); + } + } + + public function handleEnd() + { + parent::handleEnd(); + + if (!$this->reference) { + return; + } + + $this->reference->handleEnd(); + + foreach ($this->reference->children as $_child) { + $_child->handleEnd(); + } + } +} \ No newline at end of file