The primary dimension is the max hoist or luff length,
measured from the halyard raised to the top and the
tack point on the stem fittting.
The next issue is where the sail will sheet to.
There is a litttle bit of an art to determine where
the clew needs to end up to sheet to an existing lead.
If there are long tracks for the fairleads, the problem
gets easier, but where the sail sheets will vary dramatically
with varying foot and leech lengths.
If you measure from the halyard at the top down,
and from the tack point aft, to the back of the track,
you will have the max possible leech and foot measurements.
But you ideally want the clew up off the deck somewhat,
so as the leech gets shorter the foot will have to get
shorter as well.
Measure the max hoist. Measure from max hoist to
the forward and aft ends of the lead track.
Measure from the tack to the front and back
of the track. Diagram these measurements.
If you draw a line from your lead block
to the center of the max hoist ,
your clew should fall on that line.