jonobr1 / two.js

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

Improve Text.baseline consistency across all renderers #717

Closed jonobr1 closed 6 months ago

jonobr1 commented 6 months ago

Addressing issue 716 reported by @dan-fritchman:

Renderer Example
SVG Screenshot 2024-02-20 at 12 11 36 PM
Canvas2d Screenshot 2024-02-20 at 12 11 44 PM
WebGL Screenshot 2024-02-20 at 12 11 48 PM

The difference between "bottom" and "baseline" (baseline is the default) is that bottom takes into account descenders regardless if you have them in your text or not. E.g: the bowl in a lower case "g".