Use font as opengl polygons?

BlitzMax Forums/OpenGL Module/Use font as opengl polygons?

ImaginaryHuman(Posted 2005) [#1]
Has anyone has any luck with loading in a font and converting it into polygons/quads (ie list of vertexes) that you can then render as you please?


ImaginaryHuman(Posted 2005) [#2]
I guess nobody's tried this yet?


Difference(Posted 2005) [#3]
There is a Blitz+,Blitz3D example in my OpenGL lib that you might be able to port to BlitzMax here:

http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=peter__scheutz02202003193552&comments=no

The core function looks like this:
Function CreateGLOutlineFont(hDC,glyfBank,depth#)

	Local oldFont%
	Local hFont%

	hFont=CreateFont(-24, 0, 0, 0, 0, False, False, False,0, 4, 0, 4, 0, "Arial")
    oldFont=SelectObject(hDC,hFont)
	
	listBase = glGenLists(256)	; Storage For 256 Characters 	
	
	; Builds 256 Characters Starting At Character 0
	wglUseFontOutlines hDC, 0, 255, listBase , 0.0, depth, WGL_FONT_POLYGONS, glyfBank   
	SelectObject hDC,oldFont
	DeleteObject hFont
	Return listBase

End Function