For example,
troff -ms file
would output your text file with ms(6) macros as PostScript. Another commonly used set of macros are for typesetting man(6) pages. To view a typeset version of a manpage:
troff -man /sys/man/4/factotum | page
Various tools can be used in conjunction with troff to form a toolset for word-processing, publishing, or as the back-end of such an application.