Text Overlay

How can i generate text through cuda and capture buffer. And what will be more appropriate for achieving this OpenGL or Direct3D.