bezoerb / text-metrics

An efficient text measurement set for the browser
MIT License
64 stars 5 forks source link

Trimming text before computing width should be optional. #6

Open jay-jlm opened 4 years ago

jay-jlm commented 4 years ago

For my use case I need to the metrics to include whitespace characters in the of the string. Currently does not seem to be possible, since it calls .trim() on the string before computing the results.

bezoerb commented 4 years ago

This is because the whitespaces normally collapse. If you like you could do a PR making this configurable using the current behavior as default?