Results 1 to 4 of 4

Thread: font size

  1. #1
    Member Contributor
    Join Date
    Jun 2003
    Location
    South Carolina
    Posts
    70

    font size

    I am using the font outline example form NeHe's tutorial, but when I generate the font in the opengl screen, it is never big enough, no matter what size I set it to, it stays the same size. What am I doing wrong? here is some code:


    Build font:
    HFONT font;
    base = glGenLists(256);
    font = CreateFont(-20,10,0,0,FW_BOLD,FALSE,FALSE,FALSE,ANSI_CHARSET,O UT_TT_PRECIS,
    CLIP_DEFAULT_PRECIS,ANTIALIASED_QUALITY,
    FF_DONTCARE|DEFAULT_PITCH,"Comic Sans MS");
    SelectObject(*hDC,font);
    wglUseFontOutlines(*hDC,0,255,base,0.0f,0.2f,WGL_F ONT_POLYGONS,gmf);

    Example call for output
    glCallLists(strlen(str),GL_UNSIGNED_BYTE, str);
    -David

  2. #2
    V-man
    Guest

    Re: font size

    Try scaling it (glScale)

  3. #3
    Senior Member Regular Contributor
    Join Date
    Sep 2002
    Location
    Poland
    Posts
    196

    Re: font size

    Originally posted by V-man:
    Try scaling it (glScale)
    You cannot scale bitmap font.


    Try to use this code, then if it work You modify it to wglFontOutlines:

    int CreateFontBitmaps(HDC hdc, char* fontname, int height, int weight, DWORD italic)
    {
    int base;
    HFONT font;

    if ((base = glGenLists(256)) == 0) return 0;

    font = CreateFont(height, 0, 0, 0, weight, italic, false, false,
    ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
    FF_DONTCARE| |DEFAULT_PITCH, fontname);

    SelectObject(hdc, font);
    wglUseFontBitmaps(hdc, 32, 256, base);
    return base;
    }

    [This message has been edited by glYaro (edited 07-12-2003).]

    [This message has been edited by glYaro (edited 07-12-2003).]

  4. #4
    Member Contributor
    Join Date
    Jun 2003
    Location
    South Carolina
    Posts
    70

    Re: font size

    thanks, the glscale worked like a charm
    -David

Similar Threads

  1. font size in wglUseFontOutlines
    By imported_xargon in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-18-2005, 10:44 PM
  2. Font Size
    By Rong Yao in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-12-2003, 05:29 AM
  3. Font Size
    By Rong Yao in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-06-2001, 11:24 AM
  4. Font Size
    By Rong Yao in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 07-06-2001, 08:13 AM
  5. Font Size & Type
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-09-2001, 07:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean