oksvg
oksvg copied to clipboard
support for text?
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:
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.
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
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