Skip to content
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 issue #1223: pdf.font_style now behaves like pdf.set_font #1254

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

smilerightnow
Copy link

@smilerightnow smilerightnow commented Sep 1, 2024

Fixes #1223

Checklist:

  • The GitHub pipeline is OK (green),
    meaning that both pylint (static code analyzer) and black (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

  • [N/A] 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.

@andersonhc
Copy link
Collaborator

Hi @smilerightnow
Pylint is failing on the file below

Run pylint fpdf test tutorial/tuto*.py
************* Module fpdf.fpdf
fpdf/fpdf.py:1946:0: C0303: Trailing whitespace (trailing-whitespace)```

removed 4 spaces for pylint
@smilerightnow
Copy link
Author

thanks @andersonhc for pointing it out, I removed the 4 spaces :)

Copy link
Member

@Lucas-C Lucas-C left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @smilerightnow

Thank you for submitting this PR 🙂

I just took a look at it, and it seems that this does not implement the solution discussed in #1223:

  • this PR currently introduces a ._font_style attribute, whereas I suggested an ._emphasis attribute
  • this PR introduce new .font_style properties, but this was not required
  • this PR does make the pre-existing emphasis propery and .underline .font_style depend on the new ._emphasis attribute, which is the main goal there

Could you pleasae re-read the original issue @smilerightnow in order to better understand the requirements?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pdf.font_style = "B" and pdf.emphasis = "BOLD" should behave the same way as pdf.set_font(style="B")
3 participants