-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: setText seems to change the formatting of the text #110
Comments
this is a well known bug that also happens in the UI. there are a couple of changes needed to really solve this issue (without introducing further complexity):
it's imo an important change that should be done asap in scribus. but i don't dare to make such a change without first having a commitment from the team that they agree with it and are ready to merge patches in a timely manner. |
to be more clear: i did not check in the code but this is what i think is happening:
of course, it would somehow be possible to solve the issue by storing somewhere the formatting of the last character. but this would add further complexity and, probably, new bugs. |
The issue also occurs when the formatting is set for the entire frame, not just for the individual characters inside the frame. This is why I think it is a bug. |
Hi, apologies for hijacking the report, I have a similar issue relating to the "getText()"/"getTextLines()" scripting API features. Am I correct in my understanding that there is no way to get/set the Style/Formatting of a single line... only the Text content as a string? I found https://bugs.scribus.net/view.php?id=15403 in the Mantis tracker, which indicates that I can get the style of a frame, but that isn't able to get or manipulate the style of a paragraph. If you use the Story Editor to format your document then this isn't useful. @aoloe - what can we do to read/write the style of a single line/paragraph within a frame through the scripting API without affecting the whole frame? Is this just something that I could expose to the API with a single method call, or would this rely on the "major changes" you referred to above? Thanks for all your hard work - if it helps I can open this as a separate issue. |
@badcommandorfilename i don't 100% get what you are asking for. i did not test it, but you should be able to select part of the text (there is a scripter command for it) and then get or set the paragraph style ( please, open a separate ticket for different issues... |
When using Python scripts,
setText
seems to change the formatting of the text rather than just to change the contents. A workaround can be used:But this is a bug imho that should be fixed properly.
The text was updated successfully, but these errors were encountered: