MCGR repair broken offset on import
Regina Henschel
rb.henschel at t-online.de
Wed Apr 5 11:58:56 UTC 2023
Hi Armin, hi all,
I'm currently working on import of multicolor gradients from ODF.
With my proposal for standardizing multicolor gradients the offset
values would be in interval [0.0,1.0] and sorted in ascending order in a
valid file markup.
(A)
Should I nevertheless repair a broken sequence of gradient stops to be
tolerant in regard to invalid markup?
If yes, how to handle offsets out of range? It could be:
(1) remove such stops
(2) round up values < 0.0 to 0.0 and round down values > 1.0 to 1.0.
(2) corresponds to section 14.2.4.3 SVG specification [1]
If yes, how to handle out of order?
My suggestion would be to do the same as specified for SVG [1]
(B)
My proposal for standardizing multicolor gradients contains the rule:
"If the first <draw:gradient-stop> element has a svg:offset value larger
than 0.0, consumers shall behave as if there is an additional
<draw:gradient-stop> element with svg:offset="0.0" and same
<style:enhanced-color> and <style:color-transform> child elements as in
the first <draw:gradient-stop> element."
and analogous for 1.0.
I could add such additional stop on import. Should I do that, or do you
always handle such situation already in this sense?
[1] https://svgwg.org/svg2-draft/pservers.html#StopNotes
or at the end of section 13.2 in
https://www.w3.org/TR/2011/REC-SVG11-20110816/pservers.html#GradientStops
Kind regards,
Regina
More information about the LibreOffice
mailing list