I'm using built in bitmap generator myself so i don't have to provide applications with font picture files. Maybe you can pull something out of this function:

[pascal]// You can call this with parameters such as
// 'Courier',10,256
// if fontSize is much bigger it will not fit well in 256 sized
// texture, that is when you need to increase TexSize to 512
procedure TNXFont.CreateBMP(fontName: string; fontSize,
_TexSize: integer);
var i,n,x,y: integer; b: TBitmap;
begin
self.TexSize:=_TexSize;
nxTex.Options:=[toColorKey];
nxTex.TransparentColor.r:=0;
nxTex.TransparentColor.g:=0;
nxTex.TransparentColor.b:=0;
TextureI:=nxTex.AddTexture2('$'+fontname,'',true);
b:=TBitmap.Create;
b.Width:=TexSize; b.Height:=TexSize;
sx:=texSize div 16; sy:=texSize div 14;
with b.Canvas do begin
pen.Color:=clBlack; brush.Color:=clBlack;
rectangle(0,0,texSize,texSize);
font.Name:=fontName; font.Size:=fontSize; font.Color:=clWhite;
brush.Style:=bsClear; n:=0;
pen.Color:=clRed;
// First 32 characters (0..31) in ascii table are meaningless
// They don't contain any characters used in texts.
for i:=0 to 255-32 do begin
// I save width in pixels of each character in charW[] array
// This is used in rendering process
charW[i+32]:=TextWidth(chr(i+32));
if charW[i+32]>sx-1 then charW[i+32]:=sx-1;
n:=n+TextHeight(chr(i+32));
x:=sx*(i mod 16); y:=sy*(i div 16);
TextRect(bounds(x,y,sx,sy),x+1,y,chr(i+32));
end;
CenterH:=n div ((255-31)*2);
end;
// At this point TBitmap b contains full font texture
nxTex.LoadBMPData(@nxTex.texture[textureI],b);
b.Free;
end;[/pascal]