Change log


Version 2.4 update 28, 18-10-2026

Breaking changes

  • A rendering change a drawing may rely on: filter, mask and pattern regions in objectBoundingBox units no longer read a value of 5 or more as a percentage. width=”5″ is 5 times the bounding box, as in SVG and browsers, where it was 5%, so a wide filter region such as x=”-2″ width=”5″ was cut down to a sliver. The switch SVGLegacyGradientFractions in CompilerSettings.inc, which restores the old reading of gradient coordinates (update 27), now restores this one too.
  • TSVGFontFace.LocalName, the local name of the font, is now TSVGFontFace.FontLocalName, so the element’s own local name, through IXMLNode or ISVGElement, is “font-face” again; it was the font name, or empty for an SVG font. ISVGFontFace.LocalName is unchanged.

Text and fonts

  • Fixed the text of title, desc, metadata and unknown elements inside a text element being drawn as part of the text. Only the text of tspan, textPath, tref, g and a counts, as in browsers.
  • Fixed the first character of a textPath not being placed at the start of the path when text comes before the textPath and the textPath starts with white space.
  • Fixed lengthAdjust=”spacingAndGlyphs” both spreading the characters and stretching them, so the text ran past textLength. The glyphs and their positions are stretched together and the text ends at textLength.
  • Skia: fixed trailing white space getting no advance, so preserved spaces at the end of a text with text-anchor middle or end placed it too far right.
  • Skia: fixed text in an SVG font followed by text in another font in the same text element: the other font took the SVG font, or its glyphs were put on the wrong characters.
  • Fixed bidi text with a font change before a change of direction getting runs of the wrong length with the font systems that use the base text layout, such as FreeType.
  • Fixed text with a paragraph separator inside it (U+2029, U+0085 or U+001C to U+001E) not being drawn. The bidi algorithm orders each paragraph on its own, as Unicode says. TBidiReference.DoBidi has an overload that also returns the levels.
  • Fixed text that starts with right-to-left characters, such as Hebrew or Arabic, being placed to the left of its x when no text-anchor was set, so text near the left edge was cut off. It starts at x, as in browsers. Text anchoring now also applies when a later character is moved left of the first, for example by a negative dx.
  • Fixed CR LF line ends in a file counting as two characters: they are read as one line end, as XML specifies, so text with xml:space=”preserve” in such a file has one space per line end, as in browsers, and a middle or end anchored text is no longer placed too far left.
  • The bidi class table is from Unicode 18.0.0 instead of Unicode 10, and covers every code point: characters added since Unicode 10 were treated as neutral, and unassigned ones in right-to-left blocks now default to right-to-left as Unicode specifies. All 91,707 cases of BidiCharacterTest.txt (Unicode 18) pass.
  • macOS: the last fallback font is Lucida Grande; the name was misspelled, so it was never found.
  • Skia: fixed the x-height of a font being 0 when it is the first metric asked for.
  • Skia: fixed text after a line separator (U+2028) or another forced line break character being left out. The character is drawn as nothing, as in browsers.
  • Skia: fixed fake bold and italic: weight 900 in a family whose heaviest face is bold (Georgia, Times New Roman, Tahoma) was drawn heavier and wider than in browsers, and italic in a family without an italic face (Tahoma, Impact) was slanted twice. The face the font manager finds is used as it is.

SVG fonts

  • Glyphs are chosen as SVG 1.1 says: the first glyph in the font whose unicode matches the text. A ligature is used when it comes before the glyphs of its characters; a glyph that does not match, such as a ligature that is the only glyph of its first character, is no longer used, and of glyphs for the same character the first wins instead of the last. arabic-form, lang and orientation are still not taken into account.
  • Fixed kerning pairs given by unicode (u1, u2) being ignored for a glyph whose name is in some other pair (g1, g2).
  • Fixed glyph metrics being clamped: a positive vert-origin-x became 0, a negative advance or vert-origin-y became 0.

Animation

  • Fixed clock values with a colon: 1:30 was read as 60 s and 0:00:05 as 0. Full (hh:mm:ss) and partial (mm:ss) clock values are read whole, and the min metric is read properly.
  • Fixed animateMotion being linear by default; it is paced, as SMIL says.
  • Fixed animateMotion ignoring a rotate angle, and ignoring rotate=”auto” and “auto-reverse” for from, to, by and values motion. Edge does not apply the angle; the specification does.
  • Fixed animateMotion to- and by-animations never running. They start at the origin, and a by-animation is additive without additive=”sum”.
  • Fixed animateMotion with additive=”sum” moving twice as far.
  • Fixed calcMode=”paced” on a colour animation timing the colours by a meaningless distance; it is the distance in RGB space.
  • Fixed accumulate=”sum” on a path animation adding the wrong X coordinates.
  • Fixed interpolating and adding matrix transforms giving an undefined result.
  • Fixed wallclock() values raising an exception or being wrong: a date without a time, a time without a date, a fraction of a second, a zone offset that crosses midnight, and any date more than 24.8 days from the start of the system (in a build with range checking).
  • Fixed an animation with begin=”wallclock(…)” starting as long after the animation start as the computer had been running, instead of at that wall time. A wall time in the past begins the animation at once. TSMILTiming has a new field Wallclock, and a wallclock value has the kind tkWallclockSyn instead of tkOffset.

CSS and values

  • Fixed an escaped @keyframes name, such as \31 23, failing the whole document; CSS escapes are read as CSS specifies, also in animation-name.
  • Fixed an animation shorthand with a delay in ms taking a further time as a delay too. An invalid animation shorthand, such as one with three times, is now left out instead of dropping the rest of the style.
  • Fixed an animation shorthand with a timing function containing spaces, such as cubic-bezier(0.1, 0.7, 1, 0.1) or steps(4, start), failing the whole style sheet.
  • Fixed !important being looked for inside a url or a string, which made a value such as url(“a!b.svg#g”) invalid.
  • Fixed Unicode-Bidi in a style not being recognised; CSS property names are not case sensitive.
  • Fixed a number followed by e and white space or a comma taking the next number as its exponent: 1e 5 read as 100000.
  • Fixed IRI schemes being matched as prefixes, so datax: was read as a data URL.
  • Fixed transform-origin with leading white space being invalid.
  • Fixed transform-origin being ignored for the transform attribute; it applied only to a transform set in CSS.
  • Fixed unicode-range wildcards adding a range for every prefix of the value (U+00?? gave four ranges). Code points above U+FFFF are left out or clipped instead of cut to 16 bits.
  • Fixed the clipOut and text-align values and the animation-direction, animation-fill-mode and animation-play-state types never being valid as enumerations.
  • Fixed a value that ends too early, such as transform=”matrix(1,2)”, raising an index exception instead of the parse error. A matrix with fewer than six numbers is invalid, so the transform is ignored as in browsers; a missing number in the middle gave a zero matrix that hid the element.
  • Fixed an @font-face src with a missing ) adding the source before it a second time, and the copy of an @font-face rule leaving out font-variant.

Selectors and style sheets

  • Fixed :last-child failing on an element followed by white space.
  • Fixed the attribute selectors [a~=b], [a|=b], [a^=b], [a$=b] and [a*=b] not counting in the specificity; every attribute selector counts as a class, as [a=b] did.
  • Fixed attribute selectors with a value matching an attribute that is present but empty, and [a=””] matching any value of a.
  • Fixed [a|=en] matching the first word of the value instead of en or en- followed by more, and [a$=b] matching values that start with b instead of those that end with it.
  • Fixed :nth-child, :nth-of-type and :lang dropping the rest of the selector from the specificity: #a:nth-child(2) counted as a single class.
  • Fixed property names being case sensitive in style sheets: fill and FiLl were two properties, and which one applied was random.
  • Fixed @import: the imported rules came after all style elements, so they won from the sheet that imports them; an @import inside an imported sheet only took effect the next time the style sheet was made, and every time it was made the imported sheets were added again. The rules now go where the @import is, a sheet that imports itself is read once, and a syntax error in an imported sheet ends only that sheet.
  • Fixed @import with a string, @import “a.css”;, being ignored. The ; may be left out at the end of the sheet.
  • These change which rules apply, so a drawing that relied on the old matching or specificity can render differently.

