[scribus] Scripter API setLineStyle()

Juraj Fedel wtxnh-scribus at yahoo.com.au
Fri Oct 20 09:15:19 UTC 2017


On Thu, Oct 19, 2017 at 08:47:26PM +0100, ZASKE Martin wrote:
> import scribus
> ...
> scribus.setLineStyle(TableLineStyle)
> 
> gives me
> 
> NameError: name 'TableLineStyle' is not defined

you can try:
scribus.setLineStyle(scribus.LINE_DASHDOTDOT)

scribus.setLineStyle() probably does not do what you expect it to do. It
does set only one attribute of line - type of line to use. Read help for
coresponding scribus.getLineStyle().
You can use only one of those constant as value passed to function:
 scribus.LINE_SOLID
 scribus.LINE_DASH
 scribus.LINE_DOT
 scribus.LINE_DASHDOT
 scribus.LINE_DASHDOTDOT

If you want to change other aspects of line pick one of scribus.setLine* function:
setLineBlendmode
setLineCap
setLineColor
setLineJoin
setLineShade
setLineStyle
setLineTransparency
setLineWidth

(Note that setLineSpacing and setLineSpacingMode are about text frame not about lines as drawing)


> When I look into my .sla file my line style is so defined:
> 
>         <MultiLine Name="TableLineStyle">
>             <SubLine Color="blue" Shade="100" Dash="1" LineEnd="32"
> LineJoin="128" Width="10" Shortcut=""/>
>         </MultiLine>
> 
> 
> 
> We have specific technical reasons, why we do not want to hard-code the
> LineWidth and LineColor etc. into the script, but rather leave the
> styling to the user.

If I understand correct You want to associate "TableLineStyle" to some
line, then let user change that style as he wish and it is reflected on
line. I am afraid we do not have API to do this.

Juraj



More information about the scribus mailing list