We are about to switch to a new forum software. Until then we have removed the registration on this forum.
So this has been driving me nuts all day. I was using OpenSansEmoji.ttf in a project and the emojis weren't showing up. Fast forward 6 hours later... I couldn't figure out why it was working in another test project until I saw that my main project needs the P3D in order to be able to use Syphon. My test project was not using the P3D renderer and it works there.
So now that I figured out why it wouldn't work, does anyone have any ideas on how to use this font AND Syphon? Or why this font won't render the emojis in P3D?
Answers
I don't have the "OpenSansEmoji.ttf" font on either my Mac or my Windows machines. I went looking for it and found something with the same name here (https://github.com/MorbZ/OpenSansEmoji/blob/master/OpenSansEmoji.ttf).
The font itself appears to be small and only has the alphabet (upper and lower case) and the digits 0 to 9.
Are you trying to access characters/glyphs in the font that it does not have?
EDIT: My mistake I looked in the wrong section :\"> ... it does have a lot of characters.
They definitely do exist as they work in a 2D project.
Can you please provide an example sketch that shows the problem?
Sure.
`String str ="::: astronaut
Ugh. Looks like I can't post the Unicode string here so... unfortunately I'd have to use a screenshot.
Only difference: size(400, 400); vs size(400, 400, P3D);
If you really need renderer P3D (or P2D) for your sketch, a workaround is to createGraphics() w/ renderer JAVA2D, and use text() & textFont() there. *-:)
So something like this (the chevron encapsulated text is the only way to get the rest of the code to appear ;) ):
Now why didn't I think of that...? :)) Thanks guys! That did the trick!
Just an addendum, it bothered me that it was challenging to represent unicode characters in code (and on this forum).
This is especially true when you want to represent supplementary characters, e.g. U+10000 to U+10FFFF. You can not simple type
\u10FFFF
(or\U10FFFF
as you can in Java).I finally found an answer in an old Sun Microsystems article, titled "Supplementary Characters in the Java Platform" by Norbert Lindenberg and Masayoshi Okutsu (circa May 2004), see: oracle.com/us/technologies/java/supplementary-142654.html
The revised example sketch looks like this: