plutosvg icon indicating copy to clipboard operation
plutosvg copied to clipboard

[Requirement] export parse path function

Open ZhUyU1997 opened this issue 2 years ago • 1 comments

I am developing the canvas js API based on plutovg and quickjs. Path2D can receive SVG path. So I want this library to implement it. Reference: https://developer.mozilla.org/zh-CN/docs/Web/API/Path2D/Path2D

var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");

var p = new Path2D("M10 10 h 80 v 80 h -80 Z");
ctx.fill(p);

Can we export parse_path function? It could be like the below.

plutovg_path_t *plutosvg_parse_path(const char *path, size_t len)

Thanks, Yu Zhu

ZhUyU1997 avatar Apr 16 '22 02:04 ZhUyU1997

I will see what I can do <3

sammycage avatar Apr 16 '22 06:04 sammycage