Closed beppe9000 closed 5 years ago
ok, so this will be fixed eventually
It appears that the SVG renderer's measureText
function could use some improvement in its measurement of string width. Could you create a dummy canvas context and use it for nothing but ctx.measureText(text)
?
Are there any other SVG issues and would you be interested in a pull request?
Yes, pull requests are most welcome 😄
When SVG is exported and shared we can no longer be sure which fonts it will be rendered with. So exactly measure the text size in one environment will not necessarily match the sizes when the SVG is actually viewed.
That is why I use a heuristic instead of more exact measurements.
Additionally, in a browser you can spin up a canvas to measure the text, but on a server (in a node.js environment) that is not readily available.
There is a discussion about these things here (closed issue): https://github.com/skanaar/nomnoml/issues/49
Okay, I'll move the discussion to the other thread.
Happy to say that this is now released! Thanks for all the help.
The SVG renderer is not 100% implemented yet (for example the classifiers are not rendered correctly).
That is the only thing standing in our way of downloading SVG.