Repository navigation
Thank you @sakamura 🙏
Most of this release comes from @sakamura's roadmap in #142, a huge, carefully researched effort to bring SwiftDraw's rendering in line with the browsers. To land it safely we first built swiftdraw-diff (#148), which scores every sample against WebKit, then cherry-picked each roadmap item into its own PR with his original commits preserved. Items from #142 are marked ⭐.
Highlights
Filters
- ⭐
feGaussianBlur(#159), plusfeOffset,feFlood,feComposite,feMerge,feBlendandfeColorMatrixwith a full filter graph (#175) feDropShadow(#181)- New options:
disableFiltersdraws filtered elements without applying the filter;hideUnsupportedFiltershides elements whose filters can't be rendered (#159)
Painting and structure
- ⭐
stroke-dasharrayandstroke-dashoffset(#147) - ⭐ Complete
<pattern>support, including fill resets and paint fallbacks (#149, #151) - ⭐ Gradient
spreadMethodand single-stop gradients (#168), gradient inheritance throughhrefby @fishloa (#143), and correctobjectBoundingBoxgradients (#166) - ⭐ Clip paths and masks to spec (#169), masks with translucent contents (#162) and
mask-type: alpha(#164) - ⭐
displayandvisibility(#153, #161) - ⭐
preserveAspectRatio(#154) - ⭐ Units and percentages on geometry (#165); fractional SVG dimensions by @mishchenko11 (#140); comma-separated
viewBox(#138) <symbol>(#182), markers (#184) and<textPath>(#183)<use>prefershref, with anxlink:hreffallback, by @MaelRB (#136)
CSS and text
- ⭐ CSS cascade with selectors, specificity and tolerant stylesheets (#176)
font-weightandfont-stylematching (#170),local()in@font-face(#171), and synthetic bold and oblique (#174)- An invalid
@font-faceno longer discards the whole<style>(#173)
Robustness
- ⭐ Invalid elements and definitions are skipped instead of failing the document (#150)
- ⭐ Tolerant parsing of attributes and of invalid geometry (#157, #158)
- ⭐ Hostile SVGs can no longer trap or recurse forever, by @surprisetalk (#146), with bounded
<use>, mask and pattern expansion (#155)
Performance
- Filter results are cached and shared between views, and computed off the main thread in
SVGView. The filter kernels are fast in Debug builds: a filtered SVG's first draw went from 2.6 s to 0.4 s. Tiled drawing renders one tile and repeats it (#178) - Fixed a rare macOS deadlock in CoreText font lookups (#180)
Other
- Customisable logging output by @AF-cgi (#139)
- Generated SF Symbols are validated after normalising path interpolation, by @AF-cgi (#135)
- Fixed nested
<svg>content being parsed twice (#160) and "invalid context" log noise (#163) - Android and Windows build fixes (#156, #185)
New Contributors
- @AF-cgi made their first contribution in #135
- @MaelRB made their first contribution in #136
- @fishloa made their first contribution in #143
- @surprisetalk made their first contribution in #146
- @mishchenko11 made their first contribution in #140
Full Changelog: 0.29.0...0.30.0