[Scribus] Scripter

Louis Desjardins louisdesjardins
Wed Dec 29 03:43:59 CET 2004


? (At) 21h24 -0500 28/12/04, Gregory Pittman ?crivait (wrote) :
>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.

It just came to my mind that this little X is like a dumb light in 
the car telling you the motor temp is too high... when it's too late 
(or very late)... We'd be improving again, and innovating, if the 
little square telling you text overflows would be a number (of line) 
instead. Could be in a square. Could be whatever! But it would be 
anything but dumb. And would help make a decision right away:
a. too many lines to adjust the layout, go back to the editor and 
tell them to cut that many lines (and by the way, you sound smart 
knowing that much about the problem! No more "cut a few, and it'll be 
perfect" thing... who needs an approximation 10 minutes from the 
deadline?!)
b. 2-3 lines over, track a bit or suppress a subtitle
c. 10 lines over and this author will never accept a text cut, crop 
the picture instead, crop it!
d. 20 lines and the same as 3, change the font and squeeze the 
leading... oh! and yes, crop the pic, just a bit.
e. 300 lines over... well, at least you'll know it doesn't fit at all 
and can ask "by the way who the hell did the layout and thought it'd 
fit!"

:-)

Louis

>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
>
>_______________________________________________
>Scribus mailing list
>Scribus at nashi.altmuehlnet.de
>http://nashi.altmuehlnet.de/mailman/listinfo/scribus





More information about the scribus mailing list