We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have searched on this forum about emoji and found only a few topics about it. People usually refer to this post but I, somehow, cannot make it work! Here is my code: Also,*I have the font inside the data folder already.
`PFont myFont;
String emoji = new String(Character.toChars(unhex("1F601")));
void setup(){
size(200,100);
//String[] fontList = PFont.list();
//println(fontList);
myFont = createFont("Apple Color Emoji", 24);
textFont(myFont);
//s="0x1f602";
}
void draw(){
background(0);
fill(255);
text(new String(Character.toChars(0x1F601)), 30, 30); // didn't work!
text("\u1F601", width/2, height/2);// didn't work!
text(emoji, width/2, height/2);// didn't work!
text(new String(Character.toChars(0x201D2)), width/2, height/2);// didn't work!
}
`
I try several ways as you can see on text() but all of them gave me the rectangle icon.
Answers
here is how I treat unicode
Hi, Thank you for replying. Yes, it came out as unicode. I wonder if you know how to display emoji then. I am still stuck on that point.
Is this how it suppose to come out?
the first longer program shows sign ~ and then the arrow
I don't have the font "Apple Color Emoji"- do you have it? Does it work in Word?
in processing: in menu Tools there is a command Create Font
maybe you need to use this
@Chrisir Yes I have it and it does work in every program but Processing. I did not have it in my Font book at first although I can type by selecting (option+Shift+Spacebar) in Mac. I could not find it anywhere in the actual finder so I download it (weird?). The file called Apple Color Emoji.ttc. I have installed it and now it is .ttf. I have tried put it in 'data' folder too.
Your suggestion to create this font make it to .vlw, still doesn't work.
Did you try this using the vlw file:
and then my code?
Do you mean if I should try that font? "LetterGothicStd-32.vlw ? No, I have not. but I did try other type of font.
Someone just gave me the font called "OpenSansEmoji.ttf". and it can read the emoji in black and white instead of color. So it solved 1 level of problem; left only another one. Use this with "emoji-java-4.0.0.jar" and "java-jason.jar" by throw them into the IDE, it will create the "code" folder. In the code do call the lib.
Anyway, thing is I receive twitter API so I can display the emoji in B/W but in the console of processing it doesn't display what is the number so I cannot compare with the .cvs file to generate something else. However, in Eclipse which is a JAVA software the text can be display in the console in emoji pic. LOL. funny enough I still do not know what is the code anyway but I got the pic in Eclipse's console.
I have not had time left to work on this but, might be back to figure it out how to get number code from Twitter API so I can use this for something creative.
Thank you so much for your help! I appreciate that you want to solve this problem with me :D
strange...