The function TCanvas.TextWidth uses the API function "GetTextExtentPoint32" behind the scenes - it ought to do the trick.