-
Notifications
You must be signed in to change notification settings - Fork 259
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
Support for emojis #145
Comments
Good question! Thanks for asking.
pdf.set_font("ZapfDingbats")
from fpdf import FPDF
pdf = FPDF()
pdf.add_font("NotoColorEmoji", fname="NotoColorEmoji.ttf", uni=True)
pdf.set_font("NotoColorEmoji")
pdf.add_page()
pdf.text(50, 50, "😃")
pdf.output("emoji.pdf") Raises:
Seems like I think that is because the Noto font is a CBDT/CBLC font, and we do not support them yet.
Of course, anyone is welcome to try to dig deeper on the subject, As mentioned before by @alexp1917, the other maintainer of |
This has just been released in fpdf2.4.3 |
Hi, Using the same example code from the second post of this thread, I still get the same error and no emojis on version 2.4.3. The only change I see in this is the line number 895 changing to 909:
|
CBDT/CBLC fonts are still not supported by fpdf2. You can however use the DejaVuSans font: from fpdf import FPDF
pdf = FPDF()
pdf.add_font("DejaVuSans", fname="test/fonts/DejaVuSans.ttf", uni=True)
pdf.set_font("DejaVuSans")
pdf.add_page()
pdf.text(50, 50, "😃")
pdf.output("emoji.pdf") |
Thanks for the reply! As DejaVuSans seems to have only the most basic emojis, I will have to look for another solution. Are there any plans to include CBDT/CBLC font support, or any issue I could follow meanwhile? Looking at the header, I don't think this issue is actually solved yet, but I'll leave it to you to consider whether it should be reopened. Example code still creating just squares:
|
I think I consider that fpdf2 now has some "basic" support for emojis (with some fonts), I'm totally OK if you want to open an issue about CBDT/CBLC font support, |
Is there any chance to implement the support for emojis to the generator? There is a free font at google called Noto which might be used (not sure).
As emojis are used widely all over the web and some pages even accept them as password, it would be great, if this wonderful asset whould have the support for it, too, wouldn't it?
The text was updated successfully, but these errors were encountered: