Scribus > Scripts and Plugins

Request information of the "setFontFeatures" function.

(1/2) > >>

Hi everyone and excuse my bad English.
I'm trying to use the SetFontFeatures function (Scribus 1.5.5svn) but without results.
The only documentation I found is that of the wiki ( I can't understand the correct syntax. I want to change the text track from my script.

I tried different syntaxes:
- setFontFeatures ("tracking = 5", myText)
- setFontFeatures (tracking = "5", myText)
- setFontFeatures ("tracking 5", myText)

the only syntax that returns no error is

- setFontFeatures ("tracking", myText)

but nothing changes, of course. :-D
Please, can someone write me an example of the function?


setFontFeatures ("fontfeature", ["name"])

Sets the font features of the text frame "name" to "fontfeature". If there is some text selected only the selected text is changed. If "name" is not given the currently selected item is used.

May throw ValueError if the font cannot be found.

new land for me... but i had a look at it...

"tracking" is not a font feature... font features are the ones listed in the text palette, under "font features" (ligatures, ...)

i did not know about that script for exporting the API... clever : - )

i used it to export the current API and the only way i've found for applying the tracking is by creating (and then applying) a character style...
depending on your goal it will be a usable solution or not...

thank you for the advice.
I will try this method. I have never used the createCharStyle function even if to get what I want, the listing will become very complex.
I currently use the function setTextScalingH (scale, ["name"]) and it satisfies me:

while (textOverflows (myText) == 1):
     if (y <81): break
     setTextScalingH (y, myText)
     y -= 1

I'd like to try using "tracking" together with "scalingH".
I probably don't translate well into my language what is written in English. From function "createCharStyle":

"features" [optional] -> nearer typographic details can be defined by a string that might contain the following phrases comma-seperated (without spaces!):

-> inherit
-> bold
tracking [optional] -> tracking of the text

Thanks and sorry the long post. If you feel it is impossible to do so, you also close this topic.

for that usage, creating a style is not a good way to go...

it's not very hard to add a new function to the API, it's just a bit tedious.

personally, i don't see it as a such important feature that i would now go and implement it, but you're welcome to make a patch and post it to ...

if you need help, just ask...

I had thought of that too, but I have to use this script even on a window version and I'm not very familiar with visual studio and Qt.
in truth, even for linux I would have some difficulties. I have never used cmaker or QT. it's certainly feasible but it takes too long for now.
Meanwhile I'm going crazy to understand why the function setProperties ("XorYpos", myobject)  move the objects of his choice!
but this is another topic.
tanks a lot


[0] Message Index

[#] Next page

Go to full version