Description
The libbsvg is a native SVG-Library that is written to make use of all the native drawing code of the BeOS. It provides a BView derived BSVGView class that handles all the SVG stuff (including loading of files or attributes) that can be placed on any BWindow or any other BView. This enables you to integrate SVG-Graphics into your applications very easily. Please note that it is called "libbsvg" with a double "b" to underline it's nativeness.
Concept
I have _not_ reinvented the wheel and do _not_ render anything by newly created functions. All the SVG-Path's and SVG-Shape's are converted to BShapes and are rendered into BViews or BBitmaps using the app_server. That's what I wanted to say with "native". So what this library does is providing the conversion from XML-SVG-Data to native Be objects like BShapes and back.
The gradients are also rendered by the app_server using either BeginLineArray() (for linear gradients) or StrokeEllipse() (for radial gradients). The drawing functions make it possible to build SVG-Graphics on the fly and the export function enable you to save that new graphic as a SVG-File.
Status
The library is in the late early beta state. It should be complete enough for everyday use and it is enough to render the BeOS SVG-Iconset from Matthew McClintock.
You can find the latest version in the forum.
It provides support for (work in progress version):
- Loading SVG from files, attributes or BPositionIO's
- All path commands of SVG 1.1
- All basic shapes of the SVG 1.1 specification
- The use-element of SVG 1.1
- Coordinate system transformations (rotate, translate, scale, ...)
- Filling and stroking including fillrules but without marker symbols
- Inherited styles and CSS
- Support for colors in hex ("#00FF00" or "#0F0"), functional notation ("rgb(0, 255, 0)" or "rgb(0%, 100%, 0%)") and keywords ("green")
- Linear and radial gradients (limited transformations)
- Antialiasing using weighted supersampling (2x, 3x, 4x and 5x supported)
- Basic Text support
- On-the-Fly creation of SVG-Graphics
- Exporting the displayed graphic to a svg+xml document
What is still missing:
- Patterns
- Clipping, masking and compositing
- Embeded graphics (SVG and Bitmap)
- Filter effects
- Hyperlinks
What will currently not be supported:
- Any kind of animation and interactivity
- Scripting
This is due to it beeing a static renderer. Support for these features may be included in the future, but first the missing stuff has priority...
Screenshots
Screenshots of all the components of the SVG-Pack are here.
Readme
You can also take a look at a preliminary readme that explains the library and license in more detail.
Tutorial
A small Tutorial on how to write an application that uses a BSVGView can be found in the forum
Comments
You can place comments, ask questions or discuss about my BeOS projects at the forum.
Resources
If you want to learn more about SVG and SVG 1.1 take a look at the W3C Recommendation.