This test program shows two issues:
1) The OpenSansEmoji font does not render any glyphs at all.
2) The emoji character U+1F60A (smiling face in iOS) is apparently rendered as two glyphs, making it unlikely that it would render correctly, even if the OpenSansEmoji font was visible.
I'm going to guess that there are assumptions in the TCPDF TrueType parsing code , and maybe even the Unicode string handling code more generally, that cause it to only consider glyphs in the "basic multilingual plane" BMP) of a Unicode encoded font -- i.e. \u0000 to \uFFFF -- the first 64K codepoints. The emoji you are trying to use are in the "supplemental multilingual plane" (SMP) that requires codepoints larger than \uFFFF. I'm guessing that you see "two glyphs" because the codepoint is being handled as two codepoints, not one.
Hopefully my hunch will be enough that you can poke at the code and find the problem(s).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to use https://github.com/MorbZ/OpenSansEmoji for rendering emoji that can easily be input on an iPad.
This test program shows two issues:
1) The OpenSansEmoji font does not render any glyphs at all.
2) The emoji character U+1F60A (smiling face in iOS) is apparently rendered as two glyphs, making it unlikely that it would render correctly, even if the OpenSansEmoji font was visible.
What am I doing wrong?
Tested on tcpdf_6_0_099.
I'm going to guess that there are assumptions in the TCPDF TrueType parsing code , and maybe even the Unicode string handling code more generally, that cause it to only consider glyphs in the "basic multilingual plane" BMP) of a Unicode encoded font -- i.e. \u0000 to \uFFFF -- the first 64K codepoints. The emoji you are trying to use are in the "supplemental multilingual plane" (SMP) that requires codepoints larger than \uFFFF. I'm guessing that you see "two glyphs" because the codepoint is being handled as two codepoints, not one.
Hopefully my hunch will be enough that you can poke at the code and find the problem(s).