You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to set the paragraph style of a single paragraph inside a text frame with the Python API. However, when I select a text in a paragraph with selectText then call setStyle, the paragraph style of the whole text frame is changed, as well as the styles of each of the lines.
Here is how I tested:
I created a new Scribus document
I created a new paragraph style called 'My Style' ( just a clone of the default)
I created a new text frame with the contents consisting of 3 lines with a single character:
a
b
c
(The styles of each of the lines is No Style and the style of the frame is Default Paragraph Style)
The output from getText is 'a' as expected. However, the styles of all the lines have been changed to My Style (as well as the style of the frame). I would have expected that only the first line (which contains the selected text) would have been affected by setStyle.
the a gets red. only the a.
scribus.setStyle(s, 'Text1')
a few general notes:
print should be used as a function
if your scribus has setParagraphStyleyou should used it
I've now tested in a 1.5.5 i have laying around and indeed -- as i thought -- this is related to a bug I've reported (but could not find anymore) and that has been fixed not so long ago:
If you want setStyle to apply to a selection, you need to pass the frame name name as the second parameter.
scribus.setStyle(s, 'Text1')
does what you want.
As you see at the beginning of my comment, this has been fixed in the current build.
Hello,
I am using Scribus 1.5.5 on macOS.
I am trying to set the paragraph style of a single paragraph inside a text frame with the Python API. However, when I select a text in a paragraph with selectText then call setStyle, the paragraph style of the whole text frame is changed, as well as the styles of each of the lines.
Here is how I tested:
(The styles of each of the lines is No Style and the style of the frame is Default Paragraph Style)
The output from getText is 'a' as expected. However, the styles of all the lines have been changed to My Style (as well as the style of the frame). I would have expected that only the first line (which contains the selected text) would have been affected by setStyle.
This issue was referenced in #110 (at the end).
Is it actually possible to set the style of only a single paragraph ?
Thank you.
The text was updated successfully, but these errors were encountered: