oksvg icon indicating copy to clipboard operation
oksvg copied to clipboard

support for text?

Open tzookb opened this issue 3 years ago • 2 comments

hello :)

wondering if the converter supports text or Im doing something wrong :|

have this svg that I create in the code, so in the end I have the svg string.

canvas := svg.New(&buf)
canvas.Start(width, height)
canvas.Text(width/2, height/2, "aloha, SVG", "text-anchor:middle;font-size:30px;fill:white")
canvas.Circle(width/2, height/2, 100, "fill: green")
canvas.End()

the svg looks like this: Screen Shot 2021-05-03 at 6 26 28

but when Im running the repo code to generate a png, I get only a circle.

So want to make sure if text is supported, as it mentions in the readme that not all svg options are available.

tzookb avatar May 03 '21 10:05 tzookb

That is correct, text is not supported. Of course if you make a path representing a letter you can use that. In fact you can pull that info from most scalable font formats, but for now text is not directly supported. See https://github.com/srwiley/oksvg/blob/master/doc/SVG_Element_List.txt

srwiley avatar May 07 '21 00:05 srwiley

Partial support for text in one of the forks: https://github.com/raykov/oksvg/pull/4

Related closed PRs in this repo: https://github.com/srwiley/oksvg/pull/30, https://github.com/srwiley/oksvg/pull/37

juburr avatar Dec 26 '23 19:12 juburr