Text from .ps or pdf onto OpenGL polygon?

#1

Hello guys,

it’s long ago, that I used to work with OpenGL but now I’m back to it. Please let me express my apologies in the case that I am posting in the wrong part of the forum. I’m new and quiet unsure about where this topic is fitting in best.

I wonder if anyone here knows a C or C++ library which allows to display a Page from a postscript or a portable document file onto a polygon in OpenGL.
I found libraries to convert the current frame of an OpenGL context into an picture but not the other way arround except of when it is a typical picture.

The reason why I ask for this is, that I want to use LaTeX generated Textes in my OpenGL application in order to get good readable texts.

Has anybody an idea about how to tackle the problem?

Oparilames

#2

Converting PostScript or PDF to a texture has two parts: first render a page to a raster image, then upload the raster image to a texture. The rendering is typically done using either GhostScript (for PostScript or PDF) or Poppler (for PDF). GhostScript can be used as a library or as a command-line executable; Poppler is a library.

Once you’ve rendered a page (and if rendered to a file, loaded it into memory), use glTexImage2D to upload the data to a texture.