[scribus] Scripter setFontFeatures usage
Victor / tokiop
tor at tokiop.com
Sun Feb 23 19:57:26 UTC 2020
Le 23/02/2020 à 19:59, Peter Nermander a écrit :
>>
>> setFontFeatures("bold")
>>
>>
> I don't know for sure, but I have a slight memory of an older discussion
> about font features and I don't think they can be addressed by name, but
> need to be addressed by a number (it may even be font specific).
>
> I think the discussion I remember was more about "This font has features
> with numbers xx, yy and zz, how can I know what they mean?"
Thanks Peter ! I didn't manager to make it work using numbers either, or find more information.
Inspecting the .sla I noticed that when underlining from the story editor, the produced xml is :
<ITEXT CH="S"/>
<ITEXT FEATURES="inherit underline" CH="crib"/>
<ITEXT CH="us"/>
But Trying to replicate the same from script :
selectText(1,4)
setFontFeatures("inherit underline")
Produces this xml :
<ITEXT CH="S"/>
<ITEXT FONTFEATURES="inherit underline" CH="crib"/>
<ITEXT CH="us"/>
The scripter function setFontFeatures() seems to work, but uses a FONTFEATURES attribute versus FEATURES for the working / story editor version.
---
As a side note : "bold" doesn't seem to be a valid fontFeature entry. A bold selection is encoded by scribus by switching the font for it's bold variant with FONT="fontName Bold". Adding it manually in the .sla as FEATURES="inherit bold" has no effect.
More information about the scribus
mailing list