-
Notifications
You must be signed in to change notification settings - Fork 259
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
Fix NBSP support. Closes: #834. #851
Conversation
I need to add tests and changelog. |
You can just add a mention of your change in |
I don't speak English well, is it enough?
|
It might be helpful to mention this eg. in the paragraph about Character or Word Based Line Wrapping. After the first sentence, you could add something like this:
With a test to actually verify that, this is a very nice little fix! |
Based on the GitHub Actions execution logs, it seems that your PR is breaking a few existing unit tests:
You can try running them on your computer with this command:
Related doc: https://pyfpdf.github.io/fpdf2/Development.html |
docs/Text.md
Outdated
@@ -32,8 +32,9 @@ fixed_text = get_display(reshape(some_text)) | |||
``` | |||
|
|||
### Character or Word Based Line Wrapping | |||
By default, `multi_line()` and `write()` will wrap lines based on words, using space characters and soft hyphens as seperators. | |||
For languages like Chinese and Japanese, that don't usually seperate their words, character based wrapping is more appropriate. | |||
By default, `multi_line()` and `write()` will wrap lines based on words, using space characters and soft hyphens as separators. |
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.
On that occasion, you could also fix an old mistake, and change the incorrect multi_line()
in that sentence to multi_cell()
. 😉
Hi @rysson! Do you still want to finish this PR? 😊 Otherwise, maybe another contributor could take over |
@Lucas-C it depends... I'm on holidays now. Then another contributor could finish it faster. |
No worries, this can definitively wait until the end of August if you wish to finish this! 😊 I'm just going to perform a new release in the meantime. |
ca9b3fa
to
d51dcb9
Compare
I'm back and I trying to finish this PR.
I'm kidding, nothing to spot me :-P OK. I've made some fixes. @Lucas-C – about unitttest, |
Hi @rysson Thank you for getting back to this 😊👍 I haven't reviewed all your changes, but only based on the ones in Could you please fix this? |
Hi @rysson Have you been able to get back to this? Do you need with the |
f41a5e9
to
b0e2ea4
Compare
Oh, I've forgot, I'm very sorry. Ok, I've used cherry-pick for patch and I've generate same test PDF.
It's seems, that space (
Could you look into those test and tell me if I should generate those PDF too? |
b0e2ea4
to
56fddc9
Compare
56fddc9
to
cbf448e
Compare
OK, I generated PDF, they look good IMHO. I have another test failed: with time_execution() as duration:
build_pdf_with_big_images()
> assert duration.seconds > 0.3
E assert 0.2659818779939087 > 0.3
E + where 0.2659818779939087 = namespace(seconds=0.2659818779939087).seconds Maybe build server be a little bit slower and test passes. |
Yes, this is a recurring issue tracked in #923 |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #851 +/- ##
=======================================
Coverage 93.56% 93.57%
=======================================
Files 28 28
Lines 8209 8213 +4
Branches 1500 1501 +1
=======================================
+ Hits 7681 7685 +4
Misses 326 326
Partials 202 202
☔ View full report in Codecov by Sentry. |
This PR looks good to me 🙂 @gmischler would you like to get a look at it before we merge? |
Looks good to me. Let's send it. |
Fix NBSP, it's not-break but varible-width space. Fixes #834
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.