It would be good to have control over whitespace. Today the function assumes that you want "normal" HTML/SVG whitespace handling. But this would be so much more useful if you could control:
Should the text be trimmed.
Should whitespace collapse.
The measuring handlers as also not consistent on this. The string is only normalized for canvas, not for SVG or "dumb". (We should probably remove the SVG handler, there aren't really any environments where SVG exists but not canvas.)
What to do with line breaks then? What input element do: convert all "\n" to " "
It would be good to have control over whitespace. Today the function assumes that you want "normal" HTML/SVG whitespace handling. But this would be so much more useful if you could control:
The measuring handlers as also not consistent on this. The string is only normalized for canvas, not for SVG or "dumb". (We should probably remove the SVG handler, there aren't really any environments where SVG exists but not canvas.)
What to do with line breaks then? What input element do: convert all
"\n"
to" "