sile-typesetter / sile

The SILE Typesetter — Simon’s Improved Layout Engine
https://sile-typesetter.org
MIT License
1.65k stars 98 forks source link

Support emdash-introduced speaker changes in dialogues #1958

Closed Omikhleia closed 8 months ago

Omikhleia commented 8 months ago

(From https://github.com/Omikhleia/markdown.sile/issues/105)

In French and in Turkish (at least), it's common do have speaker changes in dialogues introduced by an em-dash:

— Lorem ipsum dolor sit amet, consectetur adipiscing elit, dit il. — C’est sûr !

For comparison, English does not use such dashes normally.

“Lorem ipsum dolor sit amet, consectetur adipiscing elit,” he said. “Sure!”

(English may use em-dashes, but at the end of a quote. Anyway, that's not the point here).

The tricky thing in such dialogues is that the space following the em-dash ought to be fixed (= not stretched or shrinked by line justification) so that subsequent dialogue lines start identically.

The workaround is to manually enforce it, by using explicit kerns in the input

—\kern[...]Lorem .... 

—\kern[...]Sure!

It's cumbersome, annoying when copying/pasting text.... and we'd be back to discussing a command for inserting a fixed inter-word space rather than craft a kern specifically.

This enhancement proposal is to automatically handle those case.

I'll make a PR with an implementation, for discussion.