Le dimanche 10 juin 2012 00:32:16 Benoît Minisini a écrit : > Le 10/06/2012 00:02, Adrien Prokopowicz a écrit : > > I have another little question. > > > > In the project I sent you, I added two lines after FillRect() : > > Draw.Text("Gambas", 50, 50) > > Draw.Text("Gambas", 100, 100) > > > > The first takes around 2 msec, the second only 120usec. > > Is there any font loading, or something like that, when calling draw.text > > ? > > I imagine that Qt loads each font glyph only when it actually needs it. > > The second time you display "Gambas", the six glyphs are already loaded, > and so drawing is faster.
No, I tried to change the text in the second call, and results are the same. But I launched callgrind on my example, and I saw that for a few calls to Draw_text, there is one call to QFontMetrics, that loads the font only once (call to QFontDatabase::load, then to fontconfig). I find the calls to fontconfig very slow, but this is another problem. This one is solved. :-) ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user