[Libreoffice] [Patch] SVG export filter improvements

KUROSAWA, Takeshi taken.spc at gmail.com
Tue Feb 1 21:52:10 PST 2011


Hi,

Here are some patches to improve SVG export filter.

0001: Make filter export Gradients and Hatches as SVG <pattern>s.
This tend not to change a visual look but improve semantic structure of a file.
# Actually,hatches go outside of a shape sometimes without this patch.

0003: Make filter export linear and axial gradients as SVG <linearGradient>s.
Use SVG's native gradient instead of polygon fallback.
With this patch, gradient steps of linear and axial gradient are ignored.
In other words, linear and axial gradients are always exported as
"smooth" gradients.
However, as far as I know, the manual steps function is for printing.
So I suppose ignoring gradient steps is safe.

To support native gradients, I need to calculate a bounding box of a gradient.
Currently it is done in OutputDevice::ImplDrawLinearGradient and
OutputDevice::ImplDrawComplexGradient.
So I moved that to Gradient class (0002 patch) to use it in filter code.


0004: Make filter export transparencies as SVG <mask>s.
SVG export filter supports only solid transparency of solid fill (i.e.
color) until now.
The patch extends support to support solid and gradient transparency
of all fill styles.
# Some SVG viewers including WebKit don't support <mask> yet :-(.


The patches are under the LGPLv3+ / MPL.

Cheers,
--
KUROSAWA Takeshi <taken.spc at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-filters-Export-hatches-and-gradients-as-SVG-pattern-s.patch
Type: text/x-patch
Size: 9389 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110202/6910d98c/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-libs-gui-Encapsulate-calculation-of-gradient-bounding-box-to-.patch
Type: text/x-patch
Size: 10526 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110202/6910d98c/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-filters-Export-linear-and-axial-gradient-as-SVG-linearGradie.patch
Type: text/x-patch
Size: 11764 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110202/6910d98c/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-filters-Export-transparencies-as-SVg-mask-s.patch
Type: text/x-patch
Size: 7982 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110202/6910d98c/attachment-0007.bin>


More information about the LibreOffice mailing list