TFontCache.GetUnderlineOutline

function GetUnderlineOutline(leftX, rightX, y: double; dy: double = invalidD; wavy: Boolean = False; strokeWidth: double = 0.0): TPathD;


The y parameter represents the text baseline, and the dy parameter represents the y offset relative to y (unless dy == invalidD). When the strokeWidth parameter = 0.0, then the font's default underline stroke width is used.

This method returns the underline's path, whether wavy or straight, that can be drawn using the DrawPolygon function.