From matt.miller at fastmail.com Sat Dec 4 15:10:26 2021 From: matt.miller at fastmail.com (Matt Miller) Date: Sat, 04 Dec 2021 08:10:26 -0700 Subject: [scribus] Reconnecting Child Style Attribute to Parent Message-ID: <75604f43-6ce5-4e7a-b7ce-a166f28e945e@www.fastmail.com> I have some styles that are ?Based On? a parent style. If in the child style I override an attribute, say, the points of fixed linespacing under ?Alignment and Distances,? then that overridden field displays bolded and that attribute no longer follows changes in the attribute of the parent style. This is as expected. However, if I later decide I want to reconnect that attribute the the parent, I don't see how I can. I can set the child? value to be the same as in the parent, but still the child value appears bolded, and changes in the parent don't reflect in the child. How can I reconnect such a child attribute so that it will once again stay in sync with the parent? If I have to edit the .sla that would be acceptable. Thanks -- Matt Miller mailto:matt.miller at fastmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From colin at madwolf.co.uk Tue Dec 7 08:49:36 2021 From: colin at madwolf.co.uk (Colin Madwolf) Date: Tue, 7 Dec 2021 08:49:36 +0000 Subject: [scribus] feature request In-Reply-To: References: Message-ID: <1925715C-99A4-479D-805D-7261F289E3ED@madwolf.co.uk> Hi As you know I am designing a large book with over 300 pages There are 687 images - so far It is quite slow - but, one of the things that would REALLY help my workflow would be if the image file name was visible in the Image Frame content properties When I have to insert a new image it would be good to be able to see the file name here, so that I know what the next one is - instead of having to scroll through all the images repeatedly to look for the correct one At a later date if that image needs editing, it would make finding it so much easier if you could see the filename Thanks in advance Colin From david.burleigh at saphar.net Tue Dec 7 08:55:01 2021 From: david.burleigh at saphar.net (David Burleigh) Date: Tue, 07 Dec 2021 03:55:01 -0500 Subject: [scribus] Scribus Roadmap? Message-ID: The "Scribus Roadmap" seems to have become rather static. Is a new release of Scribus coming any time soon? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dl.lists at ntlworld.com Tue Dec 7 11:17:34 2021 From: dl.lists at ntlworld.com (dl) Date: Tue, 7 Dec 2021 11:17:34 +0000 Subject: [scribus] feature request In-Reply-To: <1925715C-99A4-479D-805D-7261F289E3ED@madwolf.co.uk> References: <1925715C-99A4-479D-805D-7261F289E3ED@madwolf.co.uk> Message-ID: <60f3fff8-a607-6c53-6da8-129e7aea97c5@ntlworld.com> On 07/12/2021 08:49, Colin Madwolf wrote: > Hi > As you know I am designing a large book with over 300 pages > > There are 687 images - so far > > It is quite slow - but, one of the things that would REALLY help my workflow would be if the image file name was visible in the Image Frame content properties > > When I have to insert a new image it would be good to be able to see the file name here, so that I know what the next one is - instead of having to scroll through all the images repeatedly to look for the correct one > > At a later date if that image needs editing, it would make finding it so much easier if you could see the filename > > Thanks in advance > Colin Any workflow automation question interests me whatever the application. Currently I am not a frequent user of Scribus. But I develop custom automation scripts to apply to other similar complex workflows. In Ubuntu 20.04 > Scribus 1.5.5 (it helps to declare user environment) my first thought was to explore Scripter. Sure enough there is a script DirectImageImport.py in /usr/share/scribus/scripts/DirectImageImport.py I noticed that I last played with this script in 07/2019. I open a blank Scribus document, inserted an image frame, highlighted it. and applied through toolbar: Scripter > Scribus Scripts > DirectImageImport This launches a GUI to select the image to be imported. I chose in left navigation panel $HOME/Pictures folder since it contains images. You could create a project folder with a tree structure (subfolders) to hold your 600 and growing images repository. In Image Import GUI tick ?Show Preview?. You now have a preview of each selected image and some properties below each preview. Now I suggest that this is a launchpad. A starting point. You could customise the Python script to do much more .. such as printing more metadata to suit your workflow. For example has the image been imported previously and so on. You might wish to tag imported images as you suggest for future editing. Admittedly, this script does not display the Image File Name in the Image Frame properties. But if you need this a popup note launched from within DirectImageImport.py could easily display this overlay information. In Ubuntu I would call Xpad tool. https://linuxhint.com/install-and-use-xpad-ubuntu/ To conclude, leverage Scripter for custom workflows and consider writing your own scripts which perhaps work _in concert_ with other tools/scripts. You can print a log of such imports. Automation is the keynote for your workflow. I could see the Python script interfacing to say GoogleSheets through Python API. DL -------------- next part -------------- An HTML attachment was scrubbed... URL: From colin at madwolf.co.uk Tue Dec 7 13:11:23 2021 From: colin at madwolf.co.uk (Colin Madwolf) Date: Tue, 7 Dec 2021 13:11:23 +0000 Subject: [scribus] feature request In-Reply-To: References: Message-ID: <050E917C-4339-4C39-88D2-98E2E2DB5A43@madwolf.co.uk> Hi DL And thanks for the lengthy comment, the script throws an error here of ?Unable to load Python library? - I have no idea what Python is BTW. And do not have the time or the know how to write scripts Just the image name showing some where would be so useful kind regards Colin > On 7 Dec 2021, at 12:00, scribus-request at lists.scribus.net wrote: > > Send scribus mailing list submissions to > scribus at lists.scribus.net > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.scribus.net/mailman/listinfo/scribus > or, via email, send a message with subject or body 'help' to > scribus-request at lists.scribus.net > > You can reach the person managing the list at > scribus-owner at lists.scribus.net > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of scribus digest..." > > > Today's Topics: > > 1. Re: feature request (Colin Madwolf) > 2. Scribus Roadmap? (David Burleigh) > 3. Re: feature request (dl) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 7 Dec 2021 08:49:36 +0000 > From: Colin Madwolf > To: scribus at lists.scribus.net > Subject: Re: [scribus] feature request > Message-ID: <1925715C-99A4-479D-805D-7261F289E3ED at madwolf.co.uk> > Content-Type: text/plain; charset=us-ascii > > Hi > As you know I am designing a large book with over 300 pages > > There are 687 images - so far > > It is quite slow - but, one of the things that would REALLY help my workflow would be if the image file name was visible in the Image Frame content properties > > When I have to insert a new image it would be good to be able to see the file name here, so that I know what the next one is - instead of having to scroll through all the images repeatedly to look for the correct one > > At a later date if that image needs editing, it would make finding it so much easier if you could see the filename > > Thanks in advance > Colin > > > ------------------------------ > > Message: 2 > Date: Tue, 07 Dec 2021 03:55:01 -0500 > From: David Burleigh > To: scribus at lists.scribus.net > Subject: [scribus] Scribus Roadmap? > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > The "Scribus Roadmap" seems to have become rather static. Is a new > release of Scribus coming any time soon? > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Tue, 7 Dec 2021 11:17:34 +0000 > From: dl > To: Colin Madwolf > Cc: scribus at lists.scribus.net > Subject: Re: [scribus] feature request > Message-ID: <60f3fff8-a607-6c53-6da8-129e7aea97c5 at ntlworld.com> > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > > > On 07/12/2021 08:49, Colin Madwolf wrote: >> Hi >> As you know I am designing a large book with over 300 pages >> >> There are 687 images - so far >> >> It is quite slow - but, one of the things that would REALLY help my workflow would be if the image file name was visible in the Image Frame content properties >> >> When I have to insert a new image it would be good to be able to see the file name here, so that I know what the next one is - instead of having to scroll through all the images repeatedly to look for the correct one >> >> At a later date if that image needs editing, it would make finding it so much easier if you could see the filename >> >> Thanks in advance >> Colin > Any workflow automation question interests me whatever the application. > Currently I am not a frequent user of Scribus. > But I develop custom automation scripts to apply to other similar > complex workflows. > > In Ubuntu 20.04 > Scribus 1.5.5 (it helps to declare user environment) > my first thought was to explore Scripter. > > Sure enough there is a script DirectImageImport.py in > /usr/share/scribus/scripts/DirectImageImport.py > > I noticed that I last played with this script in 07/2019. > > I open a blank Scribus document, inserted an image frame, highlighted > it. and applied through toolbar: > > Scripter > Scribus Scripts > DirectImageImport > > This launches a GUI to select the image to be imported. > > I chose in left navigation panel $HOME/Pictures folder since it contains > images. You could create a project folder with a tree structure > (subfolders) to hold your 600 and growing images repository. > > In Image Import GUI tick ?Show Preview?. > > You now have a preview of each selected image and some properties below > each preview. > > Now I suggest that this is a launchpad. A starting point. You could > customise the Python script to do much more .. such as printing more > metadata to suit your workflow. > > For example has the image been imported previously and so on. You might > wish to tag imported images as you suggest for future editing. > > Admittedly, this script does not display the Image File Name in the > Image Frame properties. But if you need this a popup note launched from > within DirectImageImport.py could easily display this overlay > information. In Ubuntu I would call Xpad tool. > https://linuxhint.com/install-and-use-xpad-ubuntu/ > > To conclude, leverage Scripter for custom workflows and consider writing > your own scripts which perhaps work _in concert_ with other > tools/scripts. You can print a log of such imports. > > Automation is the keynote for your workflow. I could see the Python > script interfacing to say GoogleSheets through Python API. > > DL > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > scribus mailing list > scribus at lists.scribus.net > http://lists.scribus.net/mailman/listinfo/scribus > > > ------------------------------ > > End of scribus Digest, Vol 165, Issue 2 > *************************************** From jluc at no-log.org Tue Dec 7 14:31:44 2021 From: jluc at no-log.org (JLuc) Date: Tue, 7 Dec 2021 15:31:44 +0100 Subject: [scribus] feature request In-Reply-To: <1925715C-99A4-479D-805D-7261F289E3ED@madwolf.co.uk> References: <1925715C-99A4-479D-805D-7261F289E3ED@madwolf.co.uk> Message-ID: Le 07/12/2021 ? 09:49, Colin Madwolf a ?crit : > one of the things that would REALLY help my workflow would be if the image file name was visible in the Image Frame content properties Not in the ImagePP as you wish, but the filename is displayed in the RightClick+Info menu on top of the image frame itself... Does(n't) that help ? JL From nickigriffin at gmail.com Tue Dec 7 14:49:07 2021 From: nickigriffin at gmail.com (Nicki Griffin) Date: Tue, 7 Dec 2021 14:49:07 +0000 Subject: [scribus] problem with Styles Message-ID: Dear List, I have recently unpgraded to Scribus 1.5.6.1 having upgraded the OS on my MacBook Air. I use Scribus to create a PDF for a print version of a bi-annual poetry newspaper. Having upgraded, I've had to recreate the settings from scratch as the master pages, styles etc were no longer working properly. I put in the Styles I use afresh. I create a file for each poem and prose piece in Open Office to import into Scribus. My problem is that the Styles are no longer working. I've tried applying them both in Story Editor and directly into the document, but they are not applying the text as I have it set up in Styles. Previously I created Paragraph Styles which worked for everything. One work around I have is that I've also created a Character Style for each style. This worked for the poems, but not the prose pieces. Things seem to work better if I copy and paste from Word into the text frame, then apply the style. This is all more labour intensive than previously. Any advice would be appreciated. Kind regards, Nicki -------------- next part -------------- An HTML attachment was scrubbed... URL: From cbradney at scribus.info Tue Dec 7 22:26:03 2021 From: cbradney at scribus.info (Craig Bradney) Date: Tue, 7 Dec 2021 23:26:03 +0100 Subject: [scribus] Scribus Roadmap? In-Reply-To: References: Message-ID: The roadmap is fairly simple in terms of releases. Release 1.5.8 as a next step for 1.6.0. Separately, we?ll branch the code and fix it to build with Qt 6.2. 1.7.x will be based on Qt 6.2 and higher. We?ve fixed almost everything we can in the codebase now without making incompatible changes for Qt 5.15. I?ll check with Jean but I?d say 1.5.8 isn?t that far away and then we?ll start that harder work. Craig > On 7 Dec 2021, at 09:55, David Burleigh wrote: > > ?The "Scribus Roadmap" seems to have become rather static. Is a new > release of Scribus coming any time soon? > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > ___ > Scribus Mailing List: scribus at lists.scribus.net > Edit your options or unsubscribe: > http://lists.scribus.net/mailman/listinfo/scribus > See also: > http://wiki.scribus.net > http://forums.scribus.net From david.burleigh at saphar.net Tue Dec 7 22:55:50 2021 From: david.burleigh at saphar.net (David Burleigh) Date: Tue, 07 Dec 2021 17:55:50 -0500 Subject: [scribus] Scribus Roadmap? In-Reply-To: References: Message-ID: Thank you, that is encouraging, and I greatly appreciate the work of all the developers. It's an uphill battle for me to convince the organization I'm a part of to abandon InDesign in favor of Scribus and other open-source software, but each new release of Scribus eliminates more excuses not to migrate. On Tue, 2021-12-07 at 23:26 +0100, Craig Bradney wrote: > The roadmap is fairly simple in terms of releases. Release 1.5.8 as a > next step for 1.6.0. > Separately, we?ll branch the code and fix it to build with Qt 6.2. > 1.7.x will be based on Qt 6.2 and higher. We?ve fixed almost > everything we can in the codebase now without making incompatible > changes for Qt 5.15. > I?ll check with Jean but I?d say 1.5.8 isn?t that far away and then > we?ll start that harder work. > Craig > > On 7 Dec 2021, at 09:55, David Burleigh > > wrote: > > ?The "Scribus Roadmap" seems to have become rather static. Is a > > newrelease of Scribus coming any time soon?-------------- next part > > --------------An HTML attachment was scrubbed...URL: < > > http://lists.scribus.net/pipermail/scribus/attachments/20211207/597c17d4/attachment.htm>___Scribus > > Mailing List: scribus at lists.scribus.net > > Edit your options or unsubscribe: > > http://lists.scribus.net/mailman/listinfo/scribus > > See also:http://wiki.scribus.net > > http://forums.scribus.net > > ___Scribus Mailing List: scribus at lists.scribus.net > Edit your options or unsubscribe: > http://lists.scribus.net/mailman/listinfo/scribus > See also:http://wiki.scribus.net > http://forums.scribus.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.miller at fastmail.com Fri Dec 31 01:49:57 2021 From: matt.miller at fastmail.com (Matt Miller) Date: Thu, 30 Dec 2021 18:49:57 -0700 Subject: [scribus] Paragraph Separator and Newline Both Showing as \r in Python Message-ID: <0a8d325a-35cd-4ce5-b96e-4a09653270cd@www.fastmail.com> I'm loading a text frame from a utf-8 encoded text file, and within my Scribus Python code I want to search for the standard newline character, ascii value 10. When I see an ascii 10 as the line separator I want to apply a special paragraph style to the following paragraph. Most paragraphs end with the Unicode paragraph separator character, \u2029, and in those cases the default paragraph style is fine. My problem is that both these types of characters are matching '\r' when I use re.search in python. also, if I select either line separator character, then do getText(), I get a '\r' no matter what. I've confirmed that my file encoding is utf-8. What am I missing? How can I search for a simple '\n' character? -- Matt Miller mailto:matt.miller at fastmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bertd.fpevohf.arg at taw.playbeing.com Fri Dec 31 11:40:05 2021 From: bertd.fpevohf.arg at taw.playbeing.com (Bert Driehuis) Date: Fri, 31 Dec 2021 12:40:05 +0100 Subject: [scribus] Paragraph Separator and Newline Both Showing as \r in Python In-Reply-To: <0a8d325a-35cd-4ce5-b96e-4a09653270cd@www.fastmail.com> References: <0a8d325a-35cd-4ce5-b96e-4a09653270cd@www.fastmail.com> Message-ID: I would expect the unicode value \u000A to match just newlines (or \u000C if you need to match CR). It has become a bit of a black magic these days... With kind regards, Bert On Fri, 31 Dec 2021 at 02:49, Matt Miller wrote: > I'm loading a text frame from a utf-8 encoded text file, and within my > Scribus Python code I want to search for the standard newline character, > ascii value 10. When I see an ascii 10 as the line separator I want to > apply a special paragraph style to the following paragraph. Most paragraphs > end with the Unicode paragraph separator character, \u2029, and in those > cases the default paragraph style is fine. > > My problem is that both these types of characters are matching '\r' when I > use re.search in python. also, if I select either line separator character, > then do getText(), I get a '\r' no matter what. I've confirmed that my file > encoding is utf-8. What am I missing? How can I search for a simple '\n' > character? > > > -- > > Matt Miller > mailto:matt.miller at fastmail.com > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://lists.scribus.net/pipermail/scribus/attachments/20211230/3c1178f6/attachment.htm > > > ___ > Scribus Mailing List: scribus at lists.scribus.net > Edit your options or unsubscribe: > http://lists.scribus.net/mailman/listinfo/scribus > See also: > http://wiki.scribus.net > http://forums.scribus.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvain-dupertuis at bluewin.ch Fri Dec 31 13:42:55 2021 From: silvain-dupertuis at bluewin.ch (Silvain Dupertuis) Date: Fri, 31 Dec 2021 14:42:55 +0100 Subject: [scribus] Paragraph Separator and Newline Both Showing as \r in Python In-Reply-To: References: <0a8d325a-35cd-4ce5-b96e-4a09653270cd@www.fastmail.com> Message-ID: <70981778-f20c-bbdd-bff3-3aa43e596b65@bluewin.ch> In my version (1.5.7), in Scribus code, paragraphs and newlines are encoded in XML, not with Unicode characters, and it is the same if I enter the text manually or copy it from a simple text editor. ?? ? ?? ? ?? ? ?? ? ?? ? ?? ? ?? ? ?? ? ?? ? Le 31.12.21 ? 12:40, Bert Driehuis a ?crit?: > I would expect the unicode value \u000A to match just newlines (or \u000C if > you need to match CR). > > It has become a bit of a black magic these days... > > > With kind regards, > > Bert > > On Fri, 31 Dec 2021 at 02:49, Matt Miller wrote: > >> I'm loading a text frame from a utf-8 encoded text file, and within my >> Scribus Python code I want to search for the standard newline character, >> ascii value 10. When I see an ascii 10 as the line separator I want to >> apply a special paragraph style to the following paragraph. Most paragraphs >> end with the Unicode paragraph separator character, \u2029, and in those >> cases the default paragraph style is fine. >> >> My problem is that both these types of characters are matching '\r' when I >> use re.search in python. also, if I select either line separator character, >> then do getText(), I get a '\r' no matter what. I've confirmed that my file >> encoding is utf-8. What am I missing? How can I search for a simple '\n' >> character? >> >> >> -- >> >> Matt Miller >> mailto:matt.miller at fastmail.com >> >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://lists.scribus.net/pipermail/scribus/attachments/20211230/3c1178f6/attachment.htm >> ___ >> Scribus Mailing List:scribus at lists.scribus.net >> Edit your options or unsubscribe: >> http://lists.scribus.net/mailman/listinfo/scribus >> See also: >> http://wiki.scribus.net >> http://forums.scribus.net >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > ___ > Scribus Mailing List:scribus at lists.scribus.net > Edit your options or unsubscribe: > http://lists.scribus.net/mailman/listinfo/scribus > See also: > http://wiki.scribus.net > http://forums.scribus.net -- Silvain Dupertuis Route de Lausanne 335 1293 Bellevue (Switzerland) t?l. +41-(0)22-774.20.67 portable +41-(0)79-604.87.52 web: silvain-dupertuis.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From gpittman at iglou.com Fri Dec 31 14:11:02 2021 From: gpittman at iglou.com (Gregory Pittman) Date: Fri, 31 Dec 2021 09:11:02 -0500 Subject: [scribus] Paragraph Separator and Newline Both Showing as \r in Python In-Reply-To: <0a8d325a-35cd-4ce5-b96e-4a09653270cd@www.fastmail.com> References: <0a8d325a-35cd-4ce5-b96e-4a09653270cd@www.fastmail.com> Message-ID: <127de55e-152c-9f35-a4eb-a6eb5c234112@iglou.com> On 12/30/21 20:49, Matt Miller wrote: > I'm loading a text frame from a utf-8 encoded text file, and within my Scribus Python code I want to search for the standard newline character, ascii value 10. When I see an ascii 10 as the line separator I want to apply a special paragraph style to the following paragraph. Most paragraphs end with the Unicode paragraph separator character, \u2029, and in those cases the default paragraph style is fine. > > My problem is that both these types of characters are matching '\r' when I use re.search in python. also, if I select either line separator character, then do getText(), I get a '\r' no matter what. I've confirmed that my file encoding is utf-8. What am I missing? How can I search for a simple '\n' character? Hi Matt, You don't say what OS you're using. Maybe running dos2unix on the text would help. You might also experiment with the text file outside of Scribus. When I use Kwrite, I can use it to Find/Replace '\n' in files. You might see what this matches versus '\r'. Greg From matt.miller at fastmail.com Fri Dec 31 19:19:53 2021 From: matt.miller at fastmail.com (Matt Miller) Date: Fri, 31 Dec 2021 12:19:53 -0700 Subject: [scribus] Paragraph Separator and Newline Both Showing as \r in Python In-Reply-To: <127de55e-152c-9f35-a4eb-a6eb5c234112@iglou.com> References: <0a8d325a-35cd-4ce5-b96e-4a09653270cd@www.fastmail.com> <127de55e-152c-9f35-a4eb-a6eb5c234112@iglou.com> Message-ID: On Fri, Dec 31, 2021, at 07:11, Gregory Pittman wrote: > On 12/30/21 20:49, Matt Miller wrote: >> I'm loading a text frame from a utf-8 encoded text file, and within my Scribus Python code I want to search for the standard newline character, ascii value 10. When I see an ascii 10 as the line separator I want to apply a special paragraph style to the following paragraph. Most paragraphs end with the Unicode paragraph separator character, \u2029, and in those cases the default paragraph style is fine. >> >> My problem is that both these types of characters are matching '\r' when I use re.search in python. also, if I select either line separator character, then do getText(), I get a '\r' no matter what. I've confirmed that my file encoding is utf-8. What am I missing? How can I search for a simple '\n' character? > > Hi Matt, > > You don't say what OS you're using. Linux > Maybe running dos2unix on the text would help. Well, my ideal workflow is one where the contents of the text file instruct Scribus what paragraph and character styles to use throughout the document. So, I'm careful to put exactly the characters I want into the text file. I've been largely successful, but now I've run into a case where it seems Scribus (or Python) is losing information when I load the file. From inside Scribus I can't distinguish between a Unicode paragraph separator, \u2029, and a simple line feed, \u000A. I'm able to open my text file from the Python console and dump it out to see that newline is displayed as "\n" and a paragraph separator is displayed as "\u2029." So, I'm suspecting the problem is with Scribus, or how I'm using it. I'm loading the file using insertHtmlText(), but I get the same bad behavior from the GUI when I do "Content | Get Text..." and load the file manually. I've attached a text file that shows the problem. If you run the following in the scripter console from a document with a text frame named "Text1" you should see the problem: insertHtmlText('/path/to/line-breaks.txt', 'Text1') text=getText('Text1') text You should then see that both the paragraph separator and the line feed show as '\r' in the string variable. From the .sla I also see that both these characters are stored the same, as : However, here's the output I get when I dump the file from the Python console, showing '\n' for the line feed, as it should: >>> with open('line-breaks.txt', encoding='utf-8') as file: ... for line in file: ... line ... '\ufeffThis line ends with a paragraph separator (2029).\u2029This line ends with a line feed (000A).\n' 'This line ends with a line separator (2028).\u2028This line ends with a carriage return (000D).\n' 'This line ends with a vertical tab (000B).\x0bThis line ends with a carriage return and a line feed (000D000A).\n' >>> This test file has six different lines with six different ways to delimit the lines for testing, but, for my current purposes it's just the first two types, \u2029 and \u000A, that I need to distinguish between. Thanks. > You might also experiment with the text file outside of Scribus. When I > use Kwrite, I can use it to Find/Replace '\n' in files. You might see > what this matches versus '\r'. > > Greg > > > ___ > Scribus Mailing List: scribus at lists.scribus.net > Edit your options or unsubscribe: > http://lists.scribus.net/mailman/listinfo/scribus > See also: > http://wiki.scribus.net > http://forums.scribus.net -- Matt Miller mailto:matt.miller at fastmail.com -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: line-breaks.txt URL: From gpittman at iglou.com Fri Dec 31 22:59:27 2021 From: gpittman at iglou.com (Gregory Pittman) Date: Fri, 31 Dec 2021 17:59:27 -0500 Subject: [scribus] Paragraph Separator and Newline Both Showing as \r in Python In-Reply-To: References: <0a8d325a-35cd-4ce5-b96e-4a09653270cd@www.fastmail.com> <127de55e-152c-9f35-a4eb-a6eb5c234112@iglou.com> Message-ID: <45d1da4e-caca-8805-c201-76e834d2cc82@iglou.com> On 12/31/21 14:19, Matt Miller wrote: > On Fri, Dec 31, 2021, at 07:11, Gregory Pittman wrote: >> On 12/30/21 20:49, Matt Miller wrote: >>> I'm loading a text frame from a utf-8 encoded text file, and within my Scribus Python code I want to search for the standard newline character, ascii value 10. When I see an ascii 10 as the line separator I want to apply a special paragraph style to the following paragraph. Most paragraphs end with the Unicode paragraph separator character, \u2029, and in those cases the default paragraph style is fine. >>> >>> My problem is that both these types of characters are matching '\r' when I use re.search in python. also, if I select either line separator character, then do getText(), I get a '\r' no matter what. I've confirmed that my file encoding is utf-8. What am I missing? How can I search for a simple '\n' character? >> >> Hi Matt, >> >> You don't say what OS you're using. > > Linux > >> Maybe running dos2unix on the text would help. > > Well, my ideal workflow is one where the contents of the text file instruct Scribus what paragraph and character styles to use throughout the document. So, I'm careful to put exactly the characters I want into the text file. I've been largely successful, but now I've run into a case where it seems Scribus (or Python) is losing information when I load the file. From inside Scribus I can't distinguish between a Unicode paragraph separator, \u2029, and a simple line feed, \u000A. > > I'm able to open my text file from the Python console and dump it out to see that newline is displayed as "\n" and a paragraph separator is displayed as "\u2029." So, I'm suspecting the problem is with Scribus, or how I'm using it. I'm loading the file using insertHtmlText(), but I get the same bad behavior from the GUI when I do "Content | Get Text..." and load the file manually. > > I've attached a text file that shows the problem. If you run the following in the scripter console from a document with a text frame named "Text1" you should see the problem: > When I save this file then open it with kwrite, then when I do a Replace operation trying to switch \n to

(an arbitrary choice), I see the replacement happen at the end of the 2nd, 3rd, 4th, and 6th sentences. Greg