textPainter property

TextPainter get textPainter

Implementation

TextPainter get textPainter {
  double fontSize = renderStyle.fontSize.computedValue;

  TextStyle textStyle = TextStyle(
    fontFamilyFallback: renderStyle.fontFamily,
    fontSize: fontSize,
    textBaseline: CSSText.getTextBaseLine(),
    package: CSSText.getFontPackage(),
    locale: CSSText.getLocale(),
  );
  TextPainter painter = TextPainter(
    text: TextSpan(
      text: ' ',
      style: textStyle,
    ),
    textDirection: TextDirection.ltr
  );
  painter.layout();
  return painter;
}