Skip to content

Add Emoji support #1698

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

Open
trushar-narodia opened this issue Mar 23, 2018 · 10 comments · May be fixed by dompdf/php-font-lib#140
Open

Add Emoji support #1698

trushar-narodia opened this issue Mar 23, 2018 · 10 comments · May be fixed by dompdf/php-font-lib#140
Milestone

Comments

@trushar-narodia
Copy link

hi
i have one issue while i try to print emoji in pdf using encode string so its display white blank string and nothing return any error
i have this type of emoji encoded string
test\uD83D\uDE00\uD83D\uDE00\uD83D\uDE00
so how to print this string in emoji character in pdf please guide how to do this

@Nightbr
Copy link

Nightbr commented Nov 19, 2018

Hey, no choice, I think you must replace emoji by the corresponding image manually when you build your HTML... I run into the same issue and it seems to be the only choice. It could be great if there is an emoji parser built in dompdf and replace automatically emojis.

@bsweeney
Copy link
Member

Do you have a font that supports the emoji characters?

@simonschaufi
Copy link

@bsweeney The font https://github.com/googlefonts/noto-emoji/tree/master/fonts "NotoColorEmoji.ttf" supports Emojis but produces an error of missing index C

@bsweeney bsweeney changed the title emojis not display from encoded string Add Emoji support Jun 14, 2020
@bsweeney
Copy link
Member

bsweeney commented Jun 14, 2020

@simonschaufi seems like something about the font format is incompatible with php-font-lib. As a result there's no character info in the UFM after the font is parsed. I tried a different font, Open Sans Emoji, and the character info is generated but the emoji glyphs still do not render. I suspect the font table containing information for these characters/glyphs isn't currently supported by php-font-lib.

This will take some work to fully implement.

@Nyconing
Copy link

Nyconing commented Nov 5, 2020

Emoji like 💖 isnt rendered in pdf file 😫😥 Losing original content which is causing inconsistency representation on message like caligraphy product options.

@simonschaufi
Copy link

To clarify this for all users who request this feature: It's not as trivial as it sounds. The font needs to support emojis but as I already wrote before, I tried embedding the NotoColorEmoji font and it didn't work out of the box.

@bsweeney
Copy link
Member

Definitely something that would need to be added to php-font-lib. Doing a quick (and I mean an "oh here's an article that seems related to this topic) search and it looks like there is definitely work to be done on the php-font-lib side of things (ref). Recommend opening up an issue with that project so it's at least a known request there.

I'm not sure if there is additional work that would need to be done with Dompdf, so we'll keep this issue open.

@mohan-devs
Copy link

Is there font-lib in php which support emoji in dompdf rendering ?? anyone who implement can share the process or font-library.

@AndyGaskell
Copy link

This seems an ok short term workaround...
https://www.beaubus.com/blog/add_emoji_support_to_dompdf.html

@bsweeney
Copy link
Member

bsweeney commented Dec 6, 2024

Once dompdf/php-font-lib#140 is released we can review what additional changes may need to be made to Dompdf and/or CPDF to add support.

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

Successfully merging a pull request may close this issue.

7 participants