textDescent method

double textDescent()

Returns the descent length for the current font, at the current font size.

Implementation

double textDescent() {
  final paragraphBuilder = ParagraphBuilder(ParagraphStyle(
    fontFamily: _fontName,
    fontSize: _fontSize,
    textAlign: _textAlignHorizontal.toFlutterAlign(),
  ))
    ..pushStyle(TextStyle(
      color: _paintingContext.fillPaint.color,
      height: _textLeading != null ? _textLeading! / _fontSize : null,
    ))
    ..addText("p");
  final paragraph = paragraphBuilder.build()
    ..layout(
      ParagraphConstraints(width: double.infinity),
    );

  return paragraph.computeLineMetrics().first.descent;
}