I'm developing a java project with eclipse v2021-3, with the software processing v3.5.4, and I want to put unicode characters as a text on my screen.
I can do that and have positive results with no problem, just by doing this:
@Override
public void mousePressed(PApplet p) {
p.text("\u2196", 10, 10); // "\u2196" code for arrow top-left
}
But whenever I try to change the textSize:
p.textSize(10);
It turns all the unicode characters into squares, despite the size I choose.
https://prnt.sc/12pykgs -> this is a screenshot of before and after I scale the text.
In my work colleague is also working with eclipse and processing in her computer and she can do this without any problems, and I've looked for help on the forums and I haven't found anything.
Thank you in advance if you can help me with this problem! :)
Likely not a Java programming problem, nor a problem with Eclipse. Likely a problem related to font problems on your particular computer.
See similar code run live on IdeOne.com.
String input = "\u2196" ;
System.out.println( input ) ;
↖
Code point U+2196 in hex (8,598 decimal) is NORTH WEST ARROW
.
You should be seeing this character if your display app is running on a computer offering a font with a defined glyph. If none of the available fonts has such a glyph, you will get a fall-back glyph such as empty box.