PDA

View Full Version : QTextDocument font size wildly different when printing on Windows vs OS X



NicholasSmith
10th March 2010, 12:18
I've had a search but not seen anything mentioning this.

I'm trying to print a QTextDocument that I've created using HTML tags (I've not implemented them as a CSS stylesheet yet), so setting <font size=2>some text</font> and so on, however the print resolution is *wildly* different from OS X to Windows. I really do mean wildly different as well! The Windows font is a few font sizes smaller at least, which is a bit of a pain.

I've tried various combinations of font size=x pt or x px and it just doesn't want to seem to work. I'd be grateful to at least have another avenue to pursue but I'm a bit of a dead end now!

Thanks guys!

Lykurg
10th March 2010, 12:51
Use QPrinter::setResolution() and an explicit default font.

NicholasSmith
10th March 2010, 15:10
Thanks, for that. I've already tried setting QPrinter::ScreenResolution, and that didn't help too much (setting it to PrintResolution made it even tinier), I'll give those suggestions a try now

NicholasSmith
10th March 2010, 16:07
You sir, are a scholar. Setting the default font worked perfectly. Thank you!