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

Editing hyphenation and dictionary files


Recommended Posts

I'm new to Affinity Publisher, coming from Indesign CS6 (which I own but cannot install on my new computer, because Adobe blocks activation now). I have part-finished projects and have exported as idml and opened these in Publisher, but the text does not alway appear correctly. In particular, though Publisher has done a remarkable job, I find that manual changes to Indesign's kerning etc and especially hyphenation is changed. Most of this I can manually fix, but ...

In Indesign I have an easy, fast way to add my own hyphenation to the dictionary so that words I commonly use are no longer marked as incorrect spelling and I can have the hyphenation I require. I have found out about using numbers to represent hyphen points (~ becomes 1 and so on) and I have a text file from Indesign with these (export is easy and find/replace changes tildes for numbers). BUT:

I cannot find the dictionary file to edit. I'm in the UK, so the installed dictionary is correctly 'English (United Kingdom)' and so I need to add 'my' words to this file.

My problem is ... where do I find it (and is this the best way to go?). Secondly, isn't there (I think there should be if not) the means to add words and hyphenation easily to the dictionary, as in Indesign, without having to locate a file and edit it manually. Or am I missing something, which is entirely possible.

Thanks for any pointers.

Link to comment
Share on other sites

Hi @CJH and welcome to the forums,

This post should help with regard to the location of the Hunspell spelling and hyphenation dictionaries used by the Affinity apps on both Mac and Windows...

Right-clicking on a word will allow you to select 'Learn Spelling' and that spelling will then be automatically added to the Spelling Dictionary... I'm not entirely sure if you can customise the Hunspell hyphenation dictionary but @MikeTO will know...

You may want to consider downloading Mike's free 300-page unofficial Publisher Guide which goes into great detail about numerous Publisher topics...

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2437) | Affinity Photo Beta 2.5.0 (2437) | Affinity Publisher Beta 2.5.0 (2437)

MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

Thanks for the help - the guide is with me now!

I feel there ought to be a way of adding words and hyphenation rules to the dictionary though, otherwise there would be no point in detailing how to use 1, 2,3,4,5 as indicators. The only post that came close that I could find was 164915 where someone added words to a dictionary that he had downloaded, only it didn't work ... then it turned out the settings were wrong to allow it to do so, then it was fine. When I look up where to find dictionaries, that folder is empty for me, I suspect because I have not added a dictionary but would like to modify the existing one - which was installed as part of the program.

Link to comment
Share on other sites

2 minutes ago, CJH said:

I feel there ought to be a way of adding words and hyphenation rules to the dictionary though

Words yes, hyphenation, I'm just unsure how it works so I would need to check but I mentioned @MikeTO because I know he will know the answer and be able to provide a better answer than I can at this moment...

7 minutes ago, CJH said:

When I look up where to find dictionaries, that folder is empty for me, I suspect because I have not added a dictionary but would like to modify the existing one - which was installed as part of the program.

I think the default en_GB spelling dictionary should appear in that folder along with the following files:

LocalDictionary
dynamic-counts.dat
dynamic-text.dat

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2437) | Affinity Photo Beta 2.5.0 (2437) | Affinity Publisher Beta 2.5.0 (2437)

MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

Nothing there but I'll do a search. The dictionary appears in the list in Character | Language | Spelling, along with others. It's hyphenation I really need to control though - I have many years of hyphenation rules in hand that it would be a shame to not use, for specialist words that otherwise break in awkward places using Indesign's automated rules when there are no had hyphens set in the dictionary.

I do note your way of adding new words to the dictionary (and thank you again), but even then it would take hours to add these when it would be simple to insert them into a dictionary in use. And as I said, I'm new to Publisher so will be missing things.

Link to comment
Share on other sites

This is Publisher's help file regarding hyphenation...

https://affinity.help/publisher2/English.lproj/pages/Text/hyphenation.html

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2437) | Affinity Photo Beta 2.5.0 (2437) | Affinity Publisher Beta 2.5.0 (2437)

MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

Thanks, yes, I found that one - it's where I found the way that hyphenation is controlled with a number, like yel1low so that the 1 in the middle indicates a hyphenation point. My musing is that there is little point in telling us this is how hyphenation is controlled without allowing us to set new rules or added words with rules to the hyphenation list. But, the Publisher Guide suggests this is not possible. Yet, I have words hyphenating in places I would not and, more commonly, not hyphenating at all where in the Indesign document they came from they hyphenate correctly under the rules I set.

