PDA

View Full Version : Fast Font Rendering



photo_tom
18th March 2010, 02:35
I have an app where I need to write text over images. I'm going to be doing this with a fixed font type and size.

I was wondering is there a way to "cache" the rendered fonts so that each character does not have to be completely re-rendered every time?

ChrisW67
18th March 2010, 03:55
Take a look at the image composition example under Painting in Assistant. Then you just need to get the characters into an image. Or you could look at QPicture to capture the rendered text.

If you will be pasting a series of characters together you need to be aware that spacing is typically not regular and does overlap. It really is easier for Qt to look after this for you.

aamer4yu
18th March 2010, 05:15
You must be saving text to be drawn somewhere. When capturing/ drawing text is finished, just draw the text over the image. QImage is a paint device, and you can always draw over a paint device, cant you :rolleyes: