A method and apparatus for producing subtitles