Skip to content

measureText should support different whitespace options #23

@borgar

Description

@borgar

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:

  1. Should the text be trimmed.
  2. 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 " "

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions