Inter-word spacing problem with text-align: justify and text-indent > 0 #567
Comments
Thanks for the lightning fast response! I've just confirmed expected behavior with current master (commit ee6b506). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello there,
If
text-align
is set tojustify
andtext-indent
is set to a positive value, the first paragraph line ends before the trailing margin. This is due to reduced (instead of increased) inter-word spacing applied during justification, which may even make words overlap.I've tracked down the bug to
text_align()
function in filelayout/inlines.py
. For the first line only, theoffset
variable stores a negative value, which is divided to line spaces and causes reduced or negative inter-word spacing.MWE (larger values for
text-indent
worsen the result):Environment: Python 3.6.3 and WeasyPrint 0.42, both under Arch Linux and Mac OS.
Result (default font varies with OS):
The text was updated successfully, but these errors were encountered: