getMeasuredRectangle method
Measure the Text with a given font.
Implementation
Rectangle<num> getMeasuredRectangle(
String text, Font font, Rectangle<num> bounds) {
final SizeF size = getTextSizeFromFont(text, font);
final double height = (size.sHeight * 1.03).ceilToDouble();
final int length = bounds.width == 1800.0
? 1
: _getLengthOfLines(size.sWidth, bounds.width.toDouble(), text, font);
final Rectangle<num> result =
Rectangle<num>(0, 0, size.sWidth.ceil(), height * length);
return result;
}