[scribus] Set formatted text using Scripter API
Gregory Pittman
gpittman at iglou.com
Tue Nov 4 12:30:51 UTC 2014
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
More information about the scribus
mailing list