XML and DOM

  • Attributes without a prefix have no namespace, as XML says; they were put in the default namespace (the SVG namespace), so getAttributeNS(”, ‘width’) found nothing. The xml prefix is always the XML namespace now, so xml:space and xml:base have it without a declaration. Lookups by name are not affected.
  • Fixed AddFragment (ParseFragment) ignoring the prefixes declared on the parent element and its ancestors: xlink:href in a fragment had no namespace.
  • Fixed setAttributeNS adding a second attribute when the name has no prefix, instead of changing the one there.
  • Fixed the saved style (used by filter primitives, masks and stop elements) leaving out the style of the document element: did reach the descendants when rendered, but not their saved style.

Filters

  • Fixed filtered and clipped elements losing their last row or column of pixels when the element’s edge covers it only in part: the buffer for a rect that does not start on a whole pixel was one pixel short. On Win32 builds a rounding error made this happen to rects that do start on a whole pixel too.
  • Fixed the buffer size of a filtered element under a rotation with non-uniform scale, which was worked out from a wrong rotation angle.
  • Fixed filters that read the same result in two colour spaces on Skia, luminance masks and feDisplacementMap with the same in and in2 converting pixels from the wrong colour space.
  • Direct3D 11: fixed feMorphology eroding and dilating one pixel too little on one side; the kernel of radius r is 2r + 1 pixels wide.
  • Direct3D 11: a discrete feComponentTransfer function without tableValues no longer fails the whole document; it leaves the channel unchanged, as in browsers.

Path data

  • Fixed ApplyMatrix keeping the bounds, length and flattening of the untransformed path, and leaving Direct2D paths untransformed and the Skia path of a Skia path data unchanged. AddPathData with a matrix on a Direct2D path no longer transforms the points already there, and resets the bounds.
  • Fixed CreateCopy of a measured path having no contours (length 0, no hit testing), GetPathLength with a matrix returning the first length it measured for every later matrix, TSVGPathDataList.AssignTransform giving empty paths, TSVGPathDataListUtil.CreateCopy giving an empty copy and emptying the original, and two iterations over one TSVGPathDataUtil getting in each other’s way.
  • TSVGPathDataString, used for text converted to paths: a move-to right after another one was written as part of the same M command and read back as a line; the path can now be iterated, measured, transformed and added to.

Other

  • Fixed path, polyline and polygon elements being left out by SVGRenderToCanvas in vector mode and by the EMF export once the drawing had been shown on screen, and an access violation in Direct2D after a GDI+ pass. A root that renders with another backend through ISVGRoot.ResourceFactory now gets the path data, animated or set with SetPathDataList, for that backend.
  • GDI+: fixed the EMF export and GDI+ command lists leaving a screen device context unreleased for every metafile they make.
  • Direct3D 11: a context recording into a command list no longer raises an access violation on its next scene after the device was lost.
  • preserveAspectRatio with align none is written as “none meet” instead of “meet”.
  • Fixed TSVGIri.FileExt taking a dot in a directory name as the start of the extension: a.b/c gave .b/c.
  • TSVGTransform.SetIdentity and SetZero set TransformType to ttMatrix; they kept the type of the transform before.
  • Fixed TSVGMapData.Assign raising for a source of another size, brush copies (CreateCopy of a base brush made a gradient brush, a gradient brush added points to the ones there and left out the bounds, a bitmap brush had kind bkNone and its copy no bitmap), TSVGBuffer.BufferScaleXY reading the vertical scale, and, on XE2 and XE3, the start time for wallclock values read in the wrong unit.

Version 2.4 update 27, 11-10-2026

Breaking changes

  • Glyph ids are Word instead of SmallInt, so fonts with more than 32767 glyphs (CJK fonts) render correctly. A class outside the package that implements ISVGFontFace, ISVGFontFaceSVG or ISVGGlyphRun must change: AddOutline, GetGlyphMetrics, HKern, VKern and Glyph[] take a Word, ISVGGlyphRun.GlyphIndices is a TList and AddGlyph takes a Word, and SelectGlyphs takes the glyph ids as TSVGGlyphIndexArray (array of Word); the cluster map stays TSVGSmallIntArray.
  • ISVGCustomFontCollection.LoadFromStream is a function that returns the family name of the font it loaded (empty when unknown), and ISVGFontSource.FontCollectionAddCustomFont takes the family name the document uses for the font, with a new method SubstituteFontFamilyAliases. A class outside the package that implements either interface must follow.
  • Two rendering changes a drawing may rely on: x and y on a g element are ignored, and gradient coordinates above 5 are no longer read as percentages (see Paint and shapes). Each has a switch in CompilerSettings.inc that restores the old behaviour: SVGLegacyGroupXY and SVGLegacyGradientFractions.

Robustness: SVG files that crashed or hung the application

  • Fixed the CSS parser hanging on a / that does not start a comment, in a style element, a style attribute, @keyframes or @font-face.
  • Fixed a stack overflow on gradients or patterns whose href refer to each other in a cycle. The chain now stops where it comes back.
  • Fixed a stack overflow on a text element inside another text element. The inner one is not rendered, as in browsers.
  • Fixed an access violation in every element with a previous sibling when a style sheet uses :first-of-type.
  • Fixed an access violation in SVG fonts with a vkern element; the vertical kerning also took its value from the wrong element.
  • Fixed feImage of an SVG document without width and height failing the whole document. The image now fills the filter primitive subregion.
  • Fixed @font-face failing the whole document when its last property has no ; and white space comes before the }. An unquoted font-family and unicode-range now end at the }.
  • Fixed an access violation when text is converted to paths and no font face is found for a part of it.
  • Fixed an access violation with isolation: isolate on an element whose content has no size.
  • Fixed writes outside the pixel buffer in filters: a filter input entirely outside the filter region (feColorMatrix, feComponentTransfer and others), feComposite and feBlend of two inputs that do not overlap, feFlood with a subregion outside the region, and feGaussianBlur with a stdDeviation near half the region size.
  • Fixed reading past the end of a data URL ending in an incomplete %-escape, and past the end of the shorter list when stroke-dasharray or another number or length list is animated between lists of different lengths.
  • Fixed an animation with an indefinite duration and a repeatCount never starting (a range error in checked Win64 builds). A set element with repeatCount and no dur now applies indefinitely.
  • Fixed a range error in checked builds when a pixel that is not premultiplied is unpremultiplied; the color is clamped.
  • ISVGRenderBuffer had the same GUID as ISVGBuffer, so Supports and as succeeded for any buffer. It has a GUID of its own now.

Paint, shapes and markers

  • Fixed a marker orient angle being taken as radians instead of degrees: orient=”90″ turned the marker by about 117 degrees.
  • Fixed markerUnits=”userSpaceOnUse” being ignored: the marker was still scaled by the stroke width.
  • Fixed markers: the vertex where one subpath ends and the next begins got no mid marker, and at the start and end of a closed subpath the marker took the direction of one segment instead of the bisector of the closing and the first segment.
  • Fixed an arc with a negative ry taking the negative of rx instead.
  • x and y attributes on a g element no longer move its content: SVG has no such attributes and browsers ignore them. Define SVGLegacyGroupXY in CompilerSettings.inc to get the old behaviour.
  • A gradient coordinate in objectBoundingBox units above 5 is no longer taken as a percentage (x2=”50″ meant 50%); it is taken as it is, as in browsers. Define SVGLegacyGradientFractions in CompilerSettings.inc to get the old behaviour.
  • Fixed a fill that refers to an element that is neither a gradient nor a pattern painting nothing instead of its fallback color, and an objectBoundingBox gradient or pattern fill on a shape without width or height not taking the fallback, as strokes already did.
  • Fixed a pattern fill ignoring fill-rule=”evenodd”.
  • Fixed a gradient without length (x1,y1 = x2,y2, or r = 0) ignoring stop-opacity and currentColor of its last stop. A radialGradient with a negative r paints as one with r = 0, as in browsers, instead of black.
  • Fixed a gradient with one stop ignoring fill-opacity, stroke-opacity and opacity on Skia, and fill-opacity and stroke-opacity on AGG and Quartz.
  • Fixed the bounds of an ellipse with rx or ry in percentages, of a stroke under a non-uniform scale, rotation or mirroring, and of a marker outside defs, which counted in the size of its parent. Bounds decide filter regions and the size used with AutoViewbox.
  • Fixed a pattern fill or stroke ignoring fill-opacity, stroke-opacity and opacity.
  • Fixed clip paths taken for a clip rectangle when they are not one: with clipPathUnits=”objectBoundingBox”, with a transform, or with more than one child. On a render context without clip rectangles a rectangular clip path was not applied at all.
  • Fixed mask content outside the mask region (x, y, width and height of the mask) still letting the element through.
  • An image element without width or height takes the size of the image (SVG 2 auto), and with one of the two its aspect ratio. It used to render nothing.

