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
The reason underscore is drawn outside the text bounds for the Courier New character is because of how we measure the text (i.e., TextMetrics.METRICS_STRING). In general, we are giving TextMetrics some standard characters which have large ascenders and descenders. But, this doesn't work for all typefaces (but does work for Arial, Times and other typefaces I tried).
The solutions here is to add TextMetrics.METRICS_STRING += '_' to consider underscores when calculating the text bounds.
I don't think we should add underscore to this setting. It'll always be the case that some typefaces have larger ascenders or descenders on certain characters. We do not have the ability to read the font vectors itself. My suggestion is to adjust the TextMetrics for your use cases.
Current Behavior
BitmapFont of 'Courier New' cannot display '_'
Expected Behavior
BitmapFont of 'Courier New' can display '_'
Steps to Reproduce
Environment
pixi.js
version: 7.4.2Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: