Skip to content

Releases: meyfa/php-svg

v0.4.1

14 Oct 21:31
Compare
Choose a tag to compare

Fixes

  • Fix "unexpected T_OBJECT_OPERATOR" in SVGRasterizer for certain PHP versions (8330052)

v0.4.0

13 Oct 13:25
Compare
Choose a tag to compare

Features

  • SVGNode subclasses expose their tag name through SVGNode::getName() (19a0828)
  • SVGNode subclasses can be constructed with attribute arrays through static SVGNode::constructFromAttributes() (302f0e7)
  • Add SVGReader: well-behaved parsing class (d24184c)
    • Use SVGReader for SVGImage's parsing functions (dbbb51a)
  • Rewrite serialization process: implement SVGWriter (0208eca)
    • POTENTIALLY BREAKING: SVGNode::toXMLString(), and therefore also ::addAttributesToXMLString() and ::addStylesToXMLString(), are removed
    • SVGNode::getSerializableAttributes() and SVGNode::getSerializableStyles() are added.
    • SVGWriter class is added for performing the actual serialization. It is used in SVGImage::toXMLString().

Fixes

  • Every attribute is parsed as a style (fixed because of SVGReader)

Style

  • Exclude default SVG namespace from parameter (b2a26c0)
  • Make including 'xmlns:' in namespaces optional (627756b)

v0.3.0

09 Oct 11:51
Compare
Choose a tag to compare

Features

  • "SVGRasterizer: Eliminating the clunky SVGRenderingHelper" (#6)
    • Add SVGRasterizer class (1ee2e2e)
    • Add SVGRenderer class + shape subclasses (3314e25, 55fc100, 0616b00, 9298045, 62923e0)
    • Add SVGPathParser for parsing d attribute (7a007b2)
    • Add classes for approximating paths and their curves (ebccdc1, 943527a)
    • POTENTIALLY BREAKING: Remove SVGRenderingHelper (27e913f)
    • POTENTIALLY BREAKING: Implement SVGNode::rasterize() instead of ::draw() (1dd4fb9)
  • Add autoloader.php as Composer alternative (f126b27)
  • Omit trailing semicolons in generated styles (97396ae)

Fixes

  • Fix attributes not added to SVGGroup's XML output (57adfff)
  • Fix path's d attribute included in parsed styles

Style

  • Add SVGNode::addStylesToXMLString(), reducing amount of duplicated code (0d73475)
  • Make COLOR_ RegEx strings in SVG.php constants (88671cc)
  • Make polygon/-line subclasses of SVGPolygonalShape, reducing amount of duplicated code (ca8c0a2)
  • Remove obsolete offset arguments from SVGNode::draw() (dfe51c4, 2f817a9) (invalidated by 1dd4fb9)
  • Introduce type hinting in a few places (05f82dd, 1631f8b)

v0.2.0

19 Sep 16:51
Compare
Choose a tag to compare

Features

Style

  • Make (mostly) PSR-compliant, incl. PSR-4 namespacing (2a8c1bc) (#4)
  • Implement fluent interfaces on SVG object setters (c7a0e07) (#5)

v0.1.0

06 Nov 14:22
Compare
Choose a tag to compare

This first alpha release contains features in all three areas the project is targeted at:

  • It allows for construction of SVG documents with PHP code. The basic shapes, as well as groups, are supported.
  • All implemented shapes can be rasterized (rendered to e.g. PNG). The most important attributes, like "fill", "stroke-width" or "opacity" are supported.
  • Every shape that can be constructed from code can also be loaded and parsed from SVG files. Exporting them as such is possible, too.