Link to comment
Share on other sites

Interestingly, now the search seems to have finished, I have multiple copies of en_GB - all assoiated with Indesign (CS6, now removed beause it would not activate, but it's left litter), or Chrome, or Word or other programs in use, but none that indicate it is in an Affinity folder (or that I can account for as in a common folder).

Link to comment
Share on other sites

53 minutes ago, CJH said:

otherwise there would be no point in detailing how to use 1, 2,3,4,5 as indicators.

Where do you find something like that described?

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

I'd been experimenting with Learn Spelling recently but hadn't checked to see where these words ended up. Having just opened the en_GB dictionary the only content in there are the words I'd selected as not misspelt...

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2437) | Affinity Photo Beta 2.5.0 (2437) | Affinity Publisher Beta 2.5.0 (2437)

MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

5 minutes ago, walt.farrell said:

Where do you find something like that described?

It appears in the Help file linked above...

"As defined by the language-specific hyphenation dictionary, words have pre-defined hyphenation points at which hyphenation will occur. Each hyphenation point has a value weighting associated with it. For example, the hyphenation point in the middle of the word yellow (to produce the word "yel-low") has a score value of 1, i.e yel1low; for "acc-ommo-date" the values are acc2ommo5date. Setting a Minimum Score value to a larger number (e.g., 3) will hyphenate less often."

Affinity Designer 2.4.2 | Affinity Photo 2.4.2 | Affinity Publisher 2.4.2
Affinity Designer  Beta 2.5.0 (2437) | Affinity Photo Beta 2.5.0 (2437) | Affinity Publisher Beta 2.5.0 (2437)

MacBook Pro M3 Max, 36 GB Unified Memory, macOS Sonoma 14.4.1, Magic Mouse

Link to comment
Share on other sites

Are you on Mac or Windows? I'm going to guess Mac because you said your Spelling folder is empty.

