Major update of Ab2d.ReaderSvg brings better support for css styles and more

by abenedik 6. November 2018 17:00

I am happy to inform you that a new major version of Ab2d.ReaderSvg was just published.

The new version has a significantly better support for reading css styles. The new version of the Ab2d.ReaderSvg can now correctly read a css text with multiple class name definitions in one line. Also adding additional properties to already defined class names is now supported. Those two features are required to correctly read the following css definition:

.A, .B { fill: green; } 

.A { stroke: green; }

This update should greatly improve reading css styles from svg files. But because css styles can be incredibly complex, there are still cases that are not supported. Luckily, the main tools that can save to svg files usually do not use such complex css styles and therefore Ab2d.ReaderSvg should be able to read almost all the files.

 

An important new feature is also that ReaderSvg class now has two new delegates: BeforeWpfObjectCreatedCallback and AfterWpfObjectCreatedCallback. The first delegate is called before ReaderSvg creates a WPF object from the svg element. The delegate gets the xml text that is used to define the element. It can be used to create your own WPF object from the xml and pass that back to ReaderSvg. The other delegate is called after the WPF object is created by ReaderSvg. It gets the created WPF object and the xml text. This delegate can be used to read some additional properties from the xml and decorate or change the already created WPF object.

There are also some other improvements and fixes. The whole list can be seen on ReaderSvg versions history web page.

 

This shows that though the main focus of the AB4D company is on developing components for 3D visualization, the 2D tools and importers are still fully supported - most of the updates are based on the great feedback from the customers. So, if you get a svg file that is not correctly imported or you have a good feature request, please send me the svg file or a feature request.

Tags:

ReaderSvg