You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Skia and attempting to create a Path from SVG text in the XML style. I want a Path that I can interact with in all of the normal ways you use a Path object, but I don't see a good way to load the XML-style text as a path. Any ideas how to get a path out of this type of SVG string? Thanks!
export const MY_SVG =
`
<svg width='500' height='940' xmlns='http://www.w3.org/2000/svg'>
<rect width='500' height='940' stroke='green' fill='none' />
<line x1='0' y1='470' x2='500' y2='470' stroke='yellow' />
<rect x='190' y='0' width='120' height='190' stroke='yellow' fill='none' />
</svg>
`;
// this makes a SVG *image* best I can tell, not a *Path* like I want
const a = Skia.SVG.(MY_SVG);
// returns a *Path* like I want, but expects SVG *commands*
// like "M10 20 C1 2 3...", not XML-style
// text like the data I have available
const b = Skia.Path.MakeFromSVGString(MY_SVG);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Skia and attempting to create a Path from SVG text in the XML style. I want a Path that I can interact with in all of the normal ways you use a Path object, but I don't see a good way to load the XML-style text as a path. Any ideas how to get a path out of this type of SVG string? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions