[Qgis-developer] Multi-line labels and font bug

Steven Bell botsnlinux at gmail.com
Thu Nov 22 10:29:13 EST 2007


Gavin,
The font bug causes fonts to appear garbled when we try to paint a font with
a very small size onto a QGraphicsItem.  An example is here:
http://img457.imageshack.us/my.php?image=fontmessiz6.png
So far, I've only seen it with Qt4 on Ubuntu, although other Linux distros
may also be affected.   Windows and OSX appear to be fine.
My workaround was to simply make the font 10 times larger and scale the
painter down by a factor of 10.  If you didn't scale the painter, then you
would need to set the FONT_WORKAROUND_SCALE to 1 to make the fonts appear at
their correct size.  Another note is that the metrics needs to be created
before scaling the font size, unless you also draw the bounding box while
the QPainter is scaled down.
If you could send me a patch or commit your changes so I can take a look at
it, that would be helpful.
Thanks for your work!
Steven



Hi,

An observation about the recent font bug workaround commits for the map
composer....

I have been working on ticket #181 (multiline labels in the map composer)
and have a working solution that seems to have rendered the qt font bug
workaround unnecessary (I needed to set FONT_WORKAROUND_SCALE to 1 to get
the label font to draw at the right size).

I'm not sure what the qt font bug is, and hence am not sure why my
multiline changes have removed the need for the workaround (I am using
QPainter::draw(QRectF, ..., QString) instead of QPainter::draw(QString)
with the QRectF obtained from QFontMetrics::size()).

Does anyone know what the font bug is?

Gavin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20071122/84ccd96e/attachment.html


More information about the Qgis-developer mailing list