[scribus] SCRIPT : Using different Fonts in the same text frame
Gael Grissonnanche
gael.grissonnanche1 at gmail.com
Sun Feb 26 19:57:41 UTC 2017
Hi Victor & Gregory,
Thank you very much for your help, that's what I needed. :)
Gaël
-----Message d'origine-----
De : Victor / tokiop [mailto:tor at tokiop.com]
Envoyé : 25 février 2017 12:15
À : scribus at lists.scribus.net
Objet : Re: [scribus] SCRIPT : Using different Fonts in the same text frame
Hi Gael,
an example to set some characters' font :
frame = "TextFrame"
scribus.insertText("hello bold world", -1, frame) scribus.selectText(6, 4,
frame) scribus.setFont("Liberation Sans Bold")
to set the current paragraph's style, and create it if it doesn't exist :
frame = "TextFrame"
stylename = "MyParaStyle"
scribus.insertText("hello world", -1, frame)
try:
scribus.setStyle(stylename, frame)
except scribus.NotFoundError:
scribus.createParagraphStyle(stylename)
scribus.setStyle(stylename, frame)
An instructive and complete example for styling via scripts :
https://wiki.scribus.net/canvas/Automatic_story_formatting
The full scripter api is available in :
Scribus > Help > Scribus Manual > For Developers > Scripter API
Have fun ! :)
Victor
On 25/02/2017 01:27, Gael Grissonnanche wrote:
> Hi everyone,
>
>
>
> I was wondering if it was possible to make a script that would use
> different Fonts in the same text frame? I haven't found support on the
> web for it, besides I am wondering if createParagraphe Style has this
> purpose, but I cannot find help with that neither.
>
>
>
> That you very much for yours,
>
>
>
> -------------- next part -------------- An HTML attachment was
> scrubbed...
> URL:
> <http://lists.scribus.net/pipermail/scribus/attachments/20170225/2befa
> 2fb/attachment.html>
> ___
> 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
>
___
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
More information about the scribus
mailing list