[scribus] Set formatted text using Scripter API

Andreas Winkler and.win at gmx.at
Tue Nov 4 12:59:17 UTC 2014


I was thinking about the possibility to parse the text for tags like <b> and <em> and then using selectText() to apply the formatting in Scribus, but I was hoping to find a simpler solution. However, the en+emdash.py script is a good starting point for my purpose.
Many thanks,
Andreas 
 

Gesendet: Dienstag, 04. November 2014 um 13:30 Uhr
Von: "Gregory Pittman" <gpittman at iglou.com>
An: "Scribus User Mailing List" <scribus at lists.scribus.net>
Betreff: Re: [scribus] Set formatted text using Scripter API
On 11/04/2014 07:19 AM, Gregory Pittman wrote:
> On 11/04/2014 03:52 AM, Andreas Winkler wrote:
>
> Hi,
>
> I'm new to scripting in Scribus.
> Is there an easy way to apply text with individually formatted passages
> to a text frame using the Scripter API? Something like
> setText("This is a <b>bold<\b> test")
> doesn't seem to work.
>
> Best regards
>
> Andreas
>
> Short answer: no
>
> I think your best method right now is to do this on the main canvas in
> Edit Contents mode, highlighting and applying styles as you go.
>
> It's possible to set styles in Scripter, but laborious and actually a
> bit tricky.
>

Though this does give me pause...

What if, something along the lines to the en+emdash.py script, one
inserted some character(s) to stand for the beginning and end of some
bold text? Then use that to set the beginning and end of some style
application. As I said, though, I have found style application with
Scripter to be tricky.

The other thing to consider is that Scribus can import HTML to some
extent, converting tags like <b> and <em> pretty easily...

Greg


___
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://wiki.scribus.net]
http://forums.scribus.net



More information about the scribus mailing list