-
Notifications
You must be signed in to change notification settings - Fork 263
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
How to use DejaVuSans Font with color emoji #1341
Comments
Hi @simkessy! 🙂 I checked you have read our documentation page about emojis? I'm a bit in a hurry right now, but I'll try to test your code asap 🙂 |
Hey @Lucas-C I have but yea I can't figure out how or if it's possible to have both a font for text and one for emojis in color I don't think the examples in the docs cover this and when I use a unicode font, like roboto or devajusans, it just uses the black and white version of those fonts and not the fallback with the emoji in color |
👍 I'm testing your code now... Reference links for the fonts: |
Oh, I just realized: we do not support color emojis yet! However @andersonhc, another maintainer of For reference, a minimal autonomous test script for testing: from fpdf import FPDF
pdf = FPDF()
pdf.add_page()
pdf.add_font(fname="fonts/DejaVuSans.ttf")
pdf.add_font(fname="OpenMoji-color-colr1_svg.ttf")
pdf.add_font(fname="TwitterColorEmoji-SVGinOT.ttf")
pdf.set_font("DejaVuSans", size=14)
pdf.set_fallback_fonts(["TwitterColorEmoji-SVGinOT", "OpenMoji-color-colr1_svg"])
pdf.multi_cell(0, text="".join([chr(0x1F600 + x) for x in range(68)]))
pdf.write(text="text with an emoji 🌭")
pdf.output("issue_1341.pdf") |
No questions, now that know it's not supported I can move on. Thanks for the quick response |
It's not clear to me how we're supposed to get emojis in the PDF.
For example. I have DejaVuSans has my font and emojis are just rendering using that instead of the colored emojis from TwitterEmoji.ttf.
Is that expected?
For example this is my setup:
When I try to render text with emojis, I just get the ones from DejaVuSans or Roboto and not the fallbacks.
The text was updated successfully, but these errors were encountered: