[scribus] Where is the text frame word wrap code?
Drew Vogel
drewpvogel at gmail.com
Mon May 31 06:43:43 CEST 2010
I am working on an application that will generate a scribus document from a
database of survey questions. The output of each question will look a bit
like this image: http://imgur.com/ha2ag.png
The question text is inside the text frame itself. The response options are
in text frames of their own. In order to determine the appropriate vertical
position for the first response option, I need to determine where scribus
will wrap the text inside the text frame (the width of the text frame is
pre-determined). I first thought that I could use
QFontMetrics::boundingRect() to determine where the text would need to be
wrapped. However that seems dependent on the DPI of the QPaintDevice that
the text is drawn on and, in my testing, scribus wraps text independent of
the monitor DPI.
Thus it seems that I need to emulate the word wrap logic in scribus itself
but I'm having trouble locating that part of the scribus code. It seems
logical to me that the word wrap code would either be in or called from
PageItem_TextFrame::DrawObj_Item() but if it's there, it's not obvious to
me. Could someone help me locate the word wrap logic?
Drew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20100530/d7b34b97/attachment.htm>
More information about the scribus
mailing list