textAscent method
Returns the ascent length for the current font, at the current font size.
Implementation
double textAscent() {
final paragraphBuilder = ParagraphBuilder(ParagraphStyle(
fontFamily: _fontName,
fontSize: _fontSize,
textAlign: _textAlignHorizontal.toFlutterAlign(),
))
..pushStyle(TextStyle(
color: _paintingContext.fillPaint.color,
height: _textLeading != null ? _textLeading! / _fontSize : null,
))
..addText("d");
final paragraph = paragraphBuilder.build()
..layout(
ParagraphConstraints(width: double.infinity),
);
return paragraph.computeLineMetrics().first.ascent;
}