Can’t use widows when hyphens disabled
RicLeP opened this issue · comments
Ric Le Poidevin commented
I have the following settings but widows seems dependant on hyphenation being enabled. Is this a bug or expected behaviour? It would be very useful to dewidow without hyphenation.
$typographySettings = new Settings();
$typographySettings->set_dewidow(true);
$typographySettings->set_max_dewidow_length(20);
$typographySettings->set_hyphenation(true); // when false widows are not applied
$typography->process($page->body, $typographySettings);
Der Mundschenk & Compagnie commented
Hi @RicLeP!
I think the reasoning behind this was to prevent long word switching lines when hyphenation is disabled (making things even uglier). That said, I see no reason to enforce this if someone wants to dewidow without hyphenation.
Der Mundschenk & Compagnie commented
Actually, there is no such limitation. You just need to set the maximum pull as well (using set_max_dewidow_pull
). I guess I always should look at the code before answering ;-)