Hyphenation in french

I am currently working on setting up hyphenation with Typst, and your advice would be very helpful.

test_hyphenation.pdf (36.1 KB)

  1. Typst as is : the spaces between words are too large for the first line.
  2. TeX : that seems correct, with a hyphen in the second occurrence of the word “indigna-tion.”
  3. Typst with explicit soft hyphen : ok by manually inserting a hyphen for the second “L’in-?di-?gna-?tion”

I don’t understand why it is necessary to explicitly add the soft hyphen.
Hyphenate Words Online proposes the correct solution : in-di-gna-tion.

So I tried other potential solutions in order to have a better hyphenation mechanism :

  1. Typst + hack Word wrapping works like in LaTeX? - #2 by bluss : the second “indignation” is correctly hyphenated, but hyphenation is now wrong for for p­o­u­r­r­­-a­i­t (instead of p­o­u­r­-r­­a­i­t, french rule)
  2. Typst + hyphenation cost at 1% : similar to “as is” situation
  3. Typst + justification-limits spacing trial 100% +/- 10% +/- 0.02em : trying to limit stretching and compression of the spaces, but result is similar to “as is” situation
  4. Typst + justification-limits tracking at +/- 0.02em : strong effect, but now the spaces between words are too small for the first line (and for the whole paragraph).

Are there any settings that allow for a balance closer to that achieved with TeX?

test_hyphenation.typ (2.2 KB)
test_hyphenation_tex.txt (1.0 KB)
test_hyphenation_tex.pdf (9.7 KB)

This is a bug, see #7087 and Is hyphenation disabled in words with apostrophes?

Yes, to my eyes it is a bug. If you are ready to patch typst and build it from the sources, you can find a link to a micro-patch that solves the apostrophe problem in the discussion of the ticket #7087; in fact this: all-any.patch.