Change log

Version 2.3 update 5, 7-3-2020

Added the Aggpas rendercontext option to FPC/Freepascal. If CWBudde/AggPasMod does not compile, try the forked version BVerhue/AggPasMod.

Fixed a SVG control sizing problem in the FPC/Lazarus SVGViewer application

Version 2.3 update 4, 22-2-2020


In this update the SVG components and controls are upgraded. This means that some properties are added or deleted or changed, which will give warnings when you update the SVG control packages and then open your project in the Delphi or Lazarus IDE. You should therefore make a backup of your application source including your previous version of the SVG package before upgrading.

In principle all warnings about changed properties should be accepted. When you have used the FMX (Firemonkey) version of the TSVG2ImageList from version XE8 onwards, the SVG info will be lost and you have to import the SVG’s again after upgrading. The TSVG2ImageList for VCL and FPC/Lazarus will give warnings but will be o.k. if you accept all warnings.

Other changes:

Fixed an error in the TSVGBaseBitmap.CopyFrom method. The destination rectangle was not calculated correctly which resulted in an incomplete copy.

Fixed a problem in font selection. Sometimes text was not displayed because the font was not found locally on the system. Now more fall back fonts are defined for Windows, OsX and Linus platforms.

Fixed an error in the lighting filters which caused an exception on freeing the root.

Fixed an error in the box-blur algorithm that could cause an exception.

Version 2.3 update 3, 8-12-2019

Fixed problem with embedded raster graphics if the type (png, bmp etc.) is not explicitly mentioned in the mime type. The package will attempt to determine the type from the raw data.

Fixed a problem with temporary bitmaps of zero size in Direct2D and Aggpas render context which threw exception errors.

Fixed an error with anchoring text on a path.

Fixed an error with calculating the source graphic rectangle for SVG graphics with filters.

Fixed an error with calculating the bounding rectangle for non outer SVG elements.

Version 2.3 update 2, 31-10-2019

– Fixed error “Object state out of sync”. This happened if the DOM structure state changed between rendering. The fix is that the ObjectStateTree is invalidated (ObjectStateInvalid = TRUE) if an element is added or deleted or a href attribute is changed. ObjectStateInvalid = TRUE will cause a rebuild of the ObjectStateTree on the next rendering if sroEvents is included in the options.

– Fixed error with DPI scaling for render context Direct2D and GDI+. If the monitor is set on a higher DPI scale before the applications was started the SVG image was rendered too big. Reason was an incorrect DPI setting for these render contexts which caused a doubling of the scale.

– Fixed an cause for a compiler error in XE2 (URW1147 caused by a call to Finalyze on a TBytes object) in BVE.SVG2FontGDI.pas

Version 2.3 update 1, 21-9-2019

Fixed an issue with thread safety on FPC/Lazarus
Fixed some issues with font selection
Fixed an issue with placing glyphs on a path
Fixed an issue with rendering png files on Quartz, the target needed to be cleared first.

Version 2.3, 9-9-2019

Added support for FPC/Lazarus, supported platforms are now:
– Delphi VCL
– Delphi FMX
– Freepascal with Lazarus

Changes to render contexts (RC’s):

Added RC Quartz
– for Delphi FMX only
– Limitations:
– Spread method on gradients not supported

Added RC BGRABitmap
– for FPC/Lazarus only
– Limitations:
– Spread method on gradients not supported

Added RC Direct2D (3D11) (DirectX version 11) to existing Direct2D (WIC)
– for Delphi VCL, Delphi FMX, FPC/Lazarus
– Hardware acceleration (3D11)

Updated RC Windows GDI+
– For Delphi VCL, FMX
– Limitations
– Radial gradient is not rendered correctly

Added RC Graphics32
– For Delphi VCL, FPC/Lazarus

Updated RC Aggpas
– For Delphi VCL, FMX

Separated RenderContext’s and text rendering. For text rendering of system fonts and SVG fonts the following interfaces are added:

– for Windows

– for legacy Windows

– for Mac, iOS

– for Windows, Mac, Linux (freetype.dll needs to be installed)

