func (f *Font) Release() {
	gl.DeleteTextures(1, &f.texture)
	gl.DeleteLists(f.listbase, int32(len(f.config.Glyphs)))
	f.config = nil
}
Release releases font resources.
A font can no longer be used for rendering after this call completes.
package gltext
import (
	"fmt"
	"image"
	"unsafe"
	"github.com/go-gl/gl/v2.1/gl"
)
type Font struct {
	config         *FontConfig  
	texture        uint32       
	listbase       uint32       
	maxGlyphWidth  int          
	maxGlyphHeight int          
}
func loadFont(img *image.RGBA, config *FontConfig) (f *Font, err error) {
	f = new(Font)
	f.config = config
	img = Pow2Image(img).(*image.RGBA)
	ib := img.Bounds()
	gl.GenTextures(1, &f.texture)
	gl.BindTexture(gl.TEXTURE_2D, f.texture)
	gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
	gl.TexParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
	gl.TexImage2D(gl.TEXTURE_2D, 0, gl.RGBA, int32(ib.Dx()), int32(ib.Dy()), 0,
		gl.RGBA, gl.UNSIGNED_BYTE, gl.Ptr(img.Pix))
	f.listbase = gl.GenLists(int32(len(config.Glyphs)))
	texWidth := float32(ib.Dx())
	texHeight := float32(ib.Dy())
	for index, glyph := range config.Glyphs {
		if glyph.Width > f.maxGlyphWidth {
			f.maxGlyphWidth = glyph.Width
		}
		if glyph.Height > f.maxGlyphHeight {
			f.maxGlyphHeight = glyph.Height
		}
		vw := float32(glyph.Width)
		vh := float32(glyph.Height)
		tx1 := float32(glyph.X) / texWidth
		ty1 := float32(glyph.Y) / texHeight
		tx2 := (float32(glyph.X) + vw) / texWidth
		ty2 := (float32(glyph.Y) + vh) / texHeight
		adv := float32(glyph.Advance)
		gl.NewList(f.listbase+uint32(index), gl.COMPILE)
		{
			gl.Begin(gl.QUADS)
			{
				gl.TexCoord2f(tx1, ty2)
				gl.Vertex2f(0, 0)
				gl.TexCoord2f(tx2, ty2)
				gl.Vertex2f(vw, 0)
				gl.TexCoord2f(tx2, ty1)
				gl.Vertex2f(vw, vh)
				gl.TexCoord2f(tx1, ty1)
				gl.Vertex2f(0, vh)
			}
			gl.End()
			switch config.Dir {
			case LeftToRight:
				gl.Translatef(adv, 0, 0)
			case RightToLeft:
				gl.Translatef(-adv, 0, 0)
			case TopToBottom:
				gl.Translatef(0, -adv, 0)
			}
		}
		gl.EndList()
	}
	err = checkGLError()
	return
}
func (f *Font) Dir() Direction { return f.config.Dir }
func (f *Font) Low() rune { return f.config.Low }
func (f *Font) High() rune { return f.config.High }
func (f *Font) Glyphs() Charset { return f.config.Glyphs }