Giter Club home page Giter Club logo

Comments (6)

abritinthebay avatar abritinthebay commented on May 11, 2024 1

I guess the question is: PRs welcome?

from rough.

abritinthebay avatar abritinthebay commented on May 11, 2024

Slight snarly regex's to get...

fills: /<path (?:.+)fill="([^"]+)"(?:.+)\/>/gi
path data = /<path (?:.+)d="([^"]+)"(?:.+)\/>/gi

from rough.

pshihn avatar pshihn commented on May 11, 2024

PRs always welcome. I am planning out the next release with more advanced native SVG support -> i.e. create sketchy SVG nodes rather than draw on canvas.
But, what you're proposing is also good for the current Canvas version. I'd hate to duplicate code and would like keep the API future compatible.
So, if you have a PR, I can include it in the next release.

from rough.

pshihn avatar pshihn commented on May 11, 2024

Btw, SVGs are just DOM. You may be able to use DOM parsing rather than regex to parse not just paths but other SVG primitives as well.

from rough.

abritinthebay avatar abritinthebay commented on May 11, 2024

True, I was thinking Node... but it wouldn't have a canvas at that point anyhow either. So I may as well just use DOMParser.

from rough.

pshihn avatar pshihn commented on May 11, 2024

Rough.js now supports SVG rendering #49
Thought that is not part of this issue directly, I think parsing for files can be build on top as @sbrugman suggested.

from rough.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.