Jump to content
Our response time is longer than usual currently. We're working to answer users as quickly as possible and thank you for your continued patience.

Publisher: one-character prepositions don't work in V2


Recommended Posts

Hi!

In Czech, we have a strange habit not to leave one-character prepositions at the end of the row. In Publisher V1 I used Find/Replace Regular Expression 

(\<[szkvaiouSZKVAIOU])[ ]+

with

 $1<NBSP>

It doesn't work in Publisher V2 anymore. It searches for the characters, but then it mangles them somehow. Can someone help me? Thank you.

Link to comment
Share on other sites

It might help to have a short sample document to play with.

-- Walt

Desktop:  Windows 11 Home, version 21H2 (22000.613) 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 
Laptop:  Windows 10 Home, version 21H2 (19044.1706) 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
        Affinity Photo 1.10.6 (.1665) and 2.0..3  and 2.0.3.1670 beta/ Affinity Designer 1.10.6 (.1665)  and 2.0.3 and 2.0.3.1670 beta / Affinity Publisher 1.10.6 (.1665)  and 2.0.3 and 2.0.3.1670 beta
iPad Pro M1, 12.9", iPadOS 16.3, Apple Pencil 2, Magic Keyboard

      Affinity Photo 1.10.6 and 2.0.3 / Affinity Designer 1.10.6 and 2.0.3 / Affinity Publisher 2.0.3

Link to comment
Share on other sites

A sample file would still be nice :)

-- Walt

Desktop:  Windows 11 Home, version 21H2 (22000.613) 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 
Laptop:  Windows 10 Home, version 21H2 (19044.1706) 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
        Affinity Photo 1.10.6 (.1665) and 2.0..3  and 2.0.3.1670 beta/ Affinity Designer 1.10.6 (.1665)  and 2.0.3 and 2.0.3.1670 beta / Affinity Publisher 1.10.6 (.1665)  and 2.0.3 and 2.0.3.1670 beta
iPad Pro M1, 12.9", iPadOS 16.3, Apple Pencil 2, Magic Keyboard

      Affinity Photo 1.10.6 and 2.0.3 / Affinity Designer 1.10.6 and 2.0.3 / Affinity Publisher 2.0.3

Link to comment
Share on other sites

The big problem is that there is no way (currently) for the text to know and say "Here is the end of a line, as far as the font family and font size and text frame's width and hyphenation rules and justification say this line should end here, before continuing on with the text of the paragraph one line below."

We would need to have the text find all the "one-character prepositions" and replace the "space" with a "Non-Breaking" space. I know nothing about the grammar rules which would allow such a search and replace function so I'll stop now.

Mac Pro (Late 2013) Mac OS 11.7.3 
Affinity Designer 2.0.4 | Affinity Photo 2.0.4 | Affinity Publisher 2.0.4 | 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

33 minutes ago, Old Bruce said:

The big problem is that there is no way (currently) for the text to know and say "Here is the end of a line, as far as the font family and font size and text frame's width and hyphenation rules and justification say this line should end here, before continuing on with the text of the paragraph one line below."

That's why my string simply replaces every such preposition with a NBSP globally. In Czech, there is usually no reason to keep a lone character followed by a whitespace at the end of a line. So if you eventually reflow the frame content, all potential candidates are already fixed.

Link to comment
Share on other sites

  • 2 months later...

Hello, 

I have same problem as @Stepaan. Worst part is that i made 2 boklets and customer did not check it so there are lot of changed words....

Is it working solution now? And is there similar solution for two-character prepositions?

Thank you / Ďakujem chlapci.

 

Link to comment
Share on other sites

Hello

I found that Publisher V2 have problem with find and replace. When I try to find single letter words with:

(\<[szkvaiouSZKVAIOU])[ ]+

And replace with:

$1<NBSP>

The publisher find it correctly and if I replace one at the time publisher replace it correctly.

But when I click replace all then publisher mix the words. Sometimes replace a to u etc.

Have you same problem?

Link to comment
Share on other sites

2 hours ago, bajqo said:

Publisher V2 have problem with find and replace

2 hours ago, bajqo said:

when I click replace all then publisher mix the words

1 hour ago, bajqo said:

Záznam obrazovky 2023-01-25 o 9.30.03.mov

Good catch!
In v1 it works as expected.
In v2 not.

Looks like a bug to me.

Link to comment
Share on other sites

I don’t know anything about Czech, but reading the explanations, I think it’s more a problem with the Czech hyphenation dictionary than with Regex. I’d have to see what the creators of this dictionary on FireFox think about it.

6 cœurs, 12 processus - Windows 11 pro - 4K - DirectX 12 - Suite universelle Affinity (Affinity  Publisher, Affinity Designer, Affinity Photo).

Mais je vous le demande, peut-on imaginer une police sans sérifs ?

Link to comment
Share on other sites

1 hour ago, Pyanepsion said:

I think it’s more a problem with the Czech hyphenation dictionary than with Regex.

The issue discussed herein is that the same regex pattern is not giving the same result in v2 on Replace All. See @bajqo's screencast.

Link to comment
Share on other sites

\< is a GNU extension which is not supported by most regular expression engines; I wonder if they changed engines or grammars between the two versions?

I don't have any Czech text to test on, but try using either \b or [[:<:]] instead of \< to see if that makes a difference?

More details on these differences are documented here: https://www.regular-expressions.info/wordboundaries.html

Link to comment
Share on other sites

13 minutes ago, fde101 said:

\< is a GNU extension which is not supported by most regular expression engines; I wonder if they changed engines or grammars between the two versions?

I don't have any Czech text to test on, but try using either \b or [[:<:]] instead of \< to see if that makes a difference?

More details on these differences are documented here: https://www.regular-expressions.info/wordboundaries.html

I think that is not the problem. Publisher find what we want to. But difference is when you change it one by time or replace all. Please see video. 

But I try to change but still same result. Replace one by one works well but Replace All make a mess.

Link to comment
Share on other sites

The initial question is about the malfunction of the Czech language software, which therefore requires not to leave single-character words at the end of a line.

There is definitely a bug in the Regex handling of Replace All. Even if this bug is solved, it will not solve the original issue. Systematically pasting the one letter word to the word that follows is completely irrelevant, as it will create an inevitable malfunction in the justification.

Perhaps the solution is to add the Czech language to the dictionary of languages and hyphenations?

Here:

https://affinity.help/publisher2/English.lproj/index.html

Search:

Hyphen

Select

Managing hyphenation dictionaries

Then:

Hyphenation

What does it look like?

6 cœurs, 12 processus - Windows 11 pro - 4K - DirectX 12 - Suite universelle Affinity (Affinity  Publisher, Affinity Designer, Affinity Photo).

Mais je vous le demande, peut-on imaginer une police sans sérifs ?

Link to comment
Share on other sites

3 hours ago, Pyanepsion said:

The initial question is about the malfunction of the Czech language software

@Stepaan's post was exactly about the specific regex pattern not functioning correctly in v2.
While I have initally stated that it "works for me", at that time I have only checked the "find" part of the search, not the "replace all" part. The latter appears to be broken in v2.

3 hours ago, Pyanepsion said:

Perhaps the solution is to add the Czech language to the dictionary of languages and hyphenations?

It has nothing to do with the Czech dictionary as I'm using it already.

3 hours ago, Pyanepsion said:

It looks like you have pasted the wrong links… ;) 

Link to comment
Share on other sites

17 hours ago, loukash said:

@Stepaan's post was exactly about the specific regex pattern not functioning correctly in v2.

Hum. 🙂

On 11/15/2022 at 8:11 PM, Stepaan said:

In Czech, we have a strange habit not to leave one-character prepositions at the end of the row.

The question about the Regex is just a consequence of wanting to solve a peculiarity of Czech typography.

For typing in the Affinity suite, I would rather see an auto-correction option in the preferences that would allow to replace one-letter words then space by the letter itself followed by a non-breaking space. This would solve most of the problem and could even be generalised to other situations. It should be possible to specify any sequence of characters.

A bit like Word which allows you to automatically replace " with <nbsp>» where <nbsp> is a non-breaking space, or (c) by ©. To this can be added the knowledge of Unicode, that it understands for example that U+00C9 corresponds to É.

When it comes to rectifying a text already present in Affinity Publisher, I suggest the following sequence to be run as many times as necessary. It works with the Replace All function, whether there is one or more successive one-letter words:

Search:

[ |<nbsp>]([a|i|k|o|s|u|v|z|A|I|K|O|S|U|V|Z])[ ]+

Replace with:

[ ]$1<nbsp>

🔴The Online help does not provide direct links! I'm modifying it with a workaround.

6 cœurs, 12 processus - Windows 11 pro - 4K - DirectX 12 - Suite universelle Affinity (Affinity  Publisher, Affinity Designer, Affinity Photo).

Mais je vous le demande, peut-on imaginer une police sans sérifs ?

Link to comment
Share on other sites

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

×
×
  • Create New...

Important Information

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. These are the Terms of Use you will be asked to agree to if you join the forum. | 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.