fpdf2
fpdf2 copied to clipboard
Fixing: bullet/top_margin combo & width of indented paragraphs & some HTML bugs
Fixes:
- paragraph top_margin was ignored in the presence of a bullet (see discussion in #1217)
- indented paragraphs weren't made narrower, but the whole paragraph just shifted to the right.
- Converting legacy
_ln()for<li>to top_margin value in html.py. Some HTML tests need a t_margin value added to their TextStyle to avoid automatic empty lines in_new_paragraph(). - While testing the previous item, it became obvious that the
ln()of the text regions didn't always do what it is supposed to do with an explicit height given. This resulted in the "2mm" specification to simply be ignored, so that the layout of lists will now include a slightly wider gap, as was initially intended.
Checklist:
- [ ] The GitHub pipeline is OK (green),
meaning that both
pylint(static code analyzer) andblack(code formatter) are happy with the changes of this PR. - [x] A unit test is covering the code added / modified by this PR
- [ ] This PR is ready to be merged
- [NA] In case of a new feature, docstrings have been added, with also some documentation in the
docs/folder - [ ] A mention of the change is present in
CHANGELOG.md
By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.