Summary: I’m using elm-collage to display some text. This package used to make a native synchronous call to measure the text size. Of course, that isn’t possible anymore. So, they’ve “reverted to a very simplistic calculation using the font size and the string length”, which of course causes text overflow with non-monospaced fonts.
I understand there’s background for not allowing synchronous calls and everything. I’m also okay with wiring ports manually. My problem is that I can’t think of an easy solution, whether as a package user or author, even if I’ll need to wire some ports.
- As a package user (not author), how would you go around this issue? Do you have any solution in mind?
- If you were the package author as well, do you have any alternative design with good UX even if it’ll require wiring ports?
Notes that might be helpful:
- There’s an
svgBoxfunction that allows me to render in a given width and height.
- You can assume I have in Elm the knowledge of the text’s typeface, size, bold or not, … etc.
Thanks in advance!