Filters

  • Fixed feComposite operator=”lighter” giving a nearly black, transparent result; it adds the colors, as in browsers.
  • Fixed feBlend and feComposite ignoring their own x, y, width and height; the same for feDisplacementMap. feBlend works in color-interpolation-filters, as the other primitives do.
  • Fixed point and spot lights of feDiffuseLighting and the spot light of feSpecularLighting being placed off when the filtered element is inside a nested svg element with x or y.
  • Fixed feTurbulence stitchTiles=”stitch” having no effect.
  • Fixed feDisplacementMap sampling the wrong pixels when its input has an offset, and scale=”0″ (the default) passing on the result before it instead of its input.
  • Fixed feConvolveMatrix ignoring targetY, feMorphology with a radius of 0 in one direction dilating or eroding in both, and feImage drawing nothing for a GIF.
  • An in attribute that names no earlier result is taken as no in (the previous result), as Filter Effects says; it was taken as SourceGraphic.
  • Fixed the last pixel column of feColorMatrix, feComponentTransfer, feDisplacementMap and luminance mask results being cleared.
  • Fixed feComposite where its second input does not reach: in and atop removed nothing there, as if that input were opaque.

Text and fonts

  • Fixed character references above U+FFFF, such as 😀 and CJK Extension B characters, being cut to 16 bits.
  • Fixed font face selection when no face has the requested weight or width: the choice now follows CSS (for bold the nearest heavier face first, for 400 a 500 face first, and so on) and no longer depends on the order of the faces.
  • Fixed characters outside the Basic Multilingual Plane, such as emoji, counting as left to right in bidi text.
  • Fixed brackets in bidi text: a pair of brackets now takes the direction of the text it encloses (rule N0 of the Unicode Bidirectional Algorithm), so “abc (def)” in right to left text keeps its brackets around “def”.
  • Fixed a font loaded through @font-face only being found when the font-family of the rule matches the family name inside the font file. The name of the rule now finds it.
  • Skia: fixed right to left text losing its first character, and characters outside the Basic Multilingual Plane drawing the first glyph of the run.
  • Fixed systemLanguage: no language ever matched on Win32 and FPC, so a switch always took its last child. A language now matches when it equals the language of the user or one is the other with a subtag (en matches en-US), not when it occurs anywhere in it.

CSS

  • Fixed keywords that start with a shorter keyword being read as the shorter one: ease-in, ease-out and ease-in-out read as ease, bolder as bold, smaller and larger as small and large, pre-wrap, pre-line and preserve as pre, alternate-reverse as alternate.
  • Fixed the font shorthand: the last part was lost in a style attribute (font: 12px Arial lost Arial), everything after normal was lost, the parts of a family name were joined without spaces, and a numeric weight was read as part of the size. The animation shorthand had the first two problems too.
  • Fixed .a.b matching any element with class b; every class must match now. #a#b with two different ids no longer matches.
  • Fixed an attribute selector with a prefixed name, such as [xlink:href], losing the rest of the style sheet.
  • @media, @charset, @supports and other @-rules that are not supported are skipped. They used to garble the rule after them. Rules inside @media are not applied.
  • A declaration that cannot be read is skipped on its own, as in a browser. It used to drop the whole rule, and a vendor prefixed property without a ; before the } dropped the next rule too.
  • Fixed steps(), step-start and step-end never moving a CSS animation; steps(n) without a position now means end, as in CSS.
  • External and linked style sheets are read as UTF-8; without a BOM they were read in the system code page.
  • Fixed the descendant combinator and ~ only trying the nearest ancestor or preceding sibling that matches: .x > g rect did not match a rect two groups below .x.
  • Fixed CSS keyframes: a property missing from a keyframe only started animating after it, a keyframe took the timing function of the keyframe it ends at instead of the one it starts at, and only when that came before the property in the rule. Keyframe rules are taken in the order of their offsets, and with several animations each keeps its own timing function.
  • Fixed CSS animation-direction alternate running backwards in the first iteration.

Values and paths

  • Added the color names dimgray and rebeccapurple.
  • Fixed rgba() failing with white space before the ), and accepting a percentage and a / before the alpha now.
  • Fixed a hex color followed by white space being read as a different color, and an invalid hex digit raising an exception instead of failing the color.
  • Fixed path data after Z without a moveto being skipped up to the next M; it now starts a new subpath at the start of the closed one, as SVG specifies. An unknown character ends the path, as any other error does.
  • Fixed reading PNG information: chunk names were compared on three letters, and the gamma of a PNG without gAMA or sRGB chunk was undefined.
  • Fixed a rotate with a center in a transform written with the decimal separator of the locale.

Loading and referencing documents

  • Fixed data URLs: percent-encoded data without parameters, such as data:image/svg+xml,%3Csvg…, and ;charset=…;base64 are decoded now, also under FPC. Empty data is no longer taken for a JPEG image.
  • Fixed references to other files from a document whose path has no folder (doc.svg + img.png gave doc.svgimg.png) and from a document opened by a standard file URL such as file:///C:/x/main.svg.
  • Referenced documents are found by their whole IRI: a document from one host was taken for one with the same path on another host or with another query.
  • A referenced document that fails to load is reported through OnLogMsg (“Could not load …”) instead of being skipped without a trace; this includes http references in a build without internet access.
  • Fixed RootID showing nothing for a drawing loaded from text or a stream.

Interaction and controls

  • Fixed the stroke of a path, polyline or polygon not being hit (ObjectAtPt, mouse events) inside a transformed element: it was only hit where no transform applies.
  • Fixed linking a control to a running animation timer, unlinking one, or changing Synchronize stopping the timer for every control.
  • ISVGRoot.CheckEventTypes includes event attributes on the svg element itself.
  • Fixed ZoomToFit and ContentBounds with AutoViewbox: the outer svg element’s own width and height were counted at the top left of the control, not where the drawing is fitted, so a drawing that does not fill the width was zoomed off-centre.

Changing a drawing in code

  • Elements added with AddChild or AddFragment, or moved to another parent, are found by their id at once; a style or link element added later is applied.
  • Fixed an element taking a property from the wrong CSS rule after a style element was changed. ICSSStyleSheet has a new Serial property for this.
  • An attribute set through the IXMLNode that AddChild returns now updates the drawing as one set through ISVGElement does.
  • Fixed a use element leaving its caches in the element it referred to before its href changed, and gradients and patterns keeping an href target that lost its id or left the document.
  • Fixed a clip path that is a single rectangle not seeing later changes to it.
  • Fixed a glyph of an SVG font still being selected by its old unicode after the unicode was changed.
  • Fixed the fonts of @font-face rules staying available after the document was loaded again with other content, and being loaded again each time a style element changed.
  • Fixed an access violation in FPC/Lazarus builds after an attribute change in a drawing with an SVG image or feImage of an SVG: the image’s document was freed while its elements were still used.
  • Fixed the X, Y, Dy and Rotate setters of TSVGSpan, the Dy setter of TSVGFilterOffset and the TargetY setter of TSVGFilterConvolveMatrix writing to the wrong attribute.
  • Fixed ISVGAttribute.AsTime always raising “Invalid cast” when set, and AsTransformOrigin raising when set on an attribute that has no value yet.
  • Fixed TSVGText.TextToPathGroup ignoring the value it was set to.
  • Fixed the KeyTimes, KeyPoints and KeySplines properties of animation elements: the setters wrote the numbers without ; so the animation read one key time, and the getters returned only the first item of a list from a file. KeySplines takes four numbers per spline.
  • Fixed clones of repeatCount, rotate and transform-origin values losing their type, and clones of paints losing none, currentColor and the url. A value parsed again after inherit is no longer inherit, and a clone of an inherit value is.
  • Fixed access violations on an element outside a document: logging an invalid attribute value, and an href to another file. Fixed an access violation when Skia path data that was never drawn is transformed.

Version 2.4 update 26, 4-10-2026

  • Fixed an access violation when zooming into a drawing while an element with markers, a clipped viewport, or a pattern fill or stroke was entirely out of view. Introduced in update 25.

Version 2.4 update 25, 3-10-2026

