-
Notifications
You must be signed in to change notification settings - Fork 254
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
Allowing to set padding in tables and multi_cell + vertical alignment in tables #797
Conversation
existing tests for "text" pass
issue with vertical cell alignment
Tests: Previously the cell borders were drawn per text-line. In this PR the borders are drawn for the whole cell at once and before rendering the text. The result is the same but the pdf structure is different which makes the tests fail. I guess I need to manually check if the produces pdf looks the same and then update the reference pdf? Another thing is that I would like to set the default value for padding to half the text-height. This would however cause all the previous unit-tests to fail. |
Features complete I guess
Ok, time for weekend. Unit tests have been written but only open the pdf for review. Will fix that once everybody is happy. Same for change-log |
Co-authored-by: Lucas Cimon <925560+Lucas-C@users.noreply.github.com>
Hi @Lucas-C , I've re-requested a review because the workflow: |
Ready to be merged again. |
I assume the correct one is your local copy? The copy on your Github fork branch is the weird version. Looks like something is out of sync there. Maybe you should try to regenerate your local copy with a fresh timestamp, so hopefully the correct version gets pushed to the server with the next commit. |
That is strange. How can the tests pass with the wrong reference pdf??? there is no dedicated test for it. It became part of table_colspan_and_padding_and_gutter. |
I removed Ready to be merged |
…e consistent with CSS. (updated one reference PDF because the vertical alignment was printed there as text)
Another rebase, and it's in! 👍 |
# Conflicts: # CHANGELOG.md # test/html/html_table_th_inside_tr_issue_137.pdf # test/html/html_table_with_border.pdf # test/html/html_table_with_multi_lines_text.pdf
Tests fail due to tiemout only. Ready to be merged. |
version number for padding 2.7.5 --> 2.7.6
It looks to be working nicely, passes all the tests, and you seem to have addressed all of @Lucas-C s concerns and suggestions. |
Thank you for reviewing & merging this @gmischler, |
### Fixed | ||
* [`FPDF.image()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.image), when provided a `BytesIO` instance, does not close it anymore - _cf._ issue [#881](https://github.com/py-pdf/fpdf2/issues/881) | ||
* Invalid characters were being generated when a string contains parentheses - _cf._ issue [#884](https://github.com/py-pdf/fpdf2/issues/884) | ||
* Frozen Glyph dataclass was causing problems for FPDFRecorder with TTF fonts - _cf._ issue [#890](https://github.com/py-pdf/fpdf2/issues/890) | ||
* Edge case when parsing a Markdown link followed by a newline - _cf._ issue [#916](https://github.com/py-pdf/fpdf2/issues/916), and when bold/italics/underline markers are | ||
* Zoom not set correctly when a numeric value was set in [`set_display_mode()`](https://py-pdf.github.io/fpdf2/fpdf/fpdf.html#fpdf.fpdf.FPDF.set_display_mode) - _cf._ issue [#926](https://github.com/py-pdf/fpdf2/issues/926) |
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.
I think a CHANGELOG.md
entry was deleted there, and also on line 23 😅
No worries, I will restore them
This PR adds an optional "padding" argument to multi_cell()
Using the same definition as in CSS:
"padding (float or Sequence): padding to apply around the text. Default value: 0.
When one value is specified, it applies the same padding to all four sides.
When two values are specified, the first padding applies to the top and bottom, the second to the left and right.
When three values are specified, the first padding applies to the top, the second to the right and left, the third to the bottom.
When four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise)"
Fixes #791 #892 #893
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.A unit test is covering the code added / modified by this PR
This PR is ready to be merged
In case of a new feature, docstrings have been added, with also some documentation in the
docs/
folderA 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.
Progress: