View Issue Details

IDProjectCategoryView StatusLast Update
0017676ScribusScripterpublic2025-11-05 17:36
Reporterale Assigned Tocbradney  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.7.1.svn 
Fixed in Version1.7.1.svn 
Summary0017676: In the scripter's createParagraphStyle(), the tabs definition does not respect the current unit
DescriptionIn a script, when defining a paragraph style, the list of tabs is always defined in pt and not in the current unit.
TagsNo tags attached.
PatchNo

Activities

cbradney

2025-11-03 19:55

administrator   ~0053169

I have added a unit parameter like other functions have so you can select it

ale

2025-11-03 20:21

manager   ~0053170

Not sure it's a good idea.

If i get it correctly, now there is an optional argument "unit" for createParagraphStyle() and it only applies for defining the tabs.

For all the other measurement that can be defined for createParagraphStyle() the unit is... well, one must try : - )

I really think that it would be better if createParagraphStyle() would use the currentUnit for all values that are shown in the current unit in the UI.
This is what I expected, when trying to create the tabs.
And this is how most command in the scripter work.

cbradney

2025-11-03 20:42

administrator   ~0053171

Ok.. new code in now does this

ale

2025-11-05 17:10

manager   ~0053173

Last edited: 2025-11-05 17:36

Works well, thanks.

As a reference, for the time being, scripts will need to check for the Scribus version:

        style_tabs = []
        position = 10 # 10 current units
        if scribus.SCRIBUS_VERSION_INFO[:3] < (1, 7, 1):
            # Before 1.7.1, the tabs position was always in pt
            position = position * 2.835
        style_tabs.append((position))
        scribus.createParagraphStyle(name='style with tabs', tabs=style_tabs)


(but I don't think that many people have written scripts that define tabs... otherwise, there would already have been a bug report : - )

Issue History

Date Modified Username Field Change
2025-11-01 21:07 ale New Issue
2025-11-03 19:55 cbradney Note Added: 0053169
2025-11-03 19:55 cbradney Assigned To => cbradney
2025-11-03 19:55 cbradney Status new => resolved
2025-11-03 19:55 cbradney Resolution open => fixed
2025-11-03 19:55 cbradney Fixed in Version => 1.7.1.svn
2025-11-03 20:21 ale Note Added: 0053170
2025-11-03 20:42 cbradney Note Added: 0053171
2025-11-05 17:10 ale Note Added: 0053173
2025-11-05 17:36 ale Note Edited: 0053173