Breaking changes

  • A class outside the package that implements ISVGRenderContext without deriving from TSVGBaseRenderContext must add GetRasterScale (returning 1) and CopyDrawnTo.
  • Descendants of TSVGRoot outside the package must replace their overrides of CreatePathData, CreatePathDataList, CreateTextLayout, CreateCustomFontCollection and RegisterFontCollections with a single DefaultResourceFactory override.
  • Removed the TSVG2BindingControl add-on, unit BVE.SVG2ControlBindings.VCL and the SVG2AddOnPackage, now that every control has bindings. Use TSVG2Control instead; the binding properties HRef, AttributeName and AttributeValue are now Selector, TargetName and Value.
  • ObjectAtPt and SVGObjectAt no longer return elements that are hidden, have pointer-events=”none” or are clipped away at the point, and return the use element instead of the shape inside the referenced symbol. They now return the element a click would go to. A class outside the package implementing ISVGClipPath must add PointInClip.
  • A print page on the GDI+ render context works in 1/96 inch instead of printer dots, as on Direct2D. Code that passes printer dots to BeginPage must convert them to 1/96 inch.
  • TSVGRenderContextManager.RenderContextType is read only. Assigning it never selected a render context; use ISVGRoot.ResourceFactory instead.

Render context per render pass

  • Added ISVGResourceFactory, ISVGRoot.ResourceFactory and TSVGRenderContextManager.CreateResourceFactory, so a document can render on another backend for one pass, for example EMF through GDI+ while the screen renders through Direct2D, without recompiling. Leaving it nil keeps the default backend.
  • Added TSVGFontSystemType, so the font system can be chosen at runtime instead of only by compile time define.
  • Fonts loaded by the document (@font-face, font-face-uri) are kept when the resource factory changes.
  • Object caches are kept per backend, so rendering one document through two backends in one process no longer mixes their resources.
  • Fixed TSVGObject.ObjectCacheClear in BVE.SVG2Elements.pas, which removed only the first cache entry referencing a parent cache.

EMF export

  • Added unit BVE.SVG2ExportEMF.VCL.pas with SVGRenderToEmfFile and SVGFileRenderToEmfFile, in the VCL package of every Delphi version. The application no longer has to be built as a GDI+ application to write an EMF file. Requires SVGGDIP and SVGFontGDI in ContextSettingsVCL.inc, which does not change the default backend.
  • Text can be written as paths or as real text with TSVGEmfTextMode. Filters and clip paths are off by default, because they turn parts of the metafile into bitmaps.

Printing and output

  • Added SVGRenderToCanvas to BVE.SVG2Elements.VCL, which draws a document into a rectangle of a canvas that already has content, such as a report band or a grid cell. On a printer or metafile canvas the drawing stays vector graphics.
  • Added SVGRenderToBitmapDpi and SVGCalcSizeAtDpi, which render a drawing at its real size for a given resolution.
  • Added SVGRenderAtRealSize, which renders a drawing at its real size on a print page: width=”100mm” prints 100 mm wide.
  • Added an output file name parameter to CreatePrintJob, so a PDF (Microsoft Print to PDF) or XPS file can be written without the save dialog, unattended.
  • Filters, masks, clip paths and group opacity on a print page are rendered at the printer’s resolution instead of at 96 dpi.
  • Real text in a PDF keeps the position of every character, including dx, dy, letter-spacing and textLength.
  • On a GDI+ print page, text is drawn through GDI, so large headings in a PDF stay selectable and searchable.
  • Fixed stroked text, text-decoration, and text inside a clip path, mask or group opacity missing from PDF and EMF output with real text.
  • Fixed overline never being drawn with DirectWrite.
  • Fixed textLength with lengthAdjust=”spacing”, which ended the text short of textLength.
  • rect, circle, ellipse and line support ISVGPathShape, so their outline can be retrieved as path data.

Data binding

  • Data binding moved into the core package and works on VCL, FMX and FPC. Every control has a SVGBindings collection, which can be set up in the object inspector or from code.
  • A binding selects its elements by id, tag, class or attribute, and writes an attribute or the text content. Bindings survive loading another document.

Finding elements

  • Added FindElements, FindElementsByTag, FindElementsByClass and FindElementsByAttribute on ISVGRoot, and the matching ElementFindAll functions on ISVGXMLDocument.
  • A document that uses the same id more than once reports it through OnLogMsg and the OnLog event of the controls.

Path metrics

  • Added ISVGPathData.ContourCount and GetContour, which give a path flattened to line segments, and the type TSVGContour.
  • Fixed the length of a closed subpath, which left out the closing segment, and hit testing the stroke of that segment.
  • Every backend now measures path length the same way; Direct2D measured curves slightly short.

Zoom and pan

  • The controls can be zoomed and panned without viewBox arithmetic: ZoomFactor, ZoomMin, ZoomMax, ZoomAt, ZoomByWheel, WheelZoomStep, PanBy, ZoomToRect, ZoomToFit, ResetView, MousePan, MouseZoom, OnViewChanged, and ClientToSVG/SVGToClient to convert between control and drawing coordinates.
  • Added ElementBounds and ZoomToElement to all controls, and SVGMeasure and SVGElementBounds for use without a component.
  • Fixed ObjectAtPt and the SVG events on TSVG2Control and TSVG2Image, which ignored the view transform.
  • Fixed TSVG2WinControl not repainting after a zoom, pan or binding change while presenting through Direct3D 11.
  • Fixed zooming or panning with sroPersistentBuffers drawing buffers kept from the previous view.
  • TSVG2WinControl paints its background in its own Color instead of black, and stores Color in the dfm again.
  • Clip paths, masks, group opacity and filters render at any zoom level. Their offscreen buffers are clipped to what is visible, and FilterBufferMaxPixels (8 megapixels by default) caps the size of a filter buffer.

Hit testing and SVG events

  • ObjectAtPt, SVGObjectAt and the SVG mouse events use one and the same test, so ObjectAtPt finds what a click goes to.
  • Fixed hit testing ignoring visibility, pointer-events, clip paths and the outer half of the stroke. Fixed pointer-events=”visible”, which hit nothing.
  • Shapes filled with a gradient or pattern, line elements and image elements can now be hit.
  • Text is hit on its character cells, as in browsers, instead of on the ink of each glyph.
  • A click is reported when the button is released over the element it was pressed on, not only at exactly the same point.
  • Fixed changing the value of an event attribute, which kept passing the old value to OnSVGEvent.

Editing and saving documents

  • Fixed saving documents whose text or attributes contain &, < or “, which produced invalid XML.
  • Fixed a saved DOCTYPE written without a space.
  • Fixed attributes set through IXMLNode (AddChild, ChildNodes) not reaching the rendered element.
  • Fixed changing class or id from code not re-applying the style sheet rules.
  • Fixed an element staying findable by its id after the id was removed.
  • Fixed an access violation when an element was released after its document.
  • sroPersistentBuffers no longer shows a stale picture when the document is changed from code, and is much faster for mostly static drawings with a few changing parts.
  • Fixed BufferApply in BVE.SVG2Elements.pas, which placed a kept buffer one transform too far when a document was rendered under different transforms.

SVG and CSS support

  • Added mix-blend-mode, with all sixteen blend modes.
  • Added paint-order.
  • Added CSS custom properties, var() and light-dark().
  • Added !important in style sheets and style attributes.
  • Added the :root pseudo-class.
  • Added mask-type.
  • Added vector-effect: non-scaling-stroke, and ISVGRoot.HostScale.
  • Added dominant-baseline and alignment-baseline, and TSVGFontMetrics.XHeight.
  • Added hsl() and hsla() colours.
  • Added font substitution: a font that is not installed is replaced by a font with the same widths, for example Helvetica by Arial. SVGFontSubstituteAdd adds your own.
  • Fixed :nth-child() and :nth-of-type() with a number, and :lang().
  • Fixed rules with an unsupported pseudo-class such as :hover being applied, and rules with :not() or :is() causing a parse error.
  • Fixed !important after a hex colour.
  • Fixed feBlend with the newer blend modes, and with hyphenated mode names such as color-dodge.
  • Fixed baseline-shift on an element with its own x or y.

Drawings from drawing tools

  • Fixed a parse error on a character reference to “<” in text, such as <, as written by Visio.
  • Fixed “List index out of bounds” on text with a line or paragraph separator, as written by Figma.
  • Fixed rgb(), rgba() and system colours painted black in a Win64 application with overflow checking.
  • The alpha of rgba() is clamped to the range 0 to 1.

Filters

  • Fixed feGaussianBlur with a different deviation per axis on Direct3D 11, which was drawn as a diagonal smear.
  • Fixed feSpecularLighting coming out too dark on all render contexts.
  • Fixed feMorphology drawing leftovers of earlier renders on Direct3D 11, and reading stale pixels at the left edge.
  • Fixed feComponentTransfer type=”table” giving random results for pure colours on WIC and GDI+.

Direct2D render contexts

  • Fixed gradientTransform on radial gradients with gradientUnits objectBoundingBox.

Skia render context

  • The Skia render context and font system are no longer experimental. Of all render contexts it is the closest to the browser.
  • Fixed BVE.SVG2ContextSkia.pas, which did not compile since update 19.
  • Can be used with FMX on Windows and macOS, in addition to VCL.
  • Added TSVGPrintJobSkia, which writes a PDF through Skia without a printer driver, with selectable text.
  • Fixed filter results too light, pattern seams, blocky enlarged images, a memory leak in offscreen bitmaps, and fonts loaded by the document not being used.
  • Fixed an access violation drawing text, and red and blue swapped in some filters, on macOS.

Graphics32 render context

  • Checked against the current Graphics32.
  • Fixed colours with their own alpha painted opaque, gradientTransform with objectBoundingBox, and filter results too dark.
  • Images and feImage work in console applications.

Components

  • Added OnParseError and ParseErrorMessage to all controls, so the application is told when a drawing fails to load.
  • Added HasAnimations to TSVG2WinControl.
  • A TBitmap with AlphaFormat afDefined gets straight instead of premultiplied colour.
  • Fixed TSVG2AnimationTimer.SampleInterval 250 coming back as 125 when the form was loaded.

Threads and dlls

  • Fixed TSVGParserQueue and TSVGRenderQueue releasing documents and render contexts too late, and crashing when freed while threads were running.
  • Fixed the parser and render threads not initializing COM.
  • Fixed a race when several threads create the shared Direct2D resources at once.
  • Fixed TSVGRenderContextManager.InitializeGraphics raising “CoInitialize has not been called” in a dll or thread.

Project settings

  • A project can define SVGCustomContextSettings to choose its own render context and font system without editing ContextSettingsVCL.inc, ContextSettingsFMX.inc or ContextSettingsFPC.inc.
  • Building without a render context or font system now stops with a compile error instead of failing at runtime.
  • Range and overflow checking follow the project settings in every unit.

FPC Lazarus

  • Fixed the package not compiling on FPC (CreateIC, missing Variants unit, Indy dependency).
  • Loading images, style sheets and fonts from http and https works, through fphttpclient.
  • Fixed the XML property losing non-ASCII characters.
  • The FPC controls have zoom and pan, bindings and FilterBufferMaxPixels, as on VCL.

Version 2.4 update 24, 17-9-2026

General

  • Removed the dependency on libeay32.dll and Indy/OpenSSL for downloading files from internet for Delphi compilers XE8 and newer. In case of XE8 or newer, System.Net.HttpClient will be used for downloading.

Delphi 13.2

  • Added Ver370Up and Ver370Down to CompilerSettings.txt
  • Conversion added for TSVGContextCanvasFMX.GetHeight and TSVGContextCanvasFMX.GetWidth for D13 to Integer in unit BVE.SVG2ContextFMX.

Parser

  • Fixed a bug in TSVG2BaseViewY.SetFilename in BVE.SVG2Doc.pas which resulted in incorrect construction of URL in case of internet sources (https).
  • Fixed the same class of bug in BVE.SVG2SaxParser.pas, in TSVGSaxParser.Parse(aFileName, aSVGRoot), TSVGSaxParser.Parse(aFileName, aDoc) and TSVGSaxParser.ParseInternal(aFileName, aSVGRoot): a forced ‘file:’ prefix on the input string caused the iri parser to misparse embedded http/https URLs into an invalid Host value, resulting in a “network path not found” error when parsing an SVG loaded through TSVG2Image.Filename.

Console applications

  • Fixed a bug in BVE.SVG2Elements.Console.pas, function TSVGRenderContextManager.CreateRenderContext, the WIC bitmap of the Direct2D WIC render context was left nil, which resulted in an access violation on every render in a console application.
  • Fixed the SVGDirect2d3D11, SVGGDIP and SVGGraphics32 branches of TSVGRenderContextManager.CreateRenderContext in BVE.SVG2Elements.Console.pas, which did not compile.
  • Added TSVGRenderContextManager.CreateCustomFontCollection and TSVGRootConsole.CreateCustomFontCollection to BVE.SVG2Elements.Console.pas, previously fonts loaded by the document itself (@font-face, font-face-uri) were ignored in console applications.
  • Fixed two bugs in UnitTest\Console\XE5\svg_render.dpr: the -height switch was read into the width variable, and nested output folders were not created.

Direct3D 11 render context

  • Implemented TSVGBitmapD2d3D11.SaveToFile and TSVGImageD2d3D11.SaveToFile in BVE.SVG2ContextD2D.pas, which were empty, so the result of a Direct3D 11 render context can now be saved to BMP, JPEG, PNG or ICO.
  • Fixed a bug in BVE.SVG2ContextD2D.pas, constructor TSVGContextD2d3D11.Create, creating a Direct3D 11 render context without calling IsSupported first resulted in an access violation.

GDI+ render context

  • Fixed a possible access violation in unit BVE.SVG2ContextGP.pas, procedure DllGdiplusShutdown. This procedure woul be called when the GDI+ rendercontext is used in a DLL and FinalizeGraphics is called on the rendercontext object.
  • Implemented FillRule for GDI+ rendercontext in BVE.SVG2ContextGP
  • Fixed a bug in BVE.SVG2ContextGP.pas, function TSVGContextGP.CreateGPGradientBrush, a linear gradient with spreadMethod pad was mirrored beyond the ends of the gradient line instead of filled with the first and last stop color.
  • Fixed a bug in the same function, gradientTransform on a linear gradient, and a non square bounding box with gradientUnits objectBoundingBox, made the gradient point in the wrong direction.
  • Rewrote the radial gradient part of TSVGContextGP.CreateGPGradientBrush in BVE.SVG2ContextGP.pas, which ignored the focal point fx, fy, ignored cx, cy and r with gradientUnits objectBoundingBox, misplaced stops at uneven offsets, did not paint the area outside the circle and tiled the brush for spreadMethod reflect and repeat.
  • Fixed a bug in the same function, gradient stop colors were interpolated premultiplied instead of with straight alpha, so a gradient between stops with a different opacity came out wrong, for example red to transparent black faded to pink. Also removed the limit of 101 stops on a linear gradient.
  • Fixed visible seams between pattern tiles, TSVGContextGP.GetSupportsBitmapBrush in BVE.SVG2ContextGP.pas now returns True.
  • Fixed a bug in BVE.SVG2ContextGP.pas, procedure TSVGContextGP.ApplyStroke, a bitmap brush stroke and the transparent fallback brush were assigned to the fill brush instead of the stroke brush.
  • Fixed a bug in BVE.SVG2ContextGP.pas, procedure TSVGBitmapGP.Unmap, the color space and premultiplied setting of written data were not taken over by the bitmap, so the pixels were converted a second time and filter results, for example feMerge, came out too dark.
  • Fixed two bugs with stroke line caps in BVE.SVG2ContextGP.pas, stroke-linecap square was drawn as a flat cap, and a subpath of zero length such as M 10 10 L 10 10 was not drawn at all, while a round cap should give a circle and a square cap a square.

Text, style sheets and colors

  • Improved font selection and style application for composite font names like “Roboto Condensed Black” or “Roboto ExtraLight” for font systems BVE.SVG2FontDirectWrite.pas and BVE.SVG2FontGDI.pas
  • Fixed a bug in BVE.SVG2Types.pas, function TSVGIri.AbsIri, a reference with its own scheme was resolved as a path relative to the document, so fonts and style sheets referenced by an http or https url, for example in @font-face or @import, were never loaded.
  • Added support for the CSS generic font family names serif, sans-serif, monospace, cursive, fantasy and system-ui in BVE.SVG2Types.pas, previously they were looked up as font names and the fallback font was used.
  • Added support for XHTML elements in BVE.SVG2Elements.pas, which browsers also accept inside an SVG document. Note: like a style sheet loaded with @import, a linked style sheet is loaded again each time the style sheet is rebuilt.
  • Added support for the hex colors #RRGGBBAA and #RGBA in BVE.SVG2ParseUtility.pas, function TSVGStringParser.ReadColor, previously these were not parsed and the element was painted black.
  • Changed procedure TSVGXMLDocument.FontCollectionAddCustomFont in BVE.SVG2Elements.pas, a font which can not be loaded, for example a WOFF2 font without the Brotli library, no longer stops the document from rendering.

