emacs-emojify icon indicating copy to clipboard operation
emacs-emojify copied to clipboard

Export emojis as inline images png or svg

Open felipelalli opened this issue 5 years ago • 8 comments

When you export the org file (like to a PDF or HTML, e.g.) the emojis are exported in pure text, not as an image.

felipelalli avatar Feb 18 '20 00:02 felipelalli

I'll give @iqbalansari the final word on this, but as far as I know this package doesn't offer any support for exporting things in org, markdown, latex, etc. It changes how certain sequences are displayed inside Emacs, but as far as export is concerned the sequences aren't really emoji.

ryanprior avatar Feb 20 '20 06:02 ryanprior

I know that. That's why I am making this feature request. Thank you!

felipelalli avatar Feb 21 '20 19:02 felipelalli

Thanks for the bug report @felipelalli, this sounds like a useful addition, though I am not sure if org-mode has enough hooks to do this cleanly, will give this a shot

iqbalansari avatar Mar 09 '20 03:03 iqbalansari

Everything is possible on Emacs, even if we need to send a PR to Emacs itself! :smiley: :+1: If something is missing on Emacs tell me and I can fix it to the next release.

felipelalli avatar Mar 09 '20 18:03 felipelalli

@iqbalansari maybe this: 12.17 Advanced configuration could help?

felipelalli avatar Mar 09 '20 18:03 felipelalli

Hello @felipelalli, I gave this a shot by replacing the emojis with inline images in the org-export-before-parsing-hook hook and it works but I realized that org mode does not allow controlling the size of the images exported as a result the exported image ends up larger than the surrounding text which looks really bad.

I think at this point the only option is to replace use unicode characters instead of images, that way fenced and ascii emojis will be exported as unicode characters and would be rendered properly in exports. Let me know your thoughts

iqbalansari avatar Apr 25 '20 13:04 iqbalansari

This could help https://stackoverflow.com/questions/36233605/how-to-customize-org-mode-html-output-to-replace-emojis

I have tried both answers but they don't work for me. Can someone else please try them?

LucaMarconato avatar Sep 21 '20 12:09 LucaMarconato

This could help https://stackoverflow.com/questions/36233605/how-to-customize-org-mode-html-output-to-replace-emojis

I have tried both answers but they don't work for me. Can someone else please try them?

This works.

(setq org-html-protect-char-alist 
      '(("&" . "&")
	("<" . "&lt;")
	(">" . "&gt;")
	(":turtle:" . "&#128034;")
	(":dash:" . "&#x1f4a8;")
	(":-)" . "&#x1f60a;")
	(":-(" . "&#x1f61e;")))

Garakhan avatar Oct 08 '22 11:10 Garakhan