Skip to content

Releases: swhitty/SwiftDraw

SFSymbol

03 Jan 00:25
cabfd9f
Compare
Choose a tag to compare

Adds optional --output to Command-line tool. If provided this path is used, otherwise a suffix is automatically appended to input path.

Fixes bugs

  • UIImage was scaled twice #12.
  • fill-rule was defaulting to evenodd when it should be nonzero
  • macCatalyst support
  • Better support for stroke gradients #17
swiftdraw, version 0.13.2
copyright (c) 2022 Simon Whitty

usage: swiftdraw <file.svg> [--format png | pdf | jpeg | swift | sfsymbol] [--size wxh] [--scale 1x | 2x | 3x]

<file> svg file to be processed

Options:
 --format      format to output image: png | pdf | jpeg | swift | sfsymbol
 --size        size of output image: 100x200
 --scale       scale of output image: 1x | 2x | 3x
 --insets      crop inset of output image: top,left,bottom,right
 --precision   maximum number of decimal places
 --output      optional path of output file

 --hideUnsupportedFilters   hide elements with unsupported filters.

Available keys for --format swift:
 --api                api of generated code:  appkit | uikit

Available keys for --format sfymbol:
 --insets             alignment of regular variant: top,left,bottom,right | auto
 --ultralight         svg file of ultralight variant
 --ultralightInsets   alignment of ultralight variant: top,left,bottom,right | auto
 --black              svg file of black variant
 --blackInsets        alignment of black variant: top,left,bottom,right | auto

SFSymbol

07 Oct 20:10
1201e6c
Compare
Choose a tag to compare

Adds optional --output to Command-line tool. If provided this path is used, otherwise a suffix is automatically appended to input path.

Fixes bugs

  • UIImage was scaled twice #12.
  • fill-rule was defaulting to evenodd when it should be nonzero
  • macCatalyst support
swiftdraw, version 0.13.2
copyright (c) 2022 Simon Whitty

usage: swiftdraw <file.svg> [--format png | pdf | jpeg | swift | sfsymbol] [--size wxh] [--scale 1x | 2x | 3x]

<file> svg file to be processed

Options:
 --format      format to output image: png | pdf | jpeg | swift | sfsymbol
 --size        size of output image: 100x200
 --scale       scale of output image: 1x | 2x | 3x
 --insets      crop inset of output image: top,left,bottom,right
 --precision   maximum number of decimal places
 --output      optional path of output file

 --hideUnsupportedFilters   hide elements with unsupported filters.

Available keys for --format swift:
 --api                api of generated code:  appkit | uikit

Available keys for --format sfymbol:
 --insets             alignment of regular variant: top,left,bottom,right | auto
 --ultralight         svg file of ultralight variant
 --ultralightInsets   alignment of ultralight variant: top,left,bottom,right | auto
 --black              svg file of black variant
 --blackInsets        alignment of black variant: top,left,bottom,right | auto

SFSymbol

31 Aug 22:45
e1317c1
Compare
Choose a tag to compare

Adds optional --output to Command-line tool. If provided this path is used, otherwise a suffix is automatically appended to input path.

Fixes bugs

  • UIImage was scaled twice #12.
  • fill-rule was defaulting to evenodd when it should be nonzero
swiftdraw, version 0.13.1
copyright (c) 2022 Simon Whitty

usage: swiftdraw <file.svg> [--format png | pdf | jpeg | swift | sfsymbol] [--size wxh] [--scale 1x | 2x | 3x]

<file> svg file to be processed

Options:
 --format      format to output image: png | pdf | jpeg | swift | sfsymbol
 --size        size of output image: 100x200
 --scale       scale of output image: 1x | 2x | 3x
 --insets      crop inset of output image: top,left,bottom,right
 --precision   maximum number of decimal places
 --output      optional path of output file

 --hideUnsupportedFilters   hide elements with unsupported filters.

Available keys for --format swift:
 --api                api of generated code:  appkit | uikit

Available keys for --format sfymbol:
 --insets             alignment of regular variant: top,left,bottom,right | auto
 --ultralight         svg file of ultralight variant
 --ultralightInsets   alignment of ultralight variant: top,left,bottom,right | auto
 --black              svg file of black variant
 --blackInsets        alignment of black variant: top,left,bottom,right | auto

SF Symbol

25 Aug 07:53
8b06511
Compare
Choose a tag to compare

Renames SwiftDraw.Image -> SwiftDraw.SVG avoiding name collisions with SwiftUI.Image.

Updates command line tool:

  • officially support SF Symbol creation using --format sfsymbol
  • add ability to crop or align images with --insets 10,0,0,10
  • adds AppKit support with --format swift --api appkit
  • fixes PDFs rendering with unsupported transparency
copyright (c) 2022 Simon Whitty

usage: swiftdraw <file.svg> [--format png | pdf | jpeg | swift | sfsymbol] [--size wxh] [--scale 1x | 2x | 3x]

<file> svg file to be processed

Options:
 --format      format to output image: png | pdf | jpeg | swift | sfsymbol
 --size        size of output image: 100x200
 --scale       scale of output image: 1x | 2x | 3x
 --insets      crop inset of output image: top,left,bottom,right
 --precision   maximum number of decimal places

 --hideUnsupportedFilters   hide elements with unsupported filters.

Available keys for --format swift:
 --api                api of generated code:  appkit | uikit

Available keys for --format sfymbol:
 --insets             alignment of regular variant: top,left,bottom,right | auto
 --ultralight         svg file of ultralight variant
 --ultralightInsets   alignment of ultralight variant: top,left,bottom,right | auto
 --black              svg file of black variant
 --blackInsets        alignment of black variant: top,left,bottom,right | auto

SFSymbol & Style Sheet Support

21 Aug 23:21
9d61888
Compare
Choose a tag to compare

SFSymbol

Adds experimental sfsymbol support to command line tool. SVGs can be converted to SFSymbol template which can be imported directly into Xcode.

$ swiftdraw alert_fill.svg --format sfsymbol

SwiftDraw automatically expands strokes (on macOS) and winds subpaths using the non zero rule to create a compatible symbol template.

Style Sheet

Adds style sheet support for simple selectors: class, element and id.

.s {
   stroke: darkgray;
   stroke-width: 5 /* asd */;
   fill-opacity: 0.3
}

#a {
   fill: yellow;
}

.b {
   fill: blue;
}

rect {
   fill: pink;
}

Fix Default Gradient Stop Color

18 Aug 04:04
3ce2c41
Compare
Choose a tag to compare

Fixes the default color for gradient stop-color is not defined within a gradient.

RadialGradient Stroke

17 Aug 07:47
21d4520
Compare
Choose a tag to compare

Adds ability to stroke a path with a radial gradient.

Enhances error logging to ensure it is logged to stderr and includes details of erroneous SVG line / file where appropriate.

Image.Options

Adds Image.Options to provide a way for the client to control how the SVG is rendered.

A single option is provided .hideUnsupportedFilters which hides any SVG element that includes an unsupported filter. This option is not enabled by default. Images with unsupported filters render without the filter but log to stderr with a platform specific hint pointing to the option;

Warning: <feGaussianBlur> is not supported. Elements with this filter can be hidden with UIImage(svgNamed: "yawn.svg", options: .hideUnsupportedFilters)

Warning: <feGaussianBlur> is not supported. Elements with this filter can be hidden with NSImage(svgNamed: "yawn.svg", options: .hideUnsupportedFilters)

Warning: <feGaussianBlur> is not supported. Elements with this filter can be hidden with [--hideUnsupportedFilters]

LinearGradient Stroke

16 Aug 00:49
4dddf4b
Compare
Choose a tag to compare

Adds ability to stroke a path with a linear gradient.

RadialGradiant Improvements

14 Aug 23:58
09cbb08
Compare
Choose a tag to compare

Supports radial gradient focal points

RadialGradient

13 Aug 01:46
d25f77c
Compare
Choose a tag to compare

Initial support for radial gradients