[vector icons] Add support for rendering 'S' cubic Bezier curve path type |
||||||
Issue descriptionThe Skiafy script (http://evanstade.github.io/skiafy/) outputs ???, ??? as the first control point of a cubic Bezier curve corresponding to the SVG 'S' path command. This is because the control point needs to be computed as the reflection of the second control point on the previous command relative to the current point (refer to the SVG path spec for further details: https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands). As a result, manual computation is required to find the missing point.
,
Sep 1 2016
,
Sep 5 2016
Besides 'S', the Skiafy script also can't handle svg node <g> (see the SVGs provided by tdanderson@ in bug 642385). It outputs: <g> with a transform not handled
,
Sep 6 2016
Did you use SVGO/SVGOMG? Most of the time that will get rid of the transforms.
,
Sep 7 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9bcbbd3b5ffe60e191a92ff7cabde7cf3aac4502 commit 9bcbbd3b5ffe60e191a92ff7cabde7cf3aac4502 Author: tdanderson <tdanderson@chromium.org> Date: Wed Sep 07 18:04:52 2016 Add support for CUBIC_TO_S for rendering vector icons Add support for the vector icon drawing command CUBIC_TO_S, which will correspond to the SVG path command 'S'. This new command computes its implicit first control point by using information about the current point and the second control point on the previous command. BUG= 643265 TEST=manual Review-Url: https://codereview.chromium.org/2307533003 Cr-Commit-Position: refs/heads/master@{#416996} [modify] https://crrev.com/9bcbbd3b5ffe60e191a92ff7cabde7cf3aac4502/ui/gfx/paint_vector_icon.cc [modify] https://crrev.com/9bcbbd3b5ffe60e191a92ff7cabde7cf3aac4502/ui/gfx/vector_icon_types.h
,
Sep 8 2016
Now that the CL in #5 has landed, you can manually replace the Skiafy output: CUBIC_TO, ???, ???, 20.18f, 0, 13, 0, with: CUBIC_TO_SHORTHAND, 20.18f, 0, 13, 0, and that curve will render correctly. I will be making a change to the Skiafy script to do this automatically so that no manual intervention is needed. Also, azurewei@: ping on comment #4. Do you still encounter problems even after running the provided .svgs through svgo?
,
Sep 18 2016
Svgo tool seems can't open the svg file with <g> flags. I just removed all the <g> flags and get the rendered vector icons with Skiafy. Thanks!
,
Sep 19 2016
svgo can handle <g> tags
,
Sep 29 2016
It appears that the CUBIC_TO_SHORTHAND fix is not supported by Chromium v53 which is the version we are for an application of ours. Could someone clarify a) which version of Chromium supports the new fix and b) how to manually calculate the missing point manually in the meantime?
,
Sep 29 2016
The fix is in version 55, and to be able to manually compute the missing coordinates please refer to the SVG spec here: https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands
,
Sep 29 2016
Incidentally, it seems the main cause for the ???, ??? issue is by running it through Jake's SVG optimiser and toggling the "Remove hidden elements" option. By ignoring this option, the optimised SVG image no longer produced ??? in the Skiafy output. Hope this helps whoever is reading :)
,
Sep 29 2016
that's probably just a coincidence. I don't think that would consistently fix the problem. It crops up with or without svgo(mg).
,
Oct 24 2016
,
Jan 16 2017
,
Jul 31 2017
I updated the skiafy tool to use CUBIC_TO_SHORTHAND instead of the question marks. Can we mark this fixed?
,
Jul 31 2017
Yep, thanks a lot for updating. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by tdander...@chromium.org
, Sep 1 2016