it's unfortunate the canvas.TextRect(… did not define the TRECT as a VAR because you can not use that function if all you want to do is simply calculate the rectangle without painting.
However, all is not lost..
the LCLINTF unit which makes cross platform calls does have the DrawText which accepts the same parameters as the windows counter part..
So all one needs to do is just include the unit.