Odd... As soon as I get my enviroment up and running again, I'll try your code, if that works, there must be some difference that I'm overlooking at the moment. Only difference I can see right now is that I flip the buffer (primary) everytime I draw a string, and I use the BLIT flag to copy the contents.
I'll get back to you tomorrow... /Henric ----- Original Message ----- From: "Denis Oliver Kropp" <[EMAIL PROTECTED]> To: "Henric Andersson" <[EMAIL PROTECTED]> Cc: "directfb-dev" <[EMAIL PROTECTED]> Sent: Monday, November 18, 2002 8:27 PM Subject: Re: [directfb-dev] The correct way of using fonts? > Quoting Henric Andersson ([EMAIL PROTECTED]): > > I've made a program that uses TrueType fonts quite extensively. What I've noticed is that the program is leaking memory. ALOT of memory. I traced it to the font loading. > > > > Correct me if I'm wrong, but isn't this how it is supposed to be used: > > > > DFBFontDescription font_dsc; > > IDirectFBFont *font = NULL; // Our font > > > > font_dsc.flags = DFDESC_HEIGHT; > > font_dsc.height = 30; > > DFBCHECK (dfb->CreateFont (dfb, "arial.ttf", &font_dsc, &font)); > > DFBCHECK (primary->SetFont (primary, font)); > > > > *** do something with the font, ie, draw stuff on screen :) *** > > > > font->Release(font); > > > > If you run this in a loop, the program will eventually fail to load the font, and before it does, it will eat alot of memory. > > > > Any comments are welcomed... > > I wrote a small test app and it works perfectly. > > -- > Best regards, > Denis Oliver Kropp > > .------------------------------------------. > | DirectFB - Hardware accelerated graphics | > | http://www.directfb.org/ | > "------------------------------------------" > > Convergence GmbH > -- Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe directfb-dev" as subject.
