TextAPI

class TextAPI

TextAPI inherits ItemAPI. It adds attributes and methods that are specific to Text Items in a Scribus document.

TextAPI Attributes

TextAPI.font

Used to get/set the font of text frame.

>>> textItem.font
u'Arial Regular'
>>> textItem.font = "Times New Roman Regular"
>>>
TextAPI.fontSize

Used to get/set the font size of text frame.

>>> textItem.fontSize
12.0
>>> textItem.fontSize = 18.0
>>>
TextAPI.text

Used to get/set the text in text frame.

>>> textItem.text
u'This is a sample text'
>>> textItem.text = "Sample text has been changed"
>>>

Note that using this function to set text content will erase the existing content in text frame.

TextAPI.textLines

Used to get the number of lines in the content of text frame.

>>> textItem.textLines
1
>>>
TextAPI.textLength

Used to get the length of text content in the frame.

>>> textItem.textLength
28
>>>
TextAPI.lineSpacing

Used to get/set the linespacing for text frame.

>>> textItem.lineSpacing
15.0
>>> textItem. lineSpacing = 16.0
>>>
TextAPI.distances

Used to get the text distances of the frame. It will return a list.

>>> textItem.distances
[0.0, 0.0, 0.0, 0.0]
>>>
TextAPI.deleteText

Used to delete the text in a text frame.

>>> textItem.deleteText
>>>
TextAPI.traceText

Used to trace the text frame.

>>> textItem.traceText
True
>>>
TextAPI.hyphenate
TextAPI.dehyphenate
TextAPI.PDFBookMark

TextAPI Methods

TextAPI.insertText(text, position)
TextAPI.setLineSpacing(mode)
TextAPI.setDistances(left, right, top, bottom)
TextAPI.setTextColor(color)
TextAPI.setTextStroke(color)
TextAPI.setTextScalingV(value)
TextAPI.setTextScalingH(value)
TextAPI.setTextShade(shade)
TextAPI.selectText(start, selectCount)
TextAPI.linkToTextFrame(name)
TextAPI.unLinkTextFrames()
blog comments powered by Disqus