[scribus] Scripter API setLineStyle()

ZASKE Martin zm at revue-gugu.org
Fri Oct 20 21:19:54 UTC 2017


Dear Juraj and Greg,

thank you guys again for your help.


I see that I had a misunderstanding: I had tried to have my script apply
one of the user-created "Line Styles" (from the F3 Style Manager window).

But the stuff in the API documentation, even though called LineStyle, is
referring only to the "Type of Line" (as it is called in the F2
properties window).

So as "Types of Line" I can have solid, dash, dashdot, dashdotdot, dot.

I liked the trick to look over at getObjectProperties for learning more
about setObjectProperties.



Pity, that there is no API for the user "Line Styles" but then I will
discuss with my wife (main customer for this context) and either
hard-code after all or give her two more dialogue questions with
defaults - or show her where in the script she could hack it... For
normal documents and tables it all comes down to line-width and line-colour.



A few months ago I had to learn (and did) that in Scribus one text frame
is a text frame. And a story means all connected text frames (one or more).

So it should probably be called here getLineType() and setLineType().

But I will learn it the way it is. Makes me a little more an "insider"...


thanks again; scripting is great fun, just call the file, hit ENTER
twice (if you like the defaults) and the document is getting objects
that would take three minutes to create and format

Martin



On 20.10.2017 10:15, Juraj Fedel wrote:
> 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
> 
> ___
> Scribus Mailing List: scribus at lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus
> See also:
> http://wiki.scribus.net
> http://forums.scribus.net
> 
> __________ Hinweis von ESET NOD32 Antivirus, Version der Erkennungsroutine 16276 (20171020) __________
> 
> E-Mail wurde geprüft mit ESET NOD32 Antivirus.
> 
> http://www.eset.com
> 
> 
> 
> 


-- 
ZASKE Martin
responsable GʊGʊ
BP 50 - Bassila - Bénin
tel GʊGʊ 66.66.11.11
tel pers 97.44.62.95



More information about the scribus mailing list