Fantomas.CZ Posted November 1, 2022 Share Posted November 1, 2022 Hi everyone, I have a question concerning the paragraph composer or whatever it's called in APu. In Czech, and I guess in other languages too, it is considered ugly and bad practice to leave single-letter words at the end of the line, especially in the case of prepositions, which then get separated from their main word. Is there any setting I can apply to make APu work this way? I can of course manually (or maybe in the Search bar quasi-automatically) fill in the  , but that's very laborious and time consuming. Could you introduce an option for this to be a standard behaviour? Thanks for any answer! Quote Link to comment Share on other sites More sharing options...
Old Bruce Posted November 1, 2022 Share Posted November 1, 2022 3 minutes ago, Fantomas.CZ said: bad practice to leave single-letter words at the end of the line like this: the person talking is I. ? If yes then what you need to do is search for a space a single letter followed by a bit of punctuation (ie a dot/period/full stop/question mark/exclamation mark etc.) linebreak or new Paragraph. replace the found stuff that is not the space with the pattern and the space is replaced with the non-breaking space. Find: " (\b\w\b.\n)" Replace: "non breaking space\1" For extra points you can try making a choice of . and an optional ' or " or ), ], } etc for the closing bit of punctuation. I am a bit too fuzzy to figure that out right now. Quote Mac Pro (Late 2013) Mac OS 12.7.4 Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that. Link to comment Share on other sites More sharing options...
Rick G Posted November 1, 2022 Share Posted November 1, 2022 A work around might be this: If the preposition is separated by a space ... make it a hard space. That will make the preposition + the word act like one word Quote Affinity Designer 2.2.2075 & beta 2.3.1.2212 Affinity Photo 2.2.2075 beta 2.3.1.2212Affinity Publisher 2.2.2075 & beta 2.3.1.2212 Windows 11 Pro Version 22H2 OS build 22621.1928 Processor Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz 2.90 GHz Installed RAM 16.0 GB (15.7 GB usable) System type 64-bit operating system, x64-based processor Link to comment Share on other sites More sharing options...
Rick G Posted November 1, 2022 Share Posted November 1, 2022 1 minute ago, Old Bruce said: f yes then what you need to do is search for a space a single letter followed by a bit of punctuation (ie a dot/period/full stop/question mark/exclamation mark etc.) linebreak or new Paragraph. replace the found stuff that is not the space with the pattern and the space is replaced with the non-breaking space. We were posting at the same time 😁 Quote Affinity Designer 2.2.2075 & beta 2.3.1.2212 Affinity Photo 2.2.2075 beta 2.3.1.2212Affinity Publisher 2.2.2075 & beta 2.3.1.2212 Windows 11 Pro Version 22H2 OS build 22621.1928 Processor Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz 2.90 GHz Installed RAM 16.0 GB (15.7 GB usable) System type 64-bit operating system, x64-based processor Link to comment Share on other sites More sharing options...
sfriedberg Posted November 1, 2022 Share Posted November 1, 2022 2 hours ago, Old Bruce said: like this: the person talking is I. ? End of the line, generally not end of the sentence. So (pardon my vestigial Czech, these are all cut from the web) something like: Jsem z Prahy. or V létě pojedeme k moři. K, S, Z, and V are all one-letter prepositions in Czech. And A and I are one-letter conjunctions. Quote Link to comment Share on other sites More sharing options...
walt.farrell Posted November 1, 2022 Share Posted November 1, 2022 26 minutes ago, sfriedberg said: End of the line, generally not end of the sentence. That should make it a bit simpler, shouldn't it? Wouldn't you just find all the single-letter prepositions and conjunctions and replace the preceding space with a non-breaking space? (I know this discussion has happened before ) Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. iPad: iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1 Link to comment Share on other sites More sharing options...
Fantomas.CZ Posted November 2, 2022 Author Share Posted November 2, 2022 Yes, that's it: 13 hours ago, sfriedberg said: Jsem z Prahy. or V létě pojedeme k moři. I just wonder, whether there is a better way, because as I'm inserting new text, I need to do Find & Replace again and again, or then I need to go through the entire thing (well over 500 pages in one part) and fix the formatting that got messed up... And this is - in Czech and probably in many other languages - not some kind of exception, but a property, so the system should do this automatically, or at least have this option added to the orphan check - this is actually an orphan too, isn't it? In any case, thanks for the replies, guys! Quote Link to comment Share on other sites More sharing options...
SillyWalk Posted November 2, 2022 Share Posted November 2, 2022 19 hours ago, Fantomas.CZ said: Hi everyone, I have a question concerning the paragraph composer or whatever it's called in APu. In Czech, and I guess in other languages too, it is considered ugly and bad practice to leave single-letter words at the end of the line, especially in the case of prepositions, which then get separated from their main word. Is there any setting I can apply to make APu work this way? I can of course manually (or maybe in the Search bar quasi-automatically) fill in the  , but that's very laborious and time consuming. Could you introduce an option for this to be a standard behaviour? Thanks for any answer! Try this in Find/Replace via Regular Expression: Find: (\b[\l\u]\b)\h Replace: $1 (behind 1 add nonbreaking space Alt+Space bar on Mac) or Find: (\<[szkvaiouSZKVAIOU])[ ]+ Replace: $1 (behind 1 add nonbreaking space Alt+Space bar on Mac) Quote iMac: 3,6 GHz 10-Core Intel Core i9 / Graphic: AMD Radeon Pro 5500 XT 8 GB / System: Sonoma 14.1 (23B74) Link to comment Share on other sites More sharing options...
Old Bruce Posted November 2, 2022 Share Posted November 2, 2022 17 hours ago, sfriedberg said: End of the line, generally not end of the sentence. So (pardon my vestigial Czech, these are all cut from the web) something like: In your examples I see no way of easily finding the end of a line as it could be anywhere in the text flow depending on the font size and the text frame's width. In other words we would need language dependant rules plus the hard to implement "look at each and every line, continuously, in the entire document and fiddle with the justification and or spacing settings". Quote Mac Pro (Late 2013) Mac OS 12.7.4 Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that. Link to comment Share on other sites More sharing options...
walt.farrell Posted November 2, 2022 Share Posted November 2, 2022 1 minute ago, Old Bruce said: In your examples I see no way of easily finding the end of a line as it could be anywhere in the text flow depending on the font size and the text frame's width. In other words we would need language dependant rules plus the hard to implement "look at each and every line, continuously, in the entire document and fiddle with the justification and or spacing settings". Or, you find all the single-character problem cases, and join them to the next word with a non-breaking space. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. iPad: iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1 Link to comment Share on other sites More sharing options...
Old Bruce Posted November 2, 2022 Share Posted November 2, 2022 @walt.farrell, we would still need language dependant rules. Aside: An awful lot of the rules for 'good composition' are conventions adhered to because "it looks better like that" (for example the Widows and Orphan option). Others are actually needed due to a word's definition changing if the single character is not next to it. Quote Mac Pro (Late 2013) Mac OS 12.7.4 Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that. Link to comment Share on other sites More sharing options...
Fantomas.CZ Posted November 3, 2022 Author Share Posted November 3, 2022 On 11/2/2022 at 5:06 PM, walt.farrell said: Or, you find all the single-character problem cases, and join them to the next word with a non-breaking space. Yes... But to make it more interesting, it is acceptable to have lowercase "a" at the end of the line. But not the uppercase A, that looks just wrong 🙂 But I'm sure that's just a small complication in the code. It would be practical, if there was a way to script this, and also the colour changes to certain characters, so that I could just press a keyboard shortcut or a menu item and all those repetitive actions would be performed. walt.farrell 1 Quote Link to comment Share on other sites More sharing options...
loukash Posted November 8, 2022 Share Posted November 8, 2022 On 11/1/2022 at 8:42 PM, Fantomas.CZ said: I can of course manually (or maybe in the Search bar quasi-automatically) fill in the  , but that's very laborious and time consuming. Tady jsme to loni řešili: On 11/3/2022 at 8:30 PM, Fantomas.CZ said: it is acceptable to have lowercase "a" at the end of the line. But not the uppercase A, that looks just wrong Máš příklad? Možný to je, regex má spoustu takových triků. Ale z fleku ti neporadím, zas tak dobře se v regexu nevyznám. On 11/1/2022 at 8:42 PM, Fantomas.CZ said: Could you introduce an option for this to be a standard behaviour? I vaguely recall asking about Czech localization last year and getting a staff reply that it isn't high on Serif's priority list. (No problem for me as I prefer to run everything in English anyway, but e.g. a dealbreaker for my Czech buddy who was potentially interested in switching to Affinity.) So I suspect such language specific options aren't very high on their priority list either. But +1 from me. Quote MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2 Link to comment Share on other sites More sharing options...
bajqo Posted January 23, 2023 Share Posted January 23, 2023 Helo. Great solution thanky but have you solution for two-character prepositions too? In Slovak language is must as single-character prepositions. Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.