How to match the text height with the TextField?

I want to match the height of the text with the TextField.

I set the height of the TextField to 80 in the code.
I also set the font size to 20.
This should fit the TextField in 4 rows. But the result is only 3 rows.

How can I:
-Reliably display fonts in 20 pixels.
Or
-Get the height of the entire text in pixels.
Then adjust the TextField to the same height.

-Or is there any other solution?

My testing environment:
unity2020.3.4f1 windows

var textField = new TextField("");
textField.multiline = true;
textField.style.width = 200;
textField.style.height =80;

foreach (VisualElement child in textField.Children())
{
child.style.unityTextAlign = new StyleEnum<TextAnchor>(TextAnchor.UpperLeft);
child.style.fontSize = 20;
}

textField.RegisterValueChangedCallback(evt =>
{
var cnt = textField.text.ToList().Where(c => c.Equals('\n')).Count();
textField.style.height = new StyleLength(20 + (cnt * 20));
});

7168954--858832--ui.PNG

Thank you.

I found a way to fit the height of the text and the TextField using the code below.

textField.style.height = new StyleLength(StyleKeyword.Auto);

But this is not a good solution.
Because I can’t specify the height of the text or TextField with the number of pixels I want.

The DoMeasure method in TextInputBaseField may solve the problem.

protected internal override Vector2 DoMeasure(float desiredWidth, MeasureMode widthMode, float desiredHeight, MeasureMode heightMode)