[Scribus] scripting problem: changing text font and size

Randolph Bentson bentson
Fri Nov 28 05:53:41 CET 2003


I've bumped into a problem while trying to set font and size of
text via a Python plugin script.  It seems that the script fails
if it were to change the last character.  I've included a small
example which demonstrates this problem.  As written, it changes
the middle of three characters, but if you change 'howMuch'
to 2, which would change the last two characters, it fails.

Any comments, suggestions, or fixes are welcome.

Randolph Bentson
bentson at holmsjoen.com

# Scribus Version 1.1.3cvs
# first entry in ChangeLogCVS dated: 24.11.2003
import scribus
text = "ABC"
where = 1
howMuch = 1

scribus.NewDoc(scribus.Paper_A4,
                (1,1,1,1), scribus.Portrait,
                1, scribus.Points,
                scribus.NoFacingPages,
                scribus.FirstPageRight)
a = scribus.CreateText(50, 50, 500, 200)
scribus.SetLineSpacing(36,a)
scribus.InsertText(text, 0, a)
scribus.SelectText(where, howMuch, a)
scribus.SetFontSize(24, a)



More information about the scribus mailing list