-
Notifications
You must be signed in to change notification settings - Fork 250
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
ln() does nothing at the beginning of a new file #937
Comments
I agree that this should be fixed. However wouldn't it be better to simply initialize |
pdf = FPDF()
pdf.set_font("helvetica", size=36)
pdf.ln() By how much would |
Alright! And let's use your sample in a unit test 🙂 |
Error details
ln()
movesself.y
either by its "h" argument or byself._lasth
.At the beginning of a file, _lasth is 0, so
Minimal code
Expected result:
Actual result:
Since we have a default font size of 12 points, I would expect self.y to get moved by that much in this situation.
I tried to fix that in #897, but then noticed that quite a few of our tests start with an ineffective ln() (usually within a loop where it later does have an effect). I didn't want to change all those otherwise unrelated tests (under shapes), so I'm bringing it up here.
The fix would be to simply use
self.font_size
if the other two values (the parameter "h" orself._lasth
) are None and 0.The text was updated successfully, but these errors were encountered: