-
Notifications
You must be signed in to change notification settings - Fork 275
Font fallback issue #1446
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
Comments
Hi @Oripy Thank you for reporting this. Apart from the fact that no warning is produced in that case, I do not think that this is really related to the fallback font mechanism: import fpdf
pdf = fpdf.FPDF()
pdf.add_page()
pdf.add_font(fname='NotoColorEmoji.ttf')
pdf.set_font('NotoColorEmoji', size=14)
pdf.multi_cell(text='abcdefghijklmnoqrtuvwxyz é 0123456789 🔴🟢🔵💀☠️', w=0)
pdf.output('issue_1446.pdf') The problem is simply that Any contribution is welcome to improve this, Does that answer your questions @Oripy? 🙂 |
It totally answers my question!
|
No, sadly there is no "easy" workaround... You could try to override Inserting images in PDF documents is very different from inserting text, |
Would there be a way to "convert" the glyph to its text name? That's maybe
not the right place to ask this question, if so I'm sorry.
If not, do you know any python library that support this type of colored
emojis?
|
I worked for a while in #1305 to support color fonts and emojis, introducing new features like type3 fonts that can support images as font glyphs. If you want to play a little and see if this will cover your needs you can install it from my branch:
I am considering getting the final touchups and tests done on this PR and merge it soon, then add the support to COLRv1 later. |
@andersonhc
|
Uh oh!
There was an error while loading. Please reload this page.
Error details
The PDF generated show the fallback glyphs as blank spaces instead of the actual glyph.
However if I copy/paste the text, the glyph is indeed present on the copied text value:
Text copied from the output pdf:
If I comment the set_fallback_fonts line, the glyphs are skipped (not present on the pdf) and the following warning appears:
Text copied from the output pdf:
Minimal code
Environment
Please provide the following information:
fpdf2
version used: fpdf2==2.8.3The text was updated successfully, but these errors were encountered: