Jump to content
You must now use your email address to sign in [click for more info] ×

Paragraph flow: avoid leaving single-letter words at the end of line


Recommended Posts

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 &nbsp, but that's very laborious and time consuming. Could you introduce an option for this to be a standard behaviour? 

Thanks for any answer!

Link to comment
Share on other sites

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"

1634761953_ScreenShot2022-11-01at12_56_00PM.png.9af3a43d49027c1cf6061afc8eda9f0c.png

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.

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

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

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

yoda.png

Link to comment
Share on other sites

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 😁

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

yoda.png

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :) )

-- 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

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!

Link to comment
Share on other sites

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 &nbsp, 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)

 

Screenshot 2022-11-02 at 16.12.43.png

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

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".

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

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.

-- 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

@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.

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

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.

Link to comment
Share on other sites

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 &nbsp, 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. :) 

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

  • 2 months later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.