Wetting of heterogeneous substrates