[scribus] recalculation of overflow is not correct
Chantal Rosmuller
chantal at antenna.nl
Mon Mar 2 17:40:15 CET 2009
On Monday 02 March 2009 14:29:08 Gregory Pittman wrote:
> Chantal Rosmuller wrote:
> > Hi, I am writing a script that loops through textboxes in a document and
> > resizes them until the frame fits. However after resizing and re
> > evaluating the overflow the script gives me the exact same number. How is
> > that possible and what can I do about it?
> >
> >
> > # ---------------------------------------------------#
> > # check of het script vanuit scribus wordt gestart #
> > #----------------------------------------------------#
> >
> > import sys
> > try:
> > import scribus
> >
> > except ImportError:
> > print "This script only works from within Scribus"
> > sys.exit(1)
> >
> > #Loop through the pages
> > page = 1
> > pagenum = scribus.pageCount()
> > while (page <= pagenum):
> > scribus.gotoPage(page)
> > #go to the next page in the next loop
> > page += 1
> > #and get all pageitems, this function gets
> > #name, obejcttype and ordre for eacht item
> > #
> > #objecttype 4 is textframe
> > ItemsOnpage = scribus.getPageItems()
> > #print pageitmes for debugging puprposes
> > ItemsOnpage
> > #count the number of items
> > NumberItemsOnpageTotal=len(ItemsOnpage)
> > #loop through items
> > NumberItemsOnpage = 1
> > while (NumberItemsOnpage <= NumberItemsOnpageTotal):
> > #whe have arrays of itemproperties (name, obejcttype and ordre)
> > #within arrays with items, first get the current itme number in the
> > array #current item number is NumberItemsOnpage but counting in an array
> > # starts with zero so subtract one
> > NumberItemsOnpageArraynumber=NumberItemsOnpage-1
> > #now move to the right item
> > CurrentItem=ItemsOnpage[NumberItemsOnpageArraynumber]
> > #the first value in the itemarray is the itemname
> > CurrentItemName=CurrentItem[0]
> > print CurrentItemName
> > #the secund value is the itemtype
> > CurrentItemType=CurrentItem[1]
> > print CurrentItemType
> > #type 4 is textbox
> > if CurrentItemType == 4:
> > print "this is a textbox"
> > selectObject(CurrentItemName)
> > OverflowChar = scribus.textOverflows(CurrentItemName)
> > print "initial overflow"
> > print OverflowChar
> > if OverflowChar > 0:
> > (CurrentItemwidth, CurrentItemheight) =
> > scribus.getSize(CurrentItemName) InitialAddition=1000
> > ItemHeight=CurrentItemheight+InitialAddition
> > scribus.sizeObject(CurrentItemwidth,ItemHeight,CurrentItemName)
> > ##OverflowChar = 0
> > ##print "overflow zero"
> > ##print OverflowChar
> > scribus.selectObject(CurrentItemName)
> > OverflowChar = scribus.textOverflows(CurrentItemName)
> > print "overflow after first adjustment"
> > print OverflowChar
> > #go to the next item
> > NumberItemsOnpage += 1
> >
> > _______________________________________________
>
> You think you have resized, but apparently not.
>
> I would try these things in sequence:
>
> 1. stick a getSize() command after your sizeObject() command. If nothing
> else, it will let you know if you actually did resize. It may also cause
> the sizeObject to take effect.
> 2. put a redrawAll command after the sizeObject() command.
>
> Greg
>
> _______________________________________________
> scribus mailing list
> scribus at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus
Hi,
I tried both:
redrawall does not help. getsize tells me the size increased but the overflow
value stays the same. Is this a bug?
Regards Chantal
More information about the scribus
mailing list