You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #9765 we settled on a manual pixel-counting approach instead of using the stock browser function CanvasRenderingContext2D.measureText(). This is because browser results were inconsistent, and at the time of the PR, some of the TextMetrics properties were unsupported by Firefox for Android.
If CanvasRenderingContext2D.measureText(), it would be cleaner to use it instead of drawing the text to a canvas and counting each pixel. Instead we could replace ascent, descent, and minx by the TextMetrics properties actualBoundingBoxAscent, actualBoundingBoxDescent, and actualBoundingBoxLeft.
Until then, maybe it's worth taking another look at why writeTextToCanvas is needed..
The text was updated successfully, but these errors were encountered:
In #9765 we settled on a manual pixel-counting approach instead of using the stock browser function
CanvasRenderingContext2D.measureText()
. This is because browser results were inconsistent, and at the time of the PR, some of the TextMetrics properties were unsupported by Firefox for Android.If
CanvasRenderingContext2D.measureText()
, it would be cleaner to use it instead of drawing the text to a canvas and counting each pixel. Instead we could replaceascent
,descent
, andminx
by theTextMetrics
propertiesactualBoundingBoxAscent
,actualBoundingBoxDescent
, andactualBoundingBoxLeft
.Until then, maybe it's worth taking another look at why
writeTextToCanvas
is needed..The text was updated successfully, but these errors were encountered: