  For projective Reed--Muller-type codes we give a global duality criterion in
terms of the v-number and the Hilbert function of a vanishing ideal. As an
application, we provide a global duality theorem for projective
Reed--Muller-type codes over Gorenstein vanishing ideals, generalizing the
known case where the vanishing ideal is a complete intersection. We classify
self dual Reed-Muller-type codes over Gorenstein ideals using the regularity
and a parity check matrix. For projective evaluation codes, we give a duality
theorem inspired by that of affine evaluation codes. We show how to compute the
regularity index of the $r$-th generalized Hamming weight function in terms of
the standard indicator functions of the set of evaluation points.
