View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002049||Scribus||Scripter||public||2005-06-03 09:04||2005-06-04 08:30|
|Summary||0002049: To format text and get format with some tags|
|Description||I'm a beginner with scripting Scribus.|
I don't find any functions to insert a text with format. Secondly, if I format a text in the UI, I can't get this format with a getText() function.
It could be useful to support some tags like HTML (or maybe Qt). For example, to use :
getText(textframe) -> "AbcdefABCDEF"
Maybe with , , , <font>... (very basic tags)
Secondly, it could allow to copy a part of a text frame in another text frame (with keeping the format).
I don't know if it's possible : it's just a suggestion.
|Tags||No tags attached.|
This is a known limitation. Riku is working on a new text handling system for the core of Scribus. Once that's in place it should be possible to provide a nice interface to access formatted text via Python. Hopefully it'll be possible to include better support for paragraph styles and some support for character styles then too.
Until that's in place, I don't have any plans to work on styled text access from the scripter beyond what's already there. I don't think Petr does either.
You can, however, already insert styled text. The general method is to insert the text you want, then selectText(...) ranges of it and call setFont(...) on it, or set the style then start inserting text. The variety of styling info you have access to with this method is a bit limited.
|As per the linked related bug, I'm also interested in providing access to the XML representation of Scribus's styled text (once it has a "real" one with the new file format). This might also suit your needs, though I suspect a decent text styling API would be better.|
|2005-06-03 09:04||fcoiffie||New Issue|
||Note Added: 0004889|
||Status||new => acknowledged|
||Relationship added||related to 0001394|
||Note Added: 0004890|
|2006-05-13 21:39||christoph_s||Relationship added||child of 0003813|