Text this: Optimizing structured surfaces for diffractive waveguides