– Full rewrite of the SVG library:

Based all element and attribute interfaces on IXMLNode.
Integrated the SVG parser so it can be used to build the DOM but also extend/change the DOM after building or set attributes.
Replaced the text rendering algorithm, added support for bidirectional text, text-decoration for SVG fonts and system fonts for RC that support BIDI.

property “DownSampleFactor” was removed from the FMX controls.

Changed the license to subscription.

– There is a one time fee on purchase of a license and a yearly fee for upgrades and support.
– Owners of a v2.2 license can upgrade to v2.3 and only need to pay the subscription fee.

Version 2.2 update 13, 8-12-2018

Fixed bug, TSVG2ImageList.VCL ClearColor attribute was lost after closing/loading project

Fixed bug, BeginUpdate/EndUpdate didn’t work propertly in TSVG2ImageList.VCL

Fixed bug, XML Reader Eval function failed if close to buffer end

Created project files and package files for Delphi DX3 Rio

Improved functionality for finding SVG elements by coordinates, for SVG mouse events and ObjectAt function.

Added ChangeScale overrides to VCL SVG controls for support of DPI and monitor scale settings

Added High DPI support to the viewer demo application for VCL for DX (Seattle) and higher

Created a new viewer demo application for FMX for XE8 and higher

Removed the SVGBrowser and SVGToRaster demo apps

Version 2.2 update 12, 1-8-2018

Fixed typo in TSVGMask assign

Fixed bug, group opacity was not applied on use elements

Fixed bug, if illegal char in path, parser should finish the path without error messages.

New license terms for licenses bought after 1-8-2018

Version 2.2 update 11, 24-6-2018

Added “AspectRatioAlign” and “AspectRatioMeetOrSlice” properties on the SVG controls. Together with the “AuotViewbox” property these control the aspect ratio of the SVG graphic within the control.

Added support for the “fill-rule” and “clip-rule” presentational attributes. This is supported by Direct2D and Aggpas render contexts, but not by the FMX render context and the GDi+ render context.

Added support for decimal and hexadecimal entity parsing in BVE.SVG2XMLReader.pas

Added support for downloading external resources from internet, this must be enabled by define “InternetAccess” in

Improved parsing speed of path elements with about 30%

Changed implementation of ISVGRenderBuffer for improved support for bitmap operations on rotated elements

Changed bitmap buffers for BVE.SVG2Control.FMX.pas, BVE.SVG2Image.FMX.pas to support screen scale other than 1 (iOS)

Changed behaviour of unsupported float values (null) of element parameters in BVE.SVG2SaxParser.pas and BVE.SVG2PathData.pas, in case of an unsupported value the default value of the attribute will be used.

Fixes a bug on the FMX controls, opacity property was broken

Fixed a bug in SVGControl (VCL and FMX) that caused an access violation if the bitmap buffer is zero size due to clipping.

Fixed a bug “bus error” on Android, caused by “packed” directive on the TSVGPathPoint record

Fixed a bug which could cause an access violation on the specular light filter, because of bitmap buffer size mismatch

Fixed a bug which could cause clipPaths not being rendered correctly in case of nested clipPaths

Fixed a bug which caused opacity attribute not being rendered correctly on gradients by Aggpas render context.

Version 2.2 update 10, 4-4-2018

Fixed bug: Internal search on element id was case-insensitive.

Fixed bug: Opacity was applied double on radial and linear gradient in the render context implementation for Direct2D

Fixed bug: Temporary bitmap buffers where not always pixel aligned with target bitmap, which resulted in color shift on edges of for example clippath.

Version 2.2 update 9, 30-1-2018

Fixed a bug that could lead to parsing errors if the US decimal point format settings are changed on the user’s pc.

Fixed a bug in the TSVG2ImageList which led to small artefacts being visible in the rendered images of the image list. The problem was that the bitmaps where added premultiplied to the list, they should first be unpremultiplied.

