Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Urgent FTGL crash :: Cannot render text after the 500th items.....???

Hybrid View

  1. #1
    Newbie Newbie
    Join Date
    Aug 2013
    Posts
    2

    Urgent FTGL crash :: Cannot render text after the 500th items.....???

    Hi all, I need some urgent info for this. Thank you.

    I am new to openGL and FTGL text rendering.

    I am able to draw text. I've done something like this :
    FTBitmapFont *flbl = new FTBitmapFont("C:/Windows/Fonts/Arial.ttf");
    flbl->FaceSize(12);
    flbl->Render("Hello");

    But the application will crash after the 500++th items. eg.

    static int count= 0;
    char counter[1000];
    if (count < 700) {
    count++;
    sprintf(counter,"%d",count);
    FTBitmapFont *flbl = new FTBitmapFont("C:/Windows/Fonts/Arial.ttf");
    flbl->FaceSize(24);
    flbl->Render(counter);
    }

    then the program will crash after showing 509.

    Anyone can help me on this?
    Any limitation for FTGL to do large amount of text rendering?

    Thank you very much.
    Last edited by KenOng; 08-21-2013 at 02:42 AM.

  2. #2
    Intern Newbie
    Join Date
    Nov 2002
    Posts
    37
    How about if you create only 1 FTBitmapFont instead of 700 times the same one?

  3. #3
    Junior Member Regular Contributor
    Join Date
    Feb 2007
    Location
    Hungary
    Posts
    168
    I don't know how FTGL works, but you are probably out of memory (system, GPU or both). Arial has a lot of glyphs to convert. 700 times?

  4. #4
    Newbie Newbie
    Join Date
    Aug 2013
    Posts
    2
    Thanks Claude & aronsatie,

    I tried to create only 1 FTBitmapFont now, it seems like working but now I am trying to see how can I rotate these texts i created.
    I wish to maintain certain graphic quality so I dont think PolygonFont is suitable for me.

    Is that any method to rotate and scale FTBitmapFont or FTPixmapFont ?

    aronsatie,
    Ya , I think might be some sort of out of memory but I am actually dont know what is glyphs at the moment. Sorry and thank you very much.

    ^_^

  5. #5
    Junior Member Regular Contributor
    Join Date
    Feb 2007
    Location
    Hungary
    Posts
    168
    The individual characters of a font are made up of one or more glyphs (these are more or less made from a number of straight or curved lines). The more languages a font supports, the more glyphs there are. Arial is one of the bigger fonts supporting the alphabets of quite a few languages. Somehow FTGL renders all glyphs into bitmaps, the higher the resolution of these bitmaps, the more memory needed. Don't even try a font supporting e.g. Chinese . These can contain 30-40,000 glyphs. However, I just read the description of FTGL. It says that only the first 128 characters are preloaded to save memory. Polygonfont is your best choice if you want total freedom of scaling your texts. Pixmap is only different to Bitmap in that it is antialiased. Rotating and scaling is done by opengl transformations (glRotate and glScale if you use pre 3.0 opengl versions). You can use transformations on any type of FTGL text.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •