Spectral invariants for polygons and orbisurfaces