[scribus] Italic Text when using Scripter
Gregory Pittman
gregp_ky at yahoo.com
Mon Nov 14 17:56:42 UTC 2011
On 11/14/2011 12:17 PM, Henry Hartley wrote:
> I have a script that makes a photo album from a directory of pictures. It actually reads the file names and associated photo titles from a file which lets me label the pictures as well as put them in an arbitrary order. The only thing that it isn't doing, which I have to do manually, is change the character style in many (but not all) of the photo labels. Many of the photos I'm working with are of plants and animals and they are labeled with both their common names and with their Latin binomials.
>
> What I'd like is to be able to have the text marked in some way so that when I bring it in from the text file, the Latin part is presented in italic.
>
> I don't see anything about doing this, although I can't say I've looked everywhere. I did find a post to this list on April 21, 2011 (by a.l.e) that says, "the scripter still does not support character styles. it will do before the end of the summer. promised." So, does the scripter support character styles? Or do I still have to do this manually?
>
You might try this:
setFont(...)
setFont("font", ["name"])
Sets the font of the text frame "name" to "font". If there is some text
selected only the selected text is changed. If "name" is not given the
currently selected item is used.
combined with:
selectText(...)
selectText(start, count, ["name"])
Selects "count" characters of text in the text frame "name" starting
from the character "start". Character counting starts at 0. If "count"
is zero, any text selection will be cleared. If "name" is not given the
currently selected item is used.
Obviously, you would need to select the appropriate text first.
Greg
More information about the scribus
mailing list