If you're using a language such as English GB, it will be preinstalled. For Windows, it's installed in the Affinity dictionary folder (because there isn't an operating system level spell checker). For macOS, it's installed in a macOS system level folder so you can't see it because Affinity just uses the dictionaries that come with macOS.

If you're on macOS, your Spelling folder is empty because this is where you would store additional dictionaries that don't come with macOS. My manual indicates which ones are pre-installed.

As stated above, you can add words to the spelling dictionary by choosing Learn. There's no way to add exceptions to the hyphenation dictionary. A number of us have previously requested a feature like InDesign, Word, and other apps to add hyphenation exceptions through a user interface.

You could install a second copy of the hyphenation dictionary into the Spelling folder (following the instructions in the FAQ or my manual) which would override the macOS copy of English GB or whichever one you're using and then edit that but you'd have to learn the syntax - there's more to it than just the numbers.

Download a free manual for Publisher 2.4 from this forum - expanded 300-page PDF

My system: Affinity 2.4.2 for macOS Sonoma 14.4.1, MacBook Pro 14" (M1 Pro)

Link to comment
Share on other sites

Anto: Not tried that - but it appears as I learn more that perhaps the hyphenation dictionary is separate to the spelling dictionary, so the one would not help me with the other. I have a thousand or so words in a hyphenation dictionary I'd like to use though. I see now that in the manual (which is exellent) there is an indication that it is not possible to add hyphenation rules at all.

As background, I am a photographer and publisher, until recently publishing a magazine with a very tight layout and sometimes narrow columns (now I work more on books). Given the often specialist words in use and that Indesign often broke these incorrectly, the ability to add hyphenation rules using tildes was and remains incredibly important, or else I will spend too much time correcting the same word again and again. This is an important failing in Publisher, which so far has really otherwise impressed me. I hadn't expected to find something so mature vs Indesign (my sole reason for stopping using it is the lack of a perpetual license plus Adobe now turning off activation options for CS6 and Lightroom).

MikeTO - thank you for your reply and your manual (many thanks indeed). No, not a Mac, but Windows 11. New computer, clean install therefore. Though a search of my C drive does not reveal any en_GB associated with Affinity, that folder is empty. Perhaps that is where some problem lies, in that I don't find the hyphenation works well at all.

Aside: I have added a lot of words to the dictionary using Learn; at least I thought I was. I am using English GB with that selected, and following a suggestion in the manual set the same for hyphenation rather than auto. Hre's the oddity. The words are indeed added to the dictionary, because they are not flagged as incorrect later on. But, seemingly at random (but frequently), I click on a Learn word and the dictionary changes to English US and the hyphenation to auto. I put them back, click on a word, they change again. That shouldn't happen. I've tried selecting all text (CTRL-A) and then choosing the GB dictionary and hyphenation options, saving, then continuing to use Learn. Makes no difference.

Could this be linked to a lack of GB dictionary in that folder? Yet, other times the word is added and things work correctly.

But the Affinity team, my opinion, really needs to look at adding a user interface for hyphenation control. As a publisher, this is a severe lack that might even force me back to Indesign, much as I hate Adobe's stance.

Link to comment
Share on other sites

2 hours ago, CJH said:

No, not a Mac, but Windows 11.

Did you install Publisher 2 using the default MSIX installer, or the optional EXE/MSI installer?

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

It was the msix installer. I definitely have some odd things happening though. Today, calling up the spelling check, I have no words showing as incorrect. If I type a nonsense set of letters, the spellcheck picks this up, but no others (and they should be there as correct words (good words, not in the dictionary) that are not identifed as 'wrong'. Something odd there.

I think the import overall, using IDML from Indesign, is remarkably good. But if a developer wants to know, I find that any Indesign information such as a tightened section of text to pull back a line (say) is not carried over exactly (I imagine a failing of IDML information). Hyphenation certainly changes and it will require a lot of manual work to prevent text from running over the end of the page.

Link to comment
Share on other sites

If you're using English GB, there is a matching hyphenation dictionary so you can leave hyphenation language set to Auto. It's only those of us using languages such as English Canada and Australia who need to worry about this. We don't have our own hyphenation dictionaries so Auto will default to English US. If we want to use English GB (which is a far better hyphenation dictionary), we must select it manually.

Ensure you're defining the spelling language (and hyphenation language if you choose not to use Auto) in your paragraph and character styles. If you've selected all the text and applied it but then later applied a style, the language will revert to whatever it was in the style.

Download a free manual for Publisher 2.4 from this forum - expanded 300-page PDF

My system: Affinity 2.4.2 for macOS Sonoma 14.4.1, MacBook Pro 14" (M1 Pro)

Link to comment
Share on other sites

5 hours ago, CJH said:

Though a search of my C drive does not reveal any en_GB associated with Affinity, that folder is empty.

 

2 hours ago, CJH said:

It was the msix installer.

On Windows, the built-in dictionaries are stored in the Resources directory in the directory where the program is installed. And as you used the MSIX installer that directory is quite well Hidden by Windows. The easiest way to find it is via Task Manager. Run Publisher, then in Task Manager you can expand the entry for Affinity Publisher 2, and right-click the second line and choose Open File Location. In the resulting File Explorer window, locate the Resources folder, and the built-in dictionaries are in a directory there.

And Learned words are stored in your dictionary.propcol file, which you will find in %USERPROFILE%\.affinity\Common\2.0\user unless you've moved it.

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

Thanks to you both, MikeTO and Walt.farrell. I'll investigate those tips this afternoon.

In the meantime, I thought okay, that directory that was pointed out is empty, so perhaps I should download a new pair of files. Reporting on this:

Mike - the excellent manual you have includes a link to where links are found for the dictionary files on p298 - just letting you know the link is broken and gives a 'no page' result. Instead, I used the link from the Publisher help and this reaches Github and the correct area. I can find the two files for en-GB etc but have failed in 30 mins to download these. Clicking the raw/download button does nothing. The symbol above suggests using ctrl-shift-s but this does nothing. Double clicking the file, or single click, does nothing other than highlight the file. I've tried while signed in and not signed in. 

Two associated queries: is there any point in downloading these files, and any clues what I'm doing wrong in not being able to download?

Link to comment
Share on other sites

30 minutes ago, CJH said:

Instead, I used the link from the Publisher help

I would suggest using the files provided in the FAQ, and downloading from the FAQ, rather than downloading directly from GitHub.

 

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

You are right - that was much easier to download from that linked page. I found Github impossile to use. I have these downloaded but not used them; I'm unsure if they are needed.

It is clear that hyphenation is totally different to the rules set in Indesign. For example, I have a paragraph with loose lines that is not hyphenating the same way as the original file (actually, no hyphenating at all although I think I have everything set up properly). It creates an extra line in the paragraph. I've tried inserting a soft hyphen in the critical word, which has had no effect. A hard return (just like in Indesign) breaks the word and sorts out the paragraph, but of course without a hyphen and I don't wish to insert a permanent one, which asks for trouble. What I have not discovered is how to force a word to break and hyphenate, with me overruling anything that Publisher thinks is right. I'd expected the soft hyphen, Ctrl+shift+-, to force it to break at that point. Though I also still have not found a way to restart spell checking (which shows an empty box when opened to select learn or ignore), so perhaps something is linked.

Link to comment
Share on other sites

1 hour ago, CJH said:

actually, no hyphenating at all although I think I have everything set up properly). It creates an extra line in the paragraph. I've tried inserting a soft hyphen in the critical word, which has had no effect.

That sounds like one of three possibilities: 

1. You don't have the language set properly in the Character panel. Or

2. You don't have Automatic Hyphenation enabled in the Paragraph panel. Or

3. You don't have the dictionaries downloaded or installed properly.

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

Based on V1 and using English en-GB under windows

Adding extra words  is fairly trivial, just add dic & aff user files in C:\ProgramData\Affinity\Common\1.0\Dictionaries\en-GB
Attached files contain a few photographic terms
What annoyed me was that daguerre wasn't flagged as an error. The main dictionary contains
Daguerre/M  and
daguerreotype/DSMG 
so whether that caused confusion I'm not sure but I cracked it by including Daguerre/W in photo.dic with a rule in photo.aff of KEEPCASE W

You can't add user hyphenation dictionaries but need to modify the main file in
C:\Program Files\Affinity\Publisher\Resources\Dictionaries\en-GB
probably best to keep the old file as a backup in case it all goes wrong

Additions to hyph_en_GB.dic
photo5micro5graphy
photo5sens5itive

Another annoyance was photography hyphenating to pho-tography. It may be acceptable to some but not to me

So, at the bottom of hyph_en_GB.dic
LEFTHYPHENMIN 4
photo

Now it works to my satisfaction but photon won't hyphenate to pho-ton, I can live with that

What I can't fix is Wi-Fi, the main dic shows WiFi which is wrong as it's a trademark so a proper noun. Anyway, I changed that to Wi-Fi. Now I see an error if I type wifi and the suggestion is Wi-Fi, so I click that and Wi-Fi appears but still shows as an error. Weird or what?

There is much scope for editing this stuff but be prepared for headaches, I haven't found a definitive guide to editing hyphen files

photo.dic photo.aff

Microsoft Windows 11 Home, Intel i7-1360P 2.20 GHz, 32 GB RAM, 1TB SSD, Intel Iris Xe
Affinity Photo - 24/05/20, Affinity Publisher - 06/12/20, KTM Superduke - 27/09/10

Link to comment
Share on other sites

4 hours ago, CJH said:

Mike - the excellent manual you have includes a link to where links are found for the dictionary files on p298 - just letting you know the link is broken and gives a 'no page' result.

Thanks for reporting that, I will correct it for the next version. It should be this URL which is where Walt sent you: https://forum.affinity.serif.com/index.php?/topic/190021-how-do-i-add-additional-dictionaries-to-affinity-v2/&do=findComment&comment=1134760

 

Download a free manual for Publisher 2.4 from this forum - expanded 300-page PDF

My system: Affinity 2.4.2 for macOS Sonoma 14.4.1, MacBook Pro 14" (M1 Pro)

Link to comment
Share on other sites

Posted (edited)

Walt - thanks for the hint. But, Spelling is set to English (UK) and the rest of that panel to Auto. Hyphenation is set to 'use auto hyphenation' with minimum score 0, the going down 5, 2, 2, 2 for max consecutive hyphens (though I would normally accept one only), 0, 0, 0, 0. Dictionaries and whatever other files are involved are whatever were installed during the initial installation. How to force a hyphenation where I choose still escapes me though.

David - you are so akin to what I feel. I like text to display just so, and I'm somewhat particular over hyphenation, word repeats at the start of a line, and the like. But before I screw up, is what you mean with the two files you supplied that you add these to the relevant existing files (ie combine them)? I haven't investigated any syntax or, well, anything about editing files yet. I'm very much in a learning curve as to what I need to do to mirror what I am used to with Indesign.

You mean with the following, add this to the file at the end?

>So, at the bottom of hyph_en_GB.dic
LEFTHYPHENMIN 4
photo

Assuming it works the same in Publisher v2

Edited by CJH
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...
×
×
  • 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.