Measure Text API, expanded (#3921)
...
* Added TextStyle.measure function (Applies to https://github.com/pixijs/pixi.js/issues/3903).
* Moved measure function from TextStyle to Text and made static.
* Updated JSDocs.
* Updated JSDocs again.
* Updates based on suggestions by @bigtimebuddy in PR.
* Created PIXI.MeasuredText to capture all the information for measuring text.
* Fixes for ESLint
* Fixes for ESLint
* Added PIXI prefix to returning MeasuredText.
* Added import for MeasuredText in Text.js.
* Refactored MeasuredText to TextMetrics and moved `measure` function into it.
* Forgot to move Text.wordWrap to TextMetrics.wordWrap
* Further cleanup of TextMetrics.
* Fixes suggested by @bigtimebuddy
* Removed clone and equals from TextMetrics as they are unnecessary.
* Destructured references to TextMetrics instance in Text and privatized TextMetrics.wordWrap.
* Deprecates calculateFontProperties & getFontStyle
* Moved getFontStyle to TextMetrics
* Made toFontString method on TextStyle
* Cache calls made to context.measureText for individual characters
* Use a smaller (10x10) canvas for TextMetrics
Matt Karl
authored
on 11 Apr 2017
GitHub
committed
on 11 Apr 2017