- procedure TGLWindowFont.BuildFont(Size : Integer; Bold : Boolean; const aFont : String = 'Comic Sans MS');
- var
- pFont : array[0..63] of Char;
- oFont : HFont;
- nFont : HFont;
- iBold : Word;
- begin
- fBase := glGenLists(256);
- StrPCopy(pFont, aFont);
- iBold := 0;
- if Bold then begin
- iBold := FW_BOLD;
- end;
- nFont := CreateFont(-Size, 0, 0, 0, iBold, 0, 0, 0, ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_DONTCARE or DEFAULT_PITCH, pFont);
- try
- oFont := SelectObject(Owner.DC, nFont);
- try
- wglUseFontOutlines(Owner.DC, 0, 255, fBase, 0.0, 0.2, WGL_FONT_POLYGONS, @fGMF);
- finally
- SelectObject(Owner.DC, oFont);
- end;
- finally
- DeleteObject(nFont);
- end;
- end;