It can shortened at both ends.
First: How long is the luff compared to the P measurement? ie: what is the vertical distance that needs to be cut off, from the head or the foot ?
A couple of issues : When a mainsail's measurements are needed , one of the first requirements will be to determine mast bend. Then the Crane's distance (12) to the mast will determine the mainsail's headboard design.
Therefore, if the sail is shortened by cutting the top of the sail, it will require a headboard that is wider in order for the hoist holes to a line-up with the top of the sail. If the headboard is significantly wider, then the leach will also have to be cut.
The option that appears to be the best is to cut the bottom of the sail parallel to the existing foot.
However, without measurements difficult to give useful suggestions.
Linear option: drop the Gooseneck on the Mast, sufficient to take up the slack in the luff