Added parameter “PreserveContentBitmap” to the SVGRenderToBitmap function in unit BVE.SVG2Elements.VCL. If set to TRUE, the bitmap will not be cleared (with alpha black = $00000000), but the SVG graphic will be drawn on top of the existing bitmap content. This parameter is set to a default value of FALSE.
The TSVG2ImageList object will initialize a bitmap with the clear colour and then call this function with the parameter set to TRUE, so the clear colour is preserved.

Version 2.2 update 8, 6-12-2017

Fixed bug in sax parser, first node is not cleared from NodeStack, which resulted in big memory consumption on repeated parsing (random star example)

Fixed bug in triggering text event, bug in character cell bounds calculation

Fixed a bug, introduced in Update 7, if windows system DPI is changed, the SVG rendering scale was not correct.

On some Windows systems the Direct2D DC rendering does not work, resulting in black bitmaps. I replaced the DC rendering target with a WIC rendering target, which was already used but only for intermediate buffers.

Fixed a bug, if an Base64 encoded embedded SVG image contains Linefeed characters (#10), this would result in a image decoding error. This is solved by adding #10 to the entity list of the XML reader in BVE.SVG2XMLReader.pas

Added support for complex font-face-src CSS definitions and SVG elements. This now supports multiple sources and the “local” directive.

Removed some unused code in BVE.RenderContextDirect2D.VCL.pas

Version 2.2 update 7, 20-11-2017

Fixed bug parsing CSS sheet id name and class name

Fixed access violation on rendering text with GDI

Added example RenderToEMF

Version 2.2 update 6, 7-11-2017

Fixed bug in parsing “Transform” attribute, comma seperator was ignored

Fixed bug in path “t”,”T” and “s”, “S” commands

Version 2.2 update 5, 10-6-2017

Restructured detection of encoding in BVE.SVG2XMLReader.pas, this solves issues reading UTF-16 encoded xml files with BOM

Fixed a bug in TSVG2Graphic which resulted in bitmap not cleared with transparent before rendering

Version 2.2 update 4, 7-6-2017

Fixed memory leak in BVE.SVG2XMLReader.pas, in case of BOM reading

Disabled a debugging line that was forgotten in BVE.SVG2ImageList.VCL.pas (clear bitmap with blue color)

Version 2.2 update 3, 4-5-2017

Solved a bug parsing comments in CSS

Solved a bug parsing Unicode references in glyph definitions

Added CalcIntrinsicSize to TSVGRoot to calculate the initial size of an SVG in pixels, also if it it’s size is given in percentages or not defined at all. In controls this will now be called through the “CalcSize” procedure.

Fixed a bug in TSVG2Graphic Draw procedure placing the bitmap origin

Version 2.2 update 2, 9-4-2017

Support for iso-8859-1 encoded xml files.

Fixed missing unit in XE5 and DX2 Raster demo project files

Version 2.2 update 1, 1-4-2017

Lighting-color sRGB to Linear conversion

Morphology filter output set to premultiplied

Displacement filter, if in = in2 a temporary copy of the in2 buffer is made because in2 should not be premultiplied

Version 2.2, 24-3-2017

Biggest changes are:

  • Added SVG filter effects functionality
  • Added SVG events functionality
  • Added a ISVGRenderContext implementation for the AggPas rasterizer and renderer
  • Added project files for Delphi 10.2 Tokyo (DX2)

Some control properties where removed:

  • property “RenderContextType” was removed from the VCL controls
  • property “Buffering” was removed from the FMX controls

Added functionality to store multiple outer SVG docs in one TSVGRoot element that reference each other.

Added TSVGRenderContextManager for managing the selection of a render context type and the appropriate object types for buffers and pathdata

Created a new VCL Viewer demo application

Replaced some types with special types to have more control, TSVGFloat for double or single, TSVGPoint for TPointF, TSVGMatrix for TMatrix, TSVGRect for TRectF, default float is now a double

Split the style attribute list of the rendering elements into StyleAttributes, InlineStyle And StylesheetStyle, so the correct priority of styles can be implemented.

Simplified the code by placing shared objects in the SVGRoot, in stead of passing them as parameters in functions, for example CTM (current transformation matrix), CVP (current viewport), CSA (current style attribues), CRC (current render context)

Solved xml entity parsing bug

Solved a bug in parsing xml namespaces

Solved some viewport bugs

Solved bug in pattern rotation

Enabled parsing of embedded SVG files within image elements.

Set the correct default preserve aspect ratio on symbol, svg, marker and image elements

Implemented “inherit” option on a number of attributes

Solved bugs in gradients for VCL, these should now all render correctly in VCL, including radial gradients with focus

Added the gradient stop color and gradient stop opacity style attributes

Added miter limit style attribute

Added current color style attribute

More efficient pathdata storage (used Direct2D, GDI+ pathdata types to avoid conversion)

Improved glyph redering on VCL

Split axis-aligned and non-axis-aligned clippath rendering on VCL. axis-aligned will be faster, non-axis-aligned slower but more accurate, using a alpha-mask

Created a seperate unit “BVE.RenderContextCanvas.FMX.pas” for the render context implementation for FMX.

Version 2.1, 28-4-2016

Biggest changes are:

  • Replaced the DOM parser for a faster SAX parser
  • Transparency for VCL controls
  • SVG Fonts
  • Masks
  • Markers
  • Support for Delphi DX1 Berlin

1-5-2016: Fix, packages split into design-time and run-time

2-5-2016: Fix wrong path in Fmx designer package to image list component editor


Added, XML reader for the SAX parser


Added, SAX parser
Added logic for parsing external references in an SVG doc
Added logic for parsing a subset of an SVG doc
Added name spaces logic


Removed, the old (DOM) parser


Added CSS font selection rules


Added Quadratic bezier
Faster copying of PathData


Added FontStyle, FontVariant, FontWeight, FontStyles, FontStretch, FontFamily attributes
Added support of non-inherited attributes


Added ISVGFontFace
Added ISVGGlyph, ISVGFont
Added ISVGPolygon, ISVGPolyLine
Added ISVGGradientStop, ISVGGradient, ISVGLinearGradient, ISVGRadialGradient
Added ISVGTextRef
Added ISVGFilter, ISVGFilterPrimitive, ISVGFilterGaussianBlur
Added ISVGPattern
Added ISVGMask


Added TSVGFontFace
Added TSVGGlyph, TSVGFont
Added Font selection rules
Added Glyph selection rules
Added missing Glyph logic
Added TSVGKern
Added TSVGPathShape, TSVGPolygon, TSVGPolyline
Added TSVGElement as a base class for all elements
Added TSVGGradientStop, TSVGGradient, TSVGLinearGradient, TSVGRadialGradient
Added Gradient ObjectBoundingBox logic
Added paint server logic
Added TSVGTextRef
Added TSVGFilter, TSVGFilterPrimitive
Added TSVGPattern
Added TSVGMask
Added Clippath ObjectBoundingBox logic
Added clipping logic to markers, symbols and images
Improved white space handling on text
Temporary buffer for group opacity
Improved viewport logic
Split rendering in two passes, one to calculate style attributes and one to render


Added, component TSVG2Graphic for VCL derived from TGraphic


Rewrote the unit to support masking


Reworked to support the SAX parser
Removed option buffering, now always buffered
Changed parent class from TWinControl to TGraphicControl to enable transparency
Added clipping calculation to control buffersize


Reworked to support the SAX parser
Changed parent class from TWinControl to TGraphicControl to enable transparency
Made it a wrapper around the TSVG2Graphic.VCL class


Reworked to support the SAX parser




Reworked to support the SAX parser


Reworked to support the SAX parser


Complete rewrite

Version 2.01, 1-11-2015


Added event type TSVGOnCreateObjectEvent
Added event type TSVGOnCreatTextChildEvent


Implemented events TSVGOnCreateObjectEvent and TSVGOnCreatTextChildEvent


Changed implementation of function SVGParse to prevent parsing the document 2x


Changed implementation of function SVGParse to prevent parsing the document 2x


Added property SVGDoc (not published, so runtime access only)
Solved memory leak on BitmapMargins (TBounds) object
Solved bug that prevented application of the RenderOptions on the TSVG2Image object