[scribus] Scripter setFontFeatures usage

Victor / tokiop tor at tokiop.com
Sun Feb 23 21:30:46 UTC 2020


Le 23/02/2020 à 20:38, Gregory Pittman a écrit :
> Hi Victor,

Hi Greg,

> I don't find any Scripter command setFontFeatures(). As I look at the documentation, when font features are referred to, they're talking about OpenType font features.

I didn't find it either in Scribus Manual's Scripter API > Handling Text Frames.

But is listed here https://wiki.scribus.net/canvas/Automatic_Scripter_Commands_list and seems to have an effect. In this context is seems to refer to font variations/transforms : underline, strike, superscript, subscript, etc..

> I would suggest instead:
> 
> setFont("Deja Vu Sans Bold")
> setFontSize(30)
> setTextShade(50)
> 
> Alternatively, you could create and apply a Character Style with createCharStyle() and setCharacterStyle().

thanks, it seems like the best way to do it !

Regarding "font features", I wrongly tested with setFontFeatures("bold") which doesn't seem to be supported, but setFontFeatures("underline") looks like it should be supported but not added with the correct attribute name.

Victor



More information about the scribus mailing list