Skip to content

Releases: arklumpus/VectSharp

Version 2.6.0

20 Jul 18:57
Compare
Choose a tag to compare

New features

  • Added support drawing text with spacing (#64)
  • Added support for complex dash patterns (#67)

VectSharp.Markdown

  • Added support for emojis (#63)

VectSharp.Plots

  • Added swarm plots.

Bugfixes

  • Fixed bug with animated gif frame disposal.

VectSharp.PDF

  • Ensure that alpha values 0 and 1 are always included in the document.
  • Use code generation instead of reflection to enumerate dictionary properties. This restores support for trimmed and AOT publication.

VectSharp.SVG

  • Fixed issue with importing filled ellipses in SVG documents.

VectSharp.Plots

  • Fixed issues with the coordinate system when the resolutions on the X axis and the Y axis are different.

Version 2.5.1

07 Apr 13:20
Compare
Choose a tag to compare

New features

  • The [Pure] attribute has been added to methods whose return value should not be ignored (#60). Note that this does not necessarily imply that the method is actually pure - just that you probably do not want to ignore its return value.

VectSharp.PDF

VectSharp.Raster

  • Added JPEG output support to VectSharp.Raster (using MuPDF).

Version 2.5.0

06 Nov 13:45
Compare
Choose a tag to compare

New features

  • New TrueTypeFile.GetNames methods to get the font name(s) defined in a TrueType file.
  • New FolderFontLibrary class (to parse fonts from a folder) and MultiFontLibrary class (to parse fonts using multiple font libraries).
  • New +, -, and * operators for the Point class.
  • New methods to monotonise segments and to flatten paths and segments.
  • New Reverse method to reverse a GraphicsPath.
  • New GraphicsPath.GetStroke method to get the stroke of a path.
  • New GraphicsPath.ContainsPoint method to check whether a path contains a point.
  • New overload of the Graphics.FillPath method, accepting a FillRule argument that determines the fill rule (non-zero winding number, or even/odd number of contours).

VectSharp.Canvas

  • Support for Avalonia 11.

VectSharp.Plots

  • Added property to specify the maximum number of bins for violin plots.

VectSharp.Raster.ImageSharp and VectSharp.ImageSharpUtils

  • Two new versions of these packages, one with ImageSharp.Drawing updated to 1.0.0 and the other to 2.0.1.
    • Versions using ImageSharp.Drawing 1.0.0 target netstandard2.0, while the latest versions target net6.0 (like ImageSharp).

Bugfixes

  • Attempting to draw a null or empty string should not throw an exception anymore.

VectSharp.SVG

  • SVG documents containing text that uses font families that are included in the default font library now work properly.
  • Font style attributes are now propagated properly when parsing SVG documents.
  • Clipping paths defined by rect objects now work properly.
  • Improved text positioning.
  • Units other than px are now allowed when parsing SVG documents.
  • Fixed issue that occurred when multiple path data point coordinates < 1 were specified using only the . as a separator.
  • Gradients with relative units are now supported when parsing SVG documents.
  • text-anchor is now supported.
  • Entities defined outside of a defs tag are now supported.
  • Fixed issues with SVG animations on Chrome and Firefox.

VectSharp.Plots

  • Fixed issue with label centering.

Version 2.4.2

16 Apr 15:49
Compare
Choose a tag to compare

New features

  • The Graphics class now has a UseUniqueTags property. If this is true (the default), all plot actions called with a tag parameter attempt to create unique tags. Otherwise, they use the tag as is (e.g., using the same tag for multiple sub-elements), which was the previous behaviour until v2.4.0.
  • Added an extension method GetText on IEnumerable<FormattedText>.
  • There are now a number of standard gradients in the VectSharp.Gradients static class.
  • Added an implicit conversion operator between GradientStops and Func<double, Colour>.
  • New option for text when exporting SVG images. The ConvertIntoPathsUsingGlyphs option converts the font in paths, but only stores each glyph once and reuses it. Compared to ConvertIntoPaths, this produces smaller files, while still being independent of the original font file.
  • VectSharp.Point now implements IReadOnlyList<double> and has a number of conversion methods to and from tuples and arrays.
  • New VectSharp.Plots package to draw many kinds of plots (e.g., scatter plots, line charts, bar charts, box plots, function plots, and more).

Bugfixes

  • Fixed issues with some symbols in PDF documents (#43).

Version 2.4.0

25 Dec 00:02
Compare
Choose a tag to compare

New features

  • Added the GetFigures method to the GraphicsPath class, to extract figures (contours) from a path.
  • Added an optional tag parameter to a number of graphics actions that were missing it (crop, transforms, filters, clipping paths).
  • Individual text components now have their own tags (e.g., underlines, individual glyphs when drawing text on a path, or individual text spans when drawing an IEnumerable<FormattedText>.
  • Added the GetColourAt method to the GradientStops class, to get the colour at a certain position in a gradient.
  • Added a new Crop method to the Graphics class, which removes graphics actions that fall completely outside of the crop region. The Crop method of the Page class now has an optional parameter that determines whether this kind of "hard" cropping should be performed or not.
  • VectSharp.Raster now has a new method SaveAsRawBytes to render a Page to raw pixel data.
  • The GraphicsPath.Linearise method now uses multiple threads to speed up execution.
  • The Rectangle struct now has a Centre property that returns the centre of the rectangle.
  • Added the GetTags method to the Graphics class to get all the tags that have been defined in the Graphics.
  • Animations! VectSharp can now be used to create animated GIFs, SVGs and PNGs. See the documentation website for more details. The demo project also has some more example code.

Bugfixes

  • In PDF documents with semi-transparent gradients, the gradient alpha mask now does not persist after the gradient has been applied.
  • Boundaries are now computed correctly for paths containing arcs with negative angles.
  • The correct scale is now applied when rasterising filters in VectSharp.Raster.
  • Fixed an issue in the SVG parser when parsing paths with symmetrical Bezier control points.

Version 2.3.2

01 Sep 17:11
Compare
Choose a tag to compare

New features

  • Added new methods to the Rectangle struct (Rectangle.IsNaN and Rectangle.Intersection).
  • Added the QuadraticBezierTo method to the GraphicsPath class, which makes it possible to draw quadratic Bézier curves (these are internally elevated to cubic Béziers).
  • VectSharp.Markdown now renders equations using CSharpMath instead of using a remote GitHub server.

Bugfixes

  • Clipping paths are now properly taken in consideration when determining the bounds of a plot.
  • Bounding boxes for radial gradients are now computed properly in VectSharp.PDF.
  • VectSharp.SVG now attempts to skip XML declarations (<?xml ... ?>) when parsing SVG files.

Version 2.3.1

14 Jun 16:27
Compare
Choose a tag to compare

New features

  • Added an overload of the DrawGraphics method that accepts a tag parameter.
  • Updated ImageSharp.Drawing version in VectSharp.Raster.ImageSharp to 1.0.0-beta14.16 - this introduced an API change, and requires the ImageSharp MyGet source to be enabled to download the latest version of ImageSharp.Drawing.

Bugfixes

  • Prevent out of memory exception in ImageSharp when drawing lines with a stroke width of 0 (#32).
  • Line joints are now drawn correctly when using VectSharp.Raster.ImageSharp.
  • When loading an SVG with VectSharp.SVG, object ids are now preserved and transformed into tags.
  • When loading an SVG with VectSharp.SVG, non-breaking spaces are now converted back into regular spaces.
  • In VectSharp.Markdown, data URIs containing SVG images are now parsed directly as SVG images, rather than being embedded within another SVG image.
  • When creating a PDF file, the standard font family names should now be used correctly.
  • Avoid exception in ImageSharp by not drawing a raster image if it does not overlap the target image at all (#33).

Version 2.3.0

02 May 14:54
Compare
Choose a tag to compare

New features

  • Added option to use CSS style classes for presentation attributes (#24).
  • Added Discretise method to GraphicsPath. This is similar to Linearise, but it additionally ensures that each segment does not exceed the specified length (if necessary, by breaking long line segments into smaller segments).
  • Added AddPath method to GraphicsPath. This makes it possible to add a figure represented by an existing GraphicsPath to another GraphicsPath.
  • Updated dependencies.

Bugfixes

  • Return null instead of throwing exception when trying to parse an invalid CSS colour string starting with #.
  • Fixed kerning-related exception in some fonts.
  • Fixed bug causing some standard fonts not to be displayed correctly in PDF documents.

Version 2.2.1

14 Feb 02:35
Compare
Choose a tag to compare

New features

  • Updated the documentation website with much more detailed tutorials and interactive WebAssembly examples.
  • Added a parameterless overload to the Page.Crop method, that crops the page based on the bounds of its contents.
  • Added the FontFamily.FamilyName property to get the full name of a font family.
  • Added an overload of the Graphics.Transform method that reduces the maximum length of line segments (useful for non-projective transformations).

Bugfixes

  • Out-of-range correction of the radii for elliptical arcs is now performed correctly.
  • Béziers that are actually straight lines are now handled properly when determining the intersections for text underlines.
  • SVG text with kerning information is now imported correctly.
  • Normalisation and bias are now actually applied in the ConvolutionFilter.
  • Cropping a Page more than once now works as expected.
  • Embedding multiple fonts in the same family in a PDF document now works as expected.

Version 2.2.0

04 Feb 20:24
Compare
Choose a tag to compare

New features

  • Graphics.GetBounds and GraphicsPath.GetBounds methods to compute bounding boxes.
  • If VectSharp.Raster or VectSharp.Raster.ImageSharp are installed, Graphics.TryRasterise method can be used to rasterise a region of a Graphics object (otherwise, it will return false without throwing an exception). A custom implementation for Graphics.RasterisationMethod can be provided.
  • Added support for filters through the IFilter interface and its implementations.
    • This make it possible to create e.g. drop shadows:

    • When a filter is supported by the output format (e.g. a Gaussian blur filter in SVG), the filter is rendered appropriately (e.g. by using a SVG element).

    • When a filter is not supported by the output format (e.g. in PDF), the filtered image is rasterised while exporting the file. This requires either VectSharp.Raster or VectSharp.Raster.ImageSharp to be available; alternatively, a custom implementation for Graphics.RasterisationMethod can be provided.

Bugfixes

  • Fixed a few bugs involving gradients in VectSharp.PDF (especially gradients with transparent colours).