-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing: bullet/top_margin combo & width of indented paragraphs & some HTML bugs #1218
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mentioned a change in fpdf/html.py
in your PR description, but I do not see it in the PR diff 🙂
@@ -631,6 +632,7 @@ def __init__( | |||
self.balance = balance | |||
total_w = self.extents.right - self.extents.left | |||
col_width = (total_w - (ncols - 1) * gutter) / ncols | |||
self.h_margins = (pdf.c_margin, pdf.c_margin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the current usage of this attribute, I wonder if having 2 distincts attributes .l_margin
& .r_margin
would not make the code & intent clearer there? 🙂
"""Ensure that the top/bottom margins work with indented/bulleted | ||
paragraphs. | ||
Ensure that indented paragraphs have a reduced total width. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test 👍
self.pdf.c_margin + (self.indent - fragments_width - bullet_r_margin), | ||
self.pdf.c_margin, | ||
self._region.h_margins[0] | ||
+ (self.indent - fragments_width - bullet_r_margin), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't indent=self.indent
be provided there, instead of adding self.indent
to the left margin?
Fixes:
_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()
.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:
meaning that both
pylint
(static code analyzer) andblack
(code formatter) are happy with the changes of this PR.docs/
folderCHANGELOG.md
By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.