![]() |
|
![]() |
![]() |
|
||
| · Hosting provided by Anduin.net / Øverby Consulting · | ||||||
| Anonymous | Login | Signup for a new account | 2013-05-25 11:35 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
| 0008957 | Scribus | Scripter | public | 10-Mar-20 17:51 | 12-Jun-13 16:40 | ||||||||
| Reporter | mochouinard | ||||||||||||
| Assigned To | jainbasil | ||||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||||||
| Status | assigned | Resolution | open | ||||||||||
| Platform | Inten 64bit | OS | Ubuntu | OS Version | 9.10 | ||||||||
| Product Version | 1.3.7svn | ||||||||||||
| Target Version | Fixed in Version | ||||||||||||
| Summary | 0008957: [patch] Add setTextPreserveStyle() that wont default back to the default style. (Silimar to Scribus 1.3.3 setText) | ||||||||||||
| Description | I really like to keep my template formating in the template, and having to re apply the style in my scripts is not something I really like to do. | ||||||||||||
| Tags | No tags attached. | ||||||||||||
| Attached Files | |||||||||||||
Notes |
|
|
(0023575) jghali (administrator) 10-Mar-20 19:52 edited on: 10-Mar-20 19:53 |
I strongly advise you against using such patch. It relies on behaviors that will be changed in future version. Noticeably, the story text default style will not be modifiable anymore. As previously stated when modifying text by script, you should apply style and formatting only on text content : - create text box - add some text - select text - apply formatting on selected text |
|
(0023581) ale (manager) 10-Mar-21 09:01 |
imho creating a "applyParagraphFunction()" function would be a better solution to this problem. and in the future, i think we should drop the idea that putting text into a frame clears its style settings. |
|
(0023585) jghali (administrator) 10-Mar-21 12:53 edited on: 10-Mar-21 12:53 |
a_l_e : a frame has no style anymore since 1.3.4. Only a text stream has and that default style is shared by all text frames the text stream runs in. That style will be made read only at a point. So not clearing style settings when putting text in frame will not avoid scripts which try to modify it to break. setStyle() already allows to apply paragraph style. |
|
(0023586) mochouinard (reporter) 10-Mar-21 14:23 |
I don't totally understand what you guys talk about ;) but here is what I'm doing : I create a template in scribus with prefilled sample data to prepare the style correctly. Then in my python script, I want to only modify the text, not the style. the setText() in 1.3.3 allowed me to do this, and it why I made setTextPreserveStyle() Now, I don't really care how it implemented, as long as I can do this, I'll be happy. And I'm sure I won't be alone that will have this problem migrating from 1.3.3 to newer version. |
|
(0023588) jghali (administrator) 10-Mar-21 15:05 edited on: 10-Mar-21 15:09 |
This is as simple as this : a text box has no style setting anymore, so your setTextPreserveStyle() won't help in future versions as the story text default style won't be modifiable anymore in gui or in script. From now on, formatting or styling must be applied on real text content, not on a box. Otherwise your scripts will break again soon. |
|
(0023596) ale (manager) 10-Mar-22 20:51 |
there is an issue which generally affects text frames: this code will replace the text in the current frame and set it to test without losing the formatting (as moc wants to do) scribus.selectText(0, scribus.getTextLength()); scribus.deleteText(); scribus.insertText('test', -1); this code will lose the formatting scribus.deleteText(); scribus.insertText('test', -1); this also lose the formatting: scribus.setText('acbdefg'); i understand that the formatting wants to be applied to text and not to frames, but, then, an empty frame should always contain an empty string which holds the current formatting (it may be non trivial to find a reliable way to choose the format that applies to the text inserted after the cursor, but the must be a way!) |
|
(0028124) ale (manager) 12-Jun-13 16:21 |
jain, please check if this bug can't be solved by working on http://bugs.scribus.net/view.php?id=10742 [^] |
|
(0028125) mochouinard (reporter) 12-Jun-13 16:40 |
As discussed in IRC, an solution that would be acceptable and maybe more flexible, would be a call we can do to store into an object all the style at a particular position in a text. Then we would apply text that would override the formating, but we could apply that object style back on the text box. We could also allow to create a style from that object. Then I would just have to make my own local function that does the save of style, apply text, and reapply of the style. Only reason why this current solution would be better, is there is less change of problem when people add new special style... They won't have to be added to the object(especially if we have pluggable style stuff in the future) |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 10-Mar-20 17:51 | mochouinard | New Issue | |
| 10-Mar-20 17:51 | mochouinard | File Added: scribus_setTextPreserveStyle.diff | |
| 10-Mar-20 19:52 | jghali | Note Added: 0023575 | |
| 10-Mar-20 19:53 | jghali | Note Edited: 0023575 | View Revisions |
| 10-Mar-21 09:01 | ale | Note Added: 0023581 | |
| 10-Mar-21 12:53 | jghali | Note Added: 0023585 | |
| 10-Mar-21 12:53 | jghali | Note Edited: 0023585 | View Revisions |
| 10-Mar-21 14:23 | mochouinard | Note Added: 0023586 | |
| 10-Mar-21 15:05 | jghali | Note Added: 0023588 | |
| 10-Mar-21 15:09 | jghali | Note Edited: 0023588 | View Revisions |
| 10-Mar-22 20:51 | ale | Note Added: 0023596 | |
| 12-Jun-13 16:20 | ale | Assigned To | => jainbasil |
| 12-Jun-13 16:20 | ale | Status | new => assigned |
| 12-Jun-13 16:21 | ale | Note Added: 0028124 | |
| 12-Jun-13 16:40 | mochouinard | Note Added: 0028125 | |
| 12-Jun-13 16:40 | mochouinard | File Added: Scribus_scipter_settextpreservestyle_api.diff | |
| 12-Jun-13 16:41 | mochouinard | File Deleted: scribus_setTextPreserveStyle.diff | |
| Main | My View | View Issues | Change Log | Roadmap |
| Copyright © 2000 - 2013 MantisBT Team |