-
Notifications
You must be signed in to change notification settings - Fork 275
(Draft) Add Type 3 Fonts Functionality and Support for Color Fonts 🎨 #1305
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
base: master
Are you sure you want to change the base?
Conversation
46d8dfc
to
858140e
Compare
Revert "support python 3.13" This reverts commit 1aff62f. draft support for color fonts svg font fixes initial support for svg font fix duplicate resource entries typing for python 3.8 draft
858140e
to
da535dc
Compare
I'm no expert on fonts, but feel free to ping me if you want a review on this PR at some point 🙂 And thank you for working on this feature! 👍 |
Only missing COLRv1 support and some housekeeping... we should have a reviewable version soon. |
I don't know if this is the right place to report this, but I found a regression in the font_color branch linked to offset_rendering(): The following code fails with an AttributeError: 'FPDF' object has no attribute '_current_draw_context' import fpdf
pdf = fpdf.FPDF()
pdf.add_page()
pdf.add_font(fname='DejaVuSans.ttf')
pdf.add_font(fname='NotoColorEmoji.ttf')
pdf.set_font('DejaVuSans', size=14)
pdf.set_fallback_fonts(['NotoColorEmoji'])
pdf.multi_cell(text='abcdefghijklmnoqrtuvwxyz é 0123456789 🔴🟢🔵💀☠️', w=0)
with pdf.offset_rendering() as dummy:
dummy.multi_cell(100, None, "test")
pdf.output('issue_1446.pdf') |
Initial Draft: Type 3 Fonts and Color Fonts Support
Fixes #224
This PR introduces the initial implementation for Type 3 fonts and Color Fonts in PDFs. 🚀
Features:
fpdf.draw_path()
to produce the desired output without writing directly to the buffer.Next Steps:
Checklist:
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.