Use and image elements

  • Fixed a stack overflow on reference cycles in BVE.SVG2Elements.pas, procedure TSVGUse.RenderRef and procedures TSVGImage.PaintChildrenContent and TSVGImage.EventCaptureChildrenContent, a use element referencing itself, or an image of an SVG file which shows the image again, crashed the application.
  • Added support for gzip compressed SVG content in BVE.SVG2XMLReader.pas, procedure TSVGXMLReader.ParseStream, for example a .svgz file or gzipped SVG in a data url. Delphi only, on FPC this is still not supported.
  • Changed TSVGImage.DoLoadResource and TSVGFilterImage.DoLoadResource in BVE.SVG2Elements.pas, an SVG image which can not be parsed no longer stops the whole document from rendering.

Masking

  • Fixed a bug in BVE.SVG2Elements.pas, function TSVGObject.GetHasFilter, a filter property on a mask element was applied to the mask, for example an feOffset filter shifted the mask, while the filter property does not apply to mask elements.

Stroking

  • Fixed miter joins in BVE.SVG2ContextD2D.pas and BVE.SVG2ContextGP.pas, procedure ApplyStroke, a miter which exceeds stroke-miterlimit was clipped at the limit instead of drawn as a bevel join, so sharp corners stuck out.

Path data

  • Fixed a bug in BVE.SVG2PathData.pas, function TSVGPathStringParser.ReadArcFlag, any non-zero digit was accepted as arc flag 1 and any character before a flag was skipped, while SVG only allows 0 and 1.
  • Changed TSVGPathStringParser.ParsePath and TSVGPathStringParser.ParsePolygon in BVE.SVG2PathData.pas, an error in path data, or an odd number of coordinates in a polyline or polygon, stopped the whole document from rendering. As SVG 1.1 specifies, the path is now rendered up to the command containing the first error.

Filters

  • Fixed three bugs in feGaussianBlur in BVE.SVG2Elements.pas and BVE.SVG2FilterUtility.pas: the blur was applied in the color space of the input instead of the color space set by color-interpolation-filters, the box widths were not made odd, so a standard deviation of 1 gave no blur at all, and the pixels at the edge of the filter region were repeated instead of treated as transparent.
  • Fixed a bug in BVE.SVG2Elements.pas, function TSVGFilterMerge.GetFilterOutputIndirect, feMerge merged its inputs in the color space of the render buffer instead of the color space set by color-interpolation-filters, so overlapping semi transparent inputs came out too dark.
  • Fixed three bugs in BVE.SVG2Elements.pas, function TSVGFilterTile.GetFilterOutputIndirect: an input clipped by the filter region was stretched over the whole tile, the tiles were drawn at fractional pixel positions which left visible seams, and with the Direct3D 11 render context the colors of tiled filter results came out too dark.
  • Changed TSVGObject.PaintContent in BVE.SVG2Elements.pas, an element whose filter property references a non-existing object, or an object which is not a filter element, is now rendered without a filter, as the Filter Effects specification and browsers do. Previously it was not rendered, as in SVG 1.1.
  • Fixed a bug in BVE.SVG2Context.pas, function TSVGBaseRenderContext.FilterTurbulence, used by the Direct2D WIC and GDI+ render contexts, the noise was shifted by a fraction of a pixel which differed per filter primitive subregion and changed when zooming or panning.

Patterns

  • Changed the default of the define SvgPatternCorrectSeams in CompilerSettings.inc to off, scaling the pattern tile with a pixel distorted the pattern content at the tile edges, for example diagonal lines showed a kink at each tile. The define only affects render contexts without bitmap brush support and patterns with rotation or skew, enable it again if seams appear there.
  • Fixed visible seams between pattern tiles in BVE.SVG2Elements.pas, procedure TSVGPattern.PaintBounds, each tile was drawn at a fractional pixel position, so the anti-aliased tile edges left light lines.
  • Changed TSVGContextD2dWic.CreateBitmap in BVE.SVG2ContextD2D.pas, an odd width is rounded up to an even width only on FPC, where it is needed for blitting to a HBITMAP; on Delphi the extra column was repeated by the pattern bitmap brush.

Performance

  • Improved the speed of feTurbulence for the Direct2D WIC and GDI+ render contexts in BVE.SVG2FilterUtility.pas and BVE.SVG2Context.pas. The output is unchanged, the turbulence calculation is about 9 times faster in Win32 and 2.4 times faster in Win64.
  • Improved the speed of feGaussianBlur for the Direct2D WIC and GDI+ render contexts in BVE.SVG2FilterUtility.pas and BVE.SVG2Context.pas. The output is unchanged, the blur itself is about 2.6 times faster.

Version 2.4 update 23, 3-5-2026

  • Fixed a compilation error for iOS for D13, in BVE.SVG2FontCoreText.pas

Version 2.4 update 22, 12-9-2025

  • Fixed a bug causing embedded fonts in CSS not being loaded
  • Added Package files for Delphi 13

Version 2.4 update 21, 25-7-2025

  • Fixed an out-of-range error on rendering text, by filtering out unicode control characters.
  • Fixed a bug in BVE.SVG2Elements.pas, changed procedure TSVGText.ProcessWhitespace1 to ignore the soft hyphen character U+00AD, because this resulted in een text rendering error. Also, the supported SVG version does not support word breaking.
  • Fixed a bug in BVE.SVG2Context TSVGSchemaWriter, forced US format of decimal characters.

Version 2.4 update 20, 9-11-2023

Added package files for Delphi 12.

Version 2.4 update 19, 1-4-2023

XML

  • Added class method ClassRegisterDocBinding to TSVGXMLDocument to enable registering element classes before the TSVGXMLDocument object creation.

Patterns

  • The pattern tile is increased with one pixel to decrease the chance on seams. This can be enabled/disabled with define “SvgPatternCorrectSeams”

Text

  • Fixed an “out of range” bug and some other issues in Bidi text and direction processing
  • Made a change to “text to path” functionality, the original id of the converted text elements is transferred to the resulting g elements, previously this was set to id=”text”.
  • Fixed a bug in BVE.SVG2GeomUtility function PtOnPoly, causing textPath on multiple paths not to continue on the next path
  • Fixed a bug which caused invalid dy calculations on textPaths
  • Fixed a typo in ISVGGlyphRun.Addvances -> Advances

Paths

  • Fixed a bug in BVE.SVG2PathData function TSVGPathStringParser.ParseDrawToCommands, shorthand/smooth quadratic bezier path parsing (t, T) was not correct.

CSS

  • Fixed a bug which caused errors in css parsing if comment elements <!– … –> where embedded in the css.
  • Fixed a bug in css pseudo-class “nth-child”, elements are 1 based, not 0 based.
  • Added css pseudo classes nth-of-type, first-of-type, last-of-type.
  • Fixed a bug in CSS animation in which animation properties did not cascade.
  • Fixed a bug in CSS animation which caused incorrect animation if the keyframe rules where not defined in increasing order in the stylesheet.

Filters

  • Changed the way that ColorSpace and Premultiplied conversions on intermediate buffers are applied, this fixes a number of color and gamma errors.
  • Fixed a bug unit in BVE.SVG2Elements, procedure TSVGObject.PaintBufferIntermediateAndApply which resulted in incorrect filter rendering in some cases.
  • Fixed a bug in TSVGContextD2d3D11.FilterComponentTransfer resulting in Linear and Gamma functions not working.
  • Fixed a bug in TSVGContextD2d3D11.FilterBlend, TSVGContextD2d3D11.FilterComposite, TSVGContextD2d3D11.FilterDisplacementMap which could result in a wrong translation before applying the effect.

DLL and Multi threading

  • Fixed a bug which caused FinilizeGraphics not being called if render context SVGDirect2d3D11 is used in a DLL.

Version 2.2 update 15, 12-10-2022

Changed FreeAndNil(<interface var>) into <interface var> := nil

Changed Type ExtendMode from Integer to D2D1_EXTEND_MODE (in case of compiler version 350 and up = D11)

