Closed Omikhleia closed 5 months ago
The second commit (refactor) does what's suggested above = marking the unshaped node, but doing the space replacement after shaping. No regression, and probably better?
The cost of the added complexity of this kind of trick might perhaps be acceptable.
I picked up the Russian book my wife happened to be reading the other day and discovered Russian (at least according to some publishers) does exactly the same thing for dialogue. I guess having this on by default was probably a pretty good move.
Closes #1958
Some conventions denote speaker changes in dialogues by starting a paragraph with an em-dash. In these cases, the space after the em-dash shall be fixed by default.
This is a naive proposal: intercept those from the input at typesetter level.
However, this implementation breaks test-865 which is a pullquote test. The pullquote author stands on its own paragraph line and is introduced by an em-dash: — Joe Smith
If done this "naive" way, what it does show is a bit more general: the kerning (likely) may be slightly affected:
This is not illogical (our fixed kern, introduced to replace the space, causes shaping to occur on each part around it, rather than the whole text. Whether this is acceptable is another question...
If we wanted it addressed after shaping, it probably gets a bit more complex, because we are then far past the point where we are sure to be at the start of a paragraph. What we could perhaps do is to only mark the unshaped text in some way at the typesetter level (as here, but without doing the replacement), and handle that later (after shaping, perhaps even in unicode node breakers where spaces are replaced with glues -- EDIT: which implies propagating the "mark" from the unshaped node to the shaped one(s) ^^).