# SVG++ documentation

## About

SVG++ library can be thought of as a framework, containing parsers for various SVG syntaxes, adapters that simplify handling of parsed data and a lot of other utilities and helpers for the most common tasks. Take a look at Tutorial to get the idea about what it is. Library sources available at https://github.com/svgpp/svgpp.

SVG++ features

- Is a header-only library

- Can be used with any XML parser

- Compile time configured - no virtual functions

- Minimal runtime overhead - you pay only for what you get

- Has wide range of possible uses:

  - Fully functional, conforming SVG viewers

  - Simple in-app SVG rasterizers

  - Import modules of vector editing software

  - Implementing path-only input of SVG format with minimal efforts in any graphics or math software

- Requires only Boost library itself (demo, tests and sample have their own requirements)

- Compatible with C++03, but requires conforming implementation, due to heavy usage of templates

- Supports any character type (char and wchar_t). Other (Unicode from C++11) were not tested, but should be ok.

SVG 1.1 features covered by SVG++

- Path data - parsing, simplification

- Transform list - parsing, simplification

- Color, including ICC color - parsing

- Lengths - highly configurable handling of SVG lengths, full support of all SVG length units

- Basic shapes - optional conversion to path

- Style attribute - parsing, taking in account differences in parsing presentation attributes and style properties

- Automatic marker positions calculation

- Viewport and viewbox handling

SVG++ is NOT

- An SVG viewer or library that produces raster image from SVG (though C++ demo app included, which renders SVG with AGG, GDI+ or Skia graphics library)

- Renders anything itself

Contents

- Installation
- Tutorial
  - Handling Shapes Geometry
  - XML Parser
  - Handling Transformations
  - Handling Viewports
  - Creating Contexts
  - The use Element Support
  - Calculating Marker Positions
  - Processing of stroke and stroke-width Properties
  - Custom Color Factory
  - Correct Length Handling
  - Text Handling
- Library Organization
  - Context
  - Components
  - Tags
  - Named Class Template Parameters
  - Library Customization
  - XML Parser
  - Strings
  - CSS Support
- Library Reference
  - Document Traversal
  - How parsed values are passed to context
  - Length
  - Transform
  - Path
  - Basic Shapes
  - Color
  - Error handling
  - IRI
  - Markers
  - Viewport
  - Character Data
- Advanced Topics
  - Adding new XML parser
  - Value Parsers
- FAQ
  - Compiler error: “Too many template arguments for class template ‘document_traversal’”
  - SVG++ stops parsing on incorrect attribute value and throws exception
  - Compiler is out of memory or compilation takes too long
- Licensing
- Help and Feedback
- Acknowledgements