Changed all enumerations, for example Brush = TBrushKind.bkSolid to TBrushKind.Solid in case of compiler version 350 and up (mostly in FMX).

Version 2.4 update 18, 22-12-2021

Fixed a bug in BVE.SVG2Elements.pas, procedure TSVGText.SelectGlyphs, which could cause an “Out of range” exception if bidi control characters are present in text.

Fixed a number of bugs in the TSVG2ImageList “Entity” functionality and image list designer.

Added classes TSVGRenderContextFactory and TSVGFontSystemFactory to units BVE.SVG2Elements.VCL, BVE.SVG2Elements.FMX and BVE.SVG2Elements.FPC for more control on how and when the OS dependent render context types and and font system types are selected.

Added code to the TSVGRenderContextManager to check if the WIC render context is supported.

Version 2.4 update 17, 12-11-2021

Fixed function TSVGPaint.GetAsString: TSVGUnicodeString; in BVE.SVG2Types.pas, for converting the record back to text.

Fixed function function ColorToCSSColor(Value: TColor): string; in BVE.SVG2Elements.VCL.pas, alpha component should be the last digits.

Fixed a bug in unit SVG2.Elements.pas procedure TSVGXMLDocument.ElementRegister and procedure TSVGXMLDocument.ElementUnregister, the wrong element could be registered or unregistered if there are multiple elements with the same id attribute.

Fixed a bug in XMLImportNode in unit BVE.SVG2Dom, which caused new elements with an id attribute not to be registered in the SVG document ElementIndex.

Version 2.4 update 16, 26-10-2021

Fixed a bug in BVE.SVG2Control.FPC.pas, SVG renderings were not correctly displayed on a high retina display on MacOS.

Fixed a bug in TSVG2BaseView, unit BVE.SVG2Doc.pas, which caused mousepointer positions for SVG controls not to be calculated correctly if the monitor scaling is greater then 100%.

Fixed a bug in BVE.SVG2Elements.pas, TSVGPathShape, empty paths are now excluded from size calculations and mousepointer calculations.

Fixed a bug in PathData “ApplyMatrix”, the matrix was not applied to the variables FFirstpoint and FLastPoint in the root class.

Added a workaround for GDI+ GraphicPath.GetBounds, which returns (0,0,0,0) for path M20,20 L20,20. This should be (20,20,20,20).

Version 2.4 update 15, 23-9-2021

Fixed a bug in TSVGFormatter: CData element was not parsed

Fixed a bug in TSVGXMLReader.ParseCData: element closure “]>” was not consumed

Fixed a bug in TSVGXMLReader.ReadExtraBuffer: buffer length was overwritten on Freepascal

Fixed a bug in BVE.SVG2ContextFMX.pas”: TTextAlign.taLeading was not changed in TTextAlign.Leading for D11

Fixed a bug in BVE.SVG2ContextQuartz, datatype Single needed to be changed to CGFloat, which caused gradients not to be rendered on MacOS64

Added method IsScaled to TSVG2BaseImageList for D11, for HDPMI compatibility

Added TSVGContextQuartzPrintJob for render context Quartz (MacOS)

Made a global for the standard internal DPI: SVG_StdDPI in BVE.SVGTypes

Version 2.4 update 14, 11-9-2021

Fixed a bug in BVE.SVG2Doc.pas, procedure TSVG2CustomAnimationTimer.CalcFPS; that caused an arithmatic overflow in certain conditions.

Added project files for Delphi 11 Alexandria

Removed version 2.3 from the source code zip file. If you need older versions of the package, you can send me an request by mail.

Version 2.4 update 13, 31-8-2021

Fixed a bug in BVE.SVG2FontCoreText.pas that caused SVG fonts not to be rendered on MacOS and iOs.

Fixed a bug in BVE.SVG2Elements.FPC.pas that caused a compilation error on TSVGRenderContextManager.CreatePrintJob on FPC for MacOS.

Made some optimizations in Filter convolve algorithm.

Added missing code in BVE.SVG2ContextGP.pas for assigning and copying GDI+ pathdata.

Added a check and work around in BVE.SVG2FontGDI.pas in case glyphs are missing for a particular font.

Version 2.4 update 12, 7-7-2021

Fixed a bug in BVE.SVG2Graphic.VCL: after calling TSVG2Graphic.LoadFromFile or TSVG2Graphic.LoadFromStream the SVG document was not automatically parsed on rendering, resulting in a blank image.

Version 2.4 update 11, 3-7-2021

Fixed a bug in BVE.SVG2Elements.FPC TSVGRenderContextManager.CreatePrintJob: added missing parameters.

Fixed a bug that caused printer settings not being applied if printing with GDI+ render context.

Fixed a bug in the text rendering algorithm: the delta x or y of a character was ignored if an absolute x or y was also defined for the character.

Fixed a bug BVE.SVG2FontGDI.pas that caused incorrect placement of glyphs in case of very small font sizes.

Fixed a bug in calculating text positions in case of TSVGTextFormattingOption is tfoStringsWithPlacedCharacters.

Fixed a bug that caused a gradient not to be applied correctly over multi line text in case of Direct2D.

Added class function “Capabilities: TSVGRenderContextCapabilities;” to render context classes, for interrogating the capabilities of a render context.

Added class TBitmapCodecSVG to unit BVE.SVG2Elements.FMX. This is a bitmap codec for loading SVG files.

Added functionality to BVE.SVG2ContextGP.pas and BVE.SVG2FontGDI.pas for improved font selection when rendering text with GDI+.

Version 2.4 update 10, 7-6-2021

Fixed a bug in unit BVE.SVG2ContextD2D procedure TSVGPathDataD2D.AddPathData(const aPathData: ISVGPathData; const aMatrix: TSVGMatrix); which caused the existing pathdata to be discarded.

Fixed a bug in unit BVE.SVG2PathData which resulted in FPointCount and FLastPoint not being updated after a call to AddPathData

Fixed a bug which caused the renderer not updating the object cache after setting an attribute with TSVGElement.SetAttribute, solved by calling ObjectCacheInvalidate.

Added procedure ObjectCacheInvalidate(aParentCache: ISVGObjectCache); to ISVGObject, this decreases the object cache version and of its children, so the cache will be updated on the next render

Added procedure SetPathDataList(aRoot: ISVGRoot; const aValue: ISVGPathDataList); to ISVGPathShape to directly set de pathdata

Registered PidOSX64 on FMX components from DX10.1 Berlin onwards

Version 2.4 update 9, 18-4-2021

Added a member “property Data: Pointer” to TSVGElement (ISVGELement) to link application-defined data

Added function “PointInStroke” to TSVGRectangle, TSVGCircle, TSVGEllipse

Added Event “OnRenderSVGObject(const Value: TProcRenderSVGObject);” on TSVGRoot, this is called when an element is about to be rendered.

Added members “function Invalidated(const aBounds: TSVGRect): Boolean;” “procedure InvalidateRect(const aRect: TSVGRect);” and “property UpdateRectList: TList read GetUpdateRectList;” to TSVGRoot. These can be used to restrict rendering to the supplied rectangles for efficiency.

Added “rsCalcCache” to the TSVGRenderMode. When this is included in the TSVGRoot.RenderMode then only the element cache will be recalculated, no actual painting will take place.

Fixed a bug which caused TSVGPathData.Count to be inconsistent. It will now return the TSVGPathPoint count, including M and Z.

Fixed a bug in TSVGPathDataD2D.AddPathData which caused figures not be closed if open and closed figures where both present in a geometry

Fixed a bug which caused animated elements not being updated if sroPersistentBuffers was included in the TSVGRoot.RenderOptions.

Fixed a bug in BVS.SVGDOM.pas in setAttributeNodeNS and setAttributeNS function tryFindNamedItemNS was called width a qualified name instead of a local name.

Fixed a bug in TSVGPathData that could cause an access violation, because the FPolygonList was not assigned

Fixed a bug in the adaptive delay in TSVG2CustomAnimationTimer.CalcInterval that caused animations to run unstable

Fixed a bug in SVG2ImageListEditor.FMX.pas which caused item selection in lists present in the FMX SVG image list component editor not to function as expected.

Fixed a bug in SVG2ImageListEditor.FMX.pas which caused updates in the StyleStringValues control in the FMX SVG image list component editor not to function as expected.

Version 2.4 update 8 amendment, 24-3-2021

Fixed a bug in which DpiY and height parameters where swapped in TSVGContextD2dPrintJob.BeginPage

Forgot to enable {$Define SVG_2} in CompilerSettings.inc, which will cause transform parameter in css to be disabled

Version 2.4 update 8, 21-3-2021

Added support for custom font collections (for text layouts GDI and DirectWrite)

Added support for rendering to (PDF) printer (for render contexts GDI+ and Direct2D and FMX canvas)

Added support for rendering text through the render context (for outputting text in stead of only glyph contours to PDF documents)

Added support for rendering to command lists (GDI+ EMF metafile and Direct2D command list) and drawing command lists

Added events for loading external and embedded resources

Added classes TSVGParserThread, TSVGParserQueue in unit BVE.SVG2SaxParser.pas for parsing SVG in a threads

Added classes TSVGRenderThread, TSVGRenderQueue in unit BVE.SVG2Elements.pas for rendering SVG’s in a threads

Added ESvgRcException, ESvgRcD2dException, ESvgRcGPException to enable intercepting render context (resp. Direct2D, GDI+) exceptions

Removed minimize buttons from TSVG2ImageList component editor dialog

Fixed a bug with selecting the first SVG in the TSVG2ImageList FMX component editor

Added function to save the source SVG’s from the TSVG2ImageList FMX component editor

Fixed a bug in the TSVGPathDataIteratorGP object, which missed a “close” command in some cases

Fixed a bug which caused indent spaces to be included in text, when saving XML document to file

Fixed a bug that if an attribute value was invalid, it was not ignored

Fixed a bug that when an element was removed from a document, it’s childerd where not unregisterd from the document, which could cause an access violation.

Version 2.4 update 7, 9-2-2021

Added options for rendering text in EMF files, see documentation and RenderToEMF example.

Added property “HideDesignRect” in the SVG controls, see documentation.

Added an optimization that if a clipPath is a simple axis aligned rectangle, this will be rendered as a simple cliprect, in stead of creating an alpha bitmap buffer.

Added property “FontFaceList” on the “ICSSStyleSheet” interface, so it is possible to iterate through the font faces defined in a cascading style sheet.

Fixed a bug on TSVG2ImageList that prevented re-render of images to match monitor scale on loading of the component.

Fixed a bugs in the GDI text layout, that prevented the correct font face being selected.

Fixed a bug that caused SVG fonts defined in a style sheet not being selected.

Version 2.4 update 6, 16-1-2021

Fixed a bug parsing CData element in BVE.SVG2XMLReader. This bug resulted in the first character of the data not being read.

Added a compiler switch “SvgCtrlExceptionsOff” in CompilerSettings.inc. If enabled than the exception that is raised if you try to load a non-existing SVG file in one of the SVG controls, will be suppressed and the error will be displayed in the SVG control window in stead. This switch is enabled by default.

Version 2.4 update 5, 3-1-2021

Fixed a bug in TSVG2ImageList, style names where not saved.

Fixed a bug in TSVG2ImageList, custom style svg definition was not saved.

Fixed a bug in TSVG2ImageList for Fmx, if a style was deleted the images disappeared from the grid of the designer.

Fixed a bug which caused an exception if a text child has attribute display=”none” defined.

Added a check that entity names are valid in BVE.SVG2XMLReader.

Added a check that attribute names are preceded with a space in BVE.SVG2XMLReader.

Version 2.4 update 4, 13-12-2020

Fixed bug, when used in a dll, Direct2D or GDI+ must be initialized/finalized
explicitly. However, a bug prevented Direct2D to be finalized correctly which
resulted in the dll not to being unloaded.

Fixed bug, animations in TSVG2Control and TSVG2Image did not start automatically.
only when rendered first, before the animation timer was started.

Fixed bug, sometimes, on closing the application, the SVG controls are not
correctly unregistered from the animation timer which caused an exception.

Version 2.4 update 3, 28-10-2020

Fixed bug, compilation error if render context GDI+ (SVGGDIP) was selected

Changed parameter aPt in VCL “ObjectAtPt” function from TPointF to TSVGPoint

Version 2.3 and 2.4 21-10-2020

Fixed bug, compiler error in BVE.DX.DXGI.pas if compiled with “emit runtime type information” enabled

Version 2.2, 2.3 and 2.4 21-10-2020

Fixed bug, arc segments with very large radius where not rendered correct on Direct2D

Version 2.4 16-10-2020

Added SVG/SMIL and CSS animation

Added new control TSVG2DirectXControl for VCL, enabling smooth GPU enabled animation

Added support for different XML vendor implementations

Added functionality TextToPath

Disabled range checking in SaveBitmapAsPng procedure in SVG2Elements.VCL

Version 2.3 update 11, 17-10-2020

Fixed problem with compiling in Delphi 10.4 update 1, TCall members made public in BVE.SVG2Types

Version 2.3 update 10, 12-10-2020

Fixed a bug in parsing the end parenthesis of “matrix(…)” in the “transform” attribute which could cause wrong transformation calculations in certain SVG images.

Version 2.3 update 9, 30-9-2020

Enabled reordering of SVG’s in TSVG2ImageList

Changed order of “Ok” and “Cancel” knobs on designer of TSVG2ImageList

Added a component editor to the SVG controls for loading large SVG file and added compression when SVG files are stored in the form file.

Fixed bug: “Scaled” property was not copied on assign of TSVG2ImageList

Fixed bug: Connected TSVG2LinkedImageLists are not rebuild after assign of TSVG2ImageList

Fixed bug: On FMX the element bounds were not calculated correctly, which caused mousepointer events not being fired.

Fixed bug: When Direct2D and GDI+ render contexts are both enabled, this causes an error when Direct2D is not available on the system. Fixed this by adding “delayed” to the external function declarations.

Fixed some bugs in the rendering procedures.

Version 2.3 update 8, 16-9-2020

Fixed a new bug, introduced in update 7, for positioning the filter source background buffer

Version 2.3 update 7, 12-9-2020

Fixed a bug calculating position of the filter source buffer and filter background buffer.

Fixed a problem in function “PNG4TransparentBitMap” that caused compilation errors if compiling with range checking enabled.

Added default font names for Android in unit BVE.SVG2Types.

Fixed a bug that caused incorrect mousepointer location calculations.

Version 2.3 update 6, 27-5-2020

Added packages en files for Delphi 10.4 Sydney.

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

Important!

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
See https://github.com/graphics32/graphics32
– For Delphi VCL, FPC/Lazarus

Updated RC Aggpas
See https://github.com/CWBudde/AggPasMod
– For Delphi VCL, FMX

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

SVGFontDirectWrite
– for Windows

BVE.SVG2FontGDI
– for legacy Windows

BVE.SVG2FontCoreText
– for Mac, iOS

BVE.SVG2FontFreetype
– 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 CompilerSettings.inc

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

BVE.SVG2XMLReader.pas

Added, XML reader for the SAX parser

BVE.SVG2SaxParser.pas

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

BVE.SVG2Parser.pas

Removed, the old (DOM) parser

BVE.SVG2CSSUtility

Added CSS font selection rules

BVE.SVG2PathData.pas

Added Quadratic bezier
Faster copying of PathData

BVE.SVG2Attributes.pas

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

BVE.SVG2Intf.pas

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

BVE.SVG2Elements.pas

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

BVE.SVG2Graphic.VCL.pas

Added, component TSVG2Graphic for VCL derived from TGraphic

BVE.RenderContextDirect2D.VCL.pas

Rewrote the unit to support masking

BVE.SVG2Control.VCL.pas

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

BVE.SVG2Image.VCL.pas

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

BVE.SVG2ImageList.VCL.pas

Reworked to support the SAX parser

BVE.SVG2LinkedImageList.VCL.pas

Added

BVE.SVG2Control.FMX.pas

Reworked to support the SAX parser

BVE.SVG2Image.FMX.pas

Reworked to support the SAX parser

BVE.SVG2ImageList.FMX.pas

Complete rewrite

Version 2.01, 1-11-2015

BVE.SVG2Intf.pas

Added event type TSVGOnCreateObjectEvent
Added event type TSVGOnCreatTextChildEvent

BVE.SVG2Parser.pas

Implemented events TSVGOnCreateObjectEvent and TSVGOnCreatTextChildEvent

BVE.SVG2Control.FMX.Pas

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

BVE.SVG2Control.VCL.Pas

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

BVE.SVG2Image.FMX.PAS

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