I saw a small typo in BezierTextOut related to ptCnt:
with ACanvas do
begin
SetLength(flatPts, ptCnt);
SetLength(types, ptCnt);
SetLength(distances, ptCnt);
flatPts := GetBezierPolyline(BezierPoints);
ptCnt := Length(flatPts);
if ptCnt < 1 then Exit;
changed the order to as I assume you intended to do:
with ACanvas do
begin
flatPts := GetBezierPolyline(BezierPoints);
ptCnt := Length(flatPts);
if ptCnt < 1 then Exit;
SetLength(flatPts, ptCnt);
SetLength(types, ptCnt);
SetLength(distances, ptCnt);