Ben Burdette
2015-11-24 22:31:02 UTC
I'm using svg to draw some text, and I'd like it to be as large as
possible, but still fit inside a box. This stackoverflow illustrates the
idea for a single line of text.
http://stackoverflow.com/questions/15430189/pure-svg-way-to-fit-text-to-a-box
The solution there seems to be to query SVG to get a bounding box for the
text, then use the result of that to estimate the appropriate font size and
text location. This approach doesn't seem to be appropriate for elm though,
its not declarative. There doesn't seem to be a getBBox() function in the
svg lib either.
Any ideas on this? Right now going to just go with guessing from the
string length.
possible, but still fit inside a box. This stackoverflow illustrates the
idea for a single line of text.
http://stackoverflow.com/questions/15430189/pure-svg-way-to-fit-text-to-a-box
The solution there seems to be to query SVG to get a bounding box for the
text, then use the result of that to estimate the appropriate font size and
text location. This approach doesn't seem to be appropriate for elm though,
its not declarative. There doesn't seem to be a getBBox() function in the
svg lib either.
Any ideas on this? Right now going to just go with guessing from the
string length.
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.