Announcement

Collapse
No announcement yet.

wglUseFontOutlines + Font.height geht nicht

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • wglUseFontOutlines + Font.height geht nicht

    Hallo....

    mit dem unten gezeigeten Code möchte ich 3D Texte in OGL ausgeben.
    Funktioniert auch alles bis auf die Fontgröße.

    Ich erzeuge einen Font mit bestimmter Schriftgröße. OGL ist das aber völlig egal. Mein Text ist immer gleich groß.

    hat jemand eine Idee ?

    Vielen Dank



    procedure Glcreatefont(a:string; gldc: hdc);
    var CustomFont:HFont;
    begin
    CustomFont := CreateFont(
    -32, // 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,
    'Times New Roman'); // Name der Schrift

    glEnable(GL_POINT_SMOOTH);
    SelectObject(gldc,CustomFont);


    // Create display lists for each character in the font:
    gFontList:= glGenLists(256);
    wglUseFontOutlines(gldc, // Device context of font -source-
    0, // First character
    256, // Number of characters
    gFontList, // Handle of font display lists
    0.0, // This is the sampling tolerance. Higher values create less detailed outlines.
    0.4, // This is the extrusion depth.
    WGL_FONT_LINES, // What kind of output? You can also use WGL_FONT_LINES WGL_FONT_POLYGONS
    @gFontSizes); // Array to store info about character sizes

    CustomFont.Free();
    end; { glCreateFont }
Working...
X