jonobr1 / two.js

A renderer agnostic two-dimensional drawing api for the web.
https://two.js.org
MIT License
8.29k stars 454 forks source link

[Issue 653] Accurate Text Measurements #657

Closed jonobr1 closed 2 years ago

jonobr1 commented 2 years ago

Part of looking into Issue 653 resulted in seeing that the text bounding box calculations were very inaccurate. Today, there is one browser API that is available widely that more accurately measures text width and height, known as Text Metrics. This PR implements that and updates the tests to match.