How can I display a character above U+FFFF? Say I want to show U+1F384. "\u1F384"
is interpreted as "\u1F38"
followed by the character "4"
, and gives the error No glyph found for the ? (\u1F38) character
. "\uD83C\uDF84"
is interpreted as the character "\uD83C"
followed by the character "\uDF84"
, and gives the error
No glyph found for the ? (\uD83C) character
No glyph found for the ? (\uDF84) character
Here is some example code to demonstrate:
PFont font;
void setup()
{
size(128, 128);
background(0);
font = loadFont("Symbola-8.vlw");
textFont(font, 8);
fill(255);
text("\u1F384", 10, 10);
}
void draw()
{
}
As stated by the tag, this is in the language Processing.
\U0001F384
gives the error unexpected char: 'U'
, presumably because processing doesn't support UTF-32 in that format.
It doesn't really matter how it is displayed, the main problem is making a string contain a character whose decimal codepoint is greater than 65,535.
The following code works as expected on my operating system (macos):
import java.lang.Character.*;
void setup() {
size(300, 300);
background(209);
textFont(createFont("Wingdings", 96));
int value = 0x1F384;
String s = Character.toString(value);
text(s,100,120);
}