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

Font becomes black inside and after a font tag in write_html #846

Closed
stenci opened this issue Jul 10, 2023 · 3 comments
Closed

Font becomes black inside and after a font tag in write_html #846

stenci opened this issue Jul 10, 2023 · 3 comments

Comments

@stenci
Copy link

stenci commented Jul 10, 2023

The output from the following code should all be red, instead it becomes black starting from the font tag:

from fpdf import FPDF

pdf = FPDF()
pdf.add_page()
pdf.set_text_color(200, 50, 50)
pdf.set_font(family='Helvetica', size=13)
pdf.write_html('one <font size=8>two</font> three')
pdf.output('html.pdf')

This is the output:
image

Notice that family and size are correctly restored, only the color is reset to black.

Environment

  • Operating System: Windows
  • Python version: 3.7
  • fpdf2 version used: 2.7.4
@Lucas-C
Copy link
Member

Lucas-C commented Jul 10, 2023

Thank you for the report @stenci

This is indeed a bug

I opened #848 to fix it

@Lucas-C Lucas-C added html font and removed font labels Jul 10, 2023
@Lucas-C
Copy link
Member

Lucas-C commented Jul 10, 2023

@allcontributors please add @stenci for bug

@allcontributors
Copy link

@Lucas-C

I've put up a pull request to add @stenci! 🎉

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

No branches or pull requests

2 participants