# Using fonts in OpenGL?

**URL:** <https://discourse.libsdl.org/t/using-fonts-in-opengl/4630>\
**Category:** SDL Development\
**Created:** [June 26, 2001, 3:59pm UTC](https://discourse.libsdl.org/t/using-fonts-in-opengl/4630 "2001-06-26T15:59:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikael\_Aronsson](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/m/5daacb/32.png) [@Mikael\_Aronsson](https://discourse.libsdl.org/u/Mikael_Aronsson)\
**Post date:** [June 26, 2001, 3:59pm UTC](https://discourse.libsdl.org/t/using-fonts-in-opengl/4630/1 "2001-06-26T15:59:02Z")

</div>

Hi !

To create a font to use in OpenGL you need to call  
wglUseFontOutline/glxUse…, but then I need the context and a font handle,  
is there any way to get access to these from inside an SDL application ?,  
the problem is of course that theese are platform dependent, but it would be  
nice to be able to do this in some way…

Mikael

---

<div class="post-metadata">

**Author:** ![slouken](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ec9cab/32.png) [@slouken](https://discourse.libsdl.org/u/slouken)\
**Post date:** [July 8, 2001, 9:23am UTC](https://discourse.libsdl.org/t/using-fonts-in-opengl/4630/2 "2001-07-08T09:23:00Z")

</div>

> Hi !

> To create a font to use in OpenGL you need to call  
> wglUseFontOutline/glxUse…, but then I need the context and a font handle,  
> is there any way to get access to these from inside an SDL application ?,  
> the problem is of course that theese are platform dependent, but it would be  
> nice to be able to do this in some way…

Using system fonts isn’t portable. You should probably use truetype fonts  
and some library that enables you to use them in OpenGL (there are several)

See ya!  
-Sam Lantinga, Lead Programmer, Loki Software, Inc.
