- procedure TForm1.BuildFont(pFontName : String);
- var
- Font : HFONT;
- begin
- // Displaylisten für 256 Zeichen erstellen
- FontBase := glGenLists(256);
- // Fontobjekt erstellen
- Font := CreateFont(
- 12, // Höhe
- 0, // Breite 0=Keine Vorgabe
- 0,
- 0,
- 0, // Fett?
- 0, // Kursiv?
- 0, // Unterstrichen?
- 0, // Durchgestrichen?
- ANSI_CHARSET,
- OUT_TT_PRECIS,
- CLIP_DEFAULT_PRECIS,
- NONANTIALIASED_QUALITY,
- FF_DONTCARE or DEFAULT_PITCH,
- 'ARIAL'); // Name der Schrift
- glEnable(GL_POINT_SMOOTH);
- // Fontobjekt als aktuell setzen
- SelectObject(DC, Font);
- wglUseFontOutlines(DC,
- 0, //Von Zeichen #0
- 255, //Bis Zeichen #255
- FontBase,
- 0, //So genau wie möglich
- 0.2, //0.2 LE tiefe Buchstaben
- WGL_FONT_LINES,//Linen keine Polygone WGL_FONT_Polygons,//
- @agmf);//Speichere dort die Informationen
- // Displaylisten erstellen
- wglUseFontBitmaps(DC, 0, 256, FontBase);
- // Fontobjekt wieder freigeben
- DeleteObject(Font)
- end;