[scribus-dev] Where is the text frame word wrap code?

a.l.e ale.comp_06 at xox.ch
Wed Jun 2 21:23:49 CEST 2010


hi drew,

> 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. Is that true?
> 
> 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?

for now, the best choice is to write a script inside of scribus which will pull the text from the database and add the content to text frames.


on the other side, i guess that if all those who are spitting blood to generate .sla files would join their effort to create a GUIless version of scribus (using the scribus classes but not the main.cpp) i think it would be already there!

it may need some (big) refactoring in the main code, but i guess that it would be profitable to the whole scribus project.

just some random thoughts...


ciao
a.l.e



More information about the scribus-dev mailing list