Forum Bugs

Twemoji only works for certain emojis

jweberLUD
A client is trying to use emojis in their PDFs, but a previously suggested script is no longer available.

They switched to trying to use Twemoji to turn their emojis into images. It appears to work, but only the phone emoji in the example is actually rendered through prince (12) while the rest appear as question marks.

Does anything stand out to you guys?
  1. Example_Article_ (1).html38.4 kB
mikeday
I think this is due to the way Prince is a little inconsistent with JavaScript's broken treatment of Unicode characters outside the basic multilingual plane, which this script depends on. (The phone symbol is U+260E, whereas all the emoji it is failing to find are up in the U+1Fxxx range).

We will investigate this issue.
mikeday
Yes we will need to change Prince to conform to the way browser JavaScript engines handle UTF-16 for this script to work. Hopefully we can address that this year, along with support for emoji fonts which might make this script unnecessary!