Hi,
FPC for a long time had support for raster images in fcl-image.
It now has support for what is probably the most used vector image today: SVG.
Support is broad:
- All drawing primitives.
- Full font support (using platform native font support, freetype as fallback).
- CSS support (using fcl-css)
- Animation support (SMIL)
- Filters
- paint servers (patterns)
What is not supported:
- Javascript
- The DOM
- Color profiles (still planned)
Which is logical, since we're not in the browser.
The code renders a SVG file to a fcl-image supported format.
For animated SVGs, the code can render a single frame at any given timestamp,
or create a series of image frames in a GIF.
The results have been carefully tuned and compared with the W3C SVG reference
set of images, and conformance to the standard is very good:
mean/median difference <3%, barely visible with the naked eye.
An example of what can be done is viewable in
https://www.freepascal.org/~michael/svg/
As part of the work, the existing GIF reader was extended and a GIF writer
was created - making the animation in the above page possible.
The code is compilable with FPC 3.2.2, I'll upload the code to a separate
repo for those that want to use it with FPC 3.2.2
(it then needs trunk's fcl-css and image support included)
Still to do:
- Color profiles
- Generate a PDF image from the SVG.
- Lazarus component(s).
Enjoy!
Michael.
_______________________________________________
fpc-pascal maillist - [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal