[Scribus] Scripter

Gregory Pittman gpittman
Wed Dec 29 03:24:45 CET 2004


Craig Ringer wrote:

>  
>
>>Are there a function that can tell me how many lines of text are in a  
>>textbox?
>>    
>>
>
>http://bugs.scribus.net/view.php?id=1406
>
>Feel free to add a note describing exactly what you need if its not
>described in the bug.
>
>I was really hoping to get that done for 1.2.1, but couldn't manage it.
>I don't expect to try to implement support for those things in the
>scripter until/unless either the core code's text handling is collected
>up into classes separate from the PageItem code, or string metrics are
>implemented as separate functions. I'm not volunteering :S (nor asking
>anybody else to, though I do think they'd be very very useful).
>
>  
>
Something that occurs to me is that Scribus itself may not "know" how
many lines there are in a text box, yet it does know very acutely when a
text box is full, or overfull actually, otherwise it wouldn't be able to
draw the little X in the right lower corner.
Even with just that bit of information, an algorithm set up as a
successive approximator could come up with appropriately sizing a text
box for a given amount of text at a certain font size and having other
features.  So strictly "knowing" font metrics or the number of lines in
a text box may not necessarily be the required information, depending on
the desired use.
Someone with obsessive compulsive tendencies could eventually come up
with what we might call practical metrics based on a series of trials of
different fonts at different sizes, weights and other features which
could then be used in an interpolative fashion as needed.  The precision
needed is quite relative.

Greg





More information about the scribus mailing list