Recent posts

#71
Text and Typography / Re: Paragraph styles
Last post by Bolean - September 10, 2023, 04:39:17 PM
Using text properties it's not a very sleek option for a book with many chapters. If indeed this is a bug my post could maybe function as a reminder.BDHDCM
#72
Text and Typography / Re: Paragraph styles
Last post by PatJr - September 10, 2023, 04:01:56 PM
looks like that isn't a variable for a style
F3 Content Properties has a setting for that under Columns & Text Distances

it does seem like the styles could use some development, imho there should be a frame tag/style, but I'm happy to use Scribus the way the developers make it
#73
Text and Typography / Paragraph styles
Last post by Bolean - September 10, 2023, 12:19:58 PM
Found some inconsistency when creating a chapter heading style. In the Alignment and Distances section the "space above" settings doesn't seem to work (no result in the document) while the "space below" works as expected.
I would like the heading start at a distance from the top and give a distance down to the body text.
#74
Text and Typography / Re: Formatting poetry
Last post by a.l.e - September 08, 2023, 06:20:32 PM
btw, it looks like this:

#75
Text and Typography / Re: Formatting poetry
Last post by a.l.e - September 05, 2023, 10:10:05 PM
hi sersha

in my eyes, using the tabs is rather a good idea.

but you mentioned that a script could also apply the styles and here is a script that does it:

- just apply the paragraph style to the first n paragraphs in the frames
- select the n paragraphs
- run the script to apply the style from the selection to the rest of the frame

https://github.com/aoloe/scribus-script-repository/tree/master/style-repeater

try:
    import scribus
except ImportError:
    print('This script must be run from inside Scribus')
    sys.exit()

def main():
    if not scribus.haveDoc():
        scribus.messageBox('Error', 'You need to have a document open')
        return

    if scribus.selectionCount() == 0 or scribus.getObjectType() != 'TextFrame':
        scribus.messageBox('Error', 'You need to select a text frame')
        return

    # get current selection
    selected_text = scribus.getFrameText()

    scribus.selectFrameText(0, 0)

    frame_text = scribus.getFrameText().strip('\r')
   
    if len(selected_text) == len(scribus.getFrameText()):
        scribus.messageBox('Error', 'There is no selection in the text frame')
        # no text selected
        return

    paragraphs_count = selected_text.count('\r') + 1

    frame_paragraphs = frame_text.strip('\r').split('\r')

    styles = []
    start = 0
    for paragraph in frame_paragraphs[0:paragraphs_count]:
        scribus.selectFrameText(start, len(paragraph))
        styles.append(scribus.getParagraphStyle())
        start += len(paragraph) + 1

    for i, paragraph in enumerate(frame_paragraphs[paragraphs_count:]):
        scribus.selectFrameText(start, len(paragraph))
        scribus.setParagraphStyle(styles[i % len(styles)])
        start += len(paragraph) + 1

    scribus.selectFrameText(0, 0)
       
if __name__ == "__main__":
    main()
#76
Text and Typography / Re: Formatting poetry
Last post by sersha - September 05, 2023, 01:38:34 PM
Thank you all who responded!
I did with tabs on second line, manually.
I also experimented with the second line indents and creating a style for that. It is better in a sense, but still a lot of manual work.
I am lazy! Thus looking for some sort of automated solution, like select a piece, apply a style or run a script and Voila! magic formatting happened!
But maybe it is not such a big deal, since rarely a poetry book is that huge... and it is easier to live with the manual setting of it.
#77
Text and Typography / Re: Formatting poetry
Last post by PatJr - September 05, 2023, 05:21:08 AM
did you try and change the indents?
it can be a little tricky, you have to type the values in, the slider things are a little janky.
#78
Text and Typography / Re: Formatting poetry
Last post by Nermander - September 04, 2023, 09:01:51 PM
The simple solution is maybe to add a tab at the start of every second line?
#79
Text and Typography / Formatting poetry
Last post by sersha - September 04, 2023, 08:23:40 PM
Greetings to all! I wonder, if anybody found the solution to properly indent a poetry piece of an arbitrary length. Like:

lineone line one line one
     linetwo line two line two
linethree line three line three
     linefour line four line four  ...and so on

I imagine creating a style with the second line indented, but that means you must apply it to every other line, which is still quite laborious with a longer piece. Maybe a script could be created for the purpose? Ideas, suggestions are very welcome!
#80
Free discussion / Re: I wonder if improving cont...
Last post by NathanUp - September 04, 2023, 08:21:03 PM
Got it; I'll stand by!