measureText method
Measure the text
dimension.
Implementation
@override
PTextMetric measureText(String text, PFont font) {
var bitmapFont = font.toBitmapFont();
var w = 0;
var lng = text.length;
for (var i = 0; i < lng; ++i) {
var c = text[i];
var x = _characterXAdvance(bitmapFont, c);
w += x;
}
var h = _findStringHeight(bitmapFont, text);
return PTextMetric(w, h);
}