Writing text field with OpenGL.

Hi.

I have to implement a text field, including writing into it in variant fonts, how can I do it with OpenGL?
** It must support Windows, Linux, and Mac.

Thanks Itzik.

The native font systems of Win32 and MacOS are far beyond those of OpenGL, and X has some font capabilities too. Thus, I’d suggest you render into an offscreen buffer using each native API on each platform, and then upload as a texture for display.

Implementing the same application-level interface using different code for different platforms is very common in portable programs.

If you want a solution that doesn’t use any native facilities, look into the FreeType library; let that render into an offscreen bitmap and upload as texture. However, that way, the user won’t necessarily get the same set of fonts as (s)he is used to on their machine.

Do you know about any code sample implement the solution you suggested?

Thanks.

Originally posted by jwatte:
[b]The native font systems of Win32 and MacOS are far beyond those of OpenGL, and X has some font capabilities too. Thus, I’d suggest you render into an offscreen buffer using each native API on each platform, and then upload as a texture for display.

Implementing the same application-level interface using different code for different platforms is very common in portable programs.

If you want a solution that doesn’t use any native facilities, look into the FreeType library; let that render into an offscreen bitmap and upload as texture. However, that way, the user won’t necessarily get the same set of fonts as (s)he is used to on their machine.[/b]