- procedure BuildFont(CanvasHandle: HWND);
- var
- font: HFONT;
- begin
- //Schriftart erstellen
- FontBase := glGenLists(96);
- font := CreateFont(
- 30, // Schriftgröße
- 0, // Buchstabenbreite
- 0, // Kursivwinkel (~100=normalkursiv)
- 0, // ??? = base-line orientation angle
- FW_MEDIUM, // font weight
- 0, // italic
- 0, // underline
- 0, // durchgestrichen=strikeout
- ANSI_CHARSET, // character set
- OUT_TT_PRECIS, // output precision
- CLIP_DEFAULT_PRECIS, // clipping precision
- ANTIALIASED_QUALITY, // output quality
- FF_DONTCARE OR DEFAULT_PITCH, // pitch and family
- 'Papyrus');
- // font
- SelectObject(CanvasHandle, font);
- wglUseFontBitmaps(CanvasHandle, 32, 96, FontBase);
- DeleteObject(font);
- end; (*Build Font*)
- procedure KillFont; // Delete The Font
- begin
- glDeleteLists(FontBase, 96); // Delete All 96 Characters
- end;
- {$Q-}
- procedure PrintText(const Text,myFontType: string);
- begin
- //Zeigt Text an Rasterpostion an, Überlaufchecks müssen aber deaktiviert sein(
- if (Text = '') then
- Exit;
- glPushAttrib(GL_LIST_BIT);
- glListBase(FontBase-32) // Set the base list to our character list
- glCallLists(Length(Text), GL_UNSIGNED_BYTE, PChar(Text)); // Display the text
- glPopAttrib()
- end; (*PrintText*)
- {Q+}