using masks is described here:
http://www.imagemagick.org/Usage/masking/
now you make your text and use it as a mask (just like in photoshop)
or crop it using mask made with your text, make negative of it and apply it on original image.
you make negative like that, if memory serves:
convert input.png -negate output.png