Displaying Arabic text

Hi
Totally new and my first ever question in the forum .

I tried to find a way to have arabic text appear when running my small example.
It does work, and the Arabic word is displayed when running the sketch.

But the thing is, when I am writing the sketch, the Arabic word appears in boxes inside text().

Would anyone Kindly advise if I am missing something ? .

PFont arabic ;
void setup() {
  size(400, 400);
  textAlign(CENTER, CENTER);
  background(0);
  arabic = createFont("Farisi-48",48);
  textFont(arabic);
  textSize(50);
  fill(255);
   //  apparently, the arabic word is displayed here, but not in my sketch, it appears as boxes.
 text(" اهلا", width/2, height/2);
}

1 Like

This means the font that the actual Processing IDE is using doesn’t support Arabic characters. Fortunately Processing lets you choose the font for the editor. Go to File > Preferences and then select a different font. You might have to try a few to get one that works. Courier New was the first one that worked for me.

preferences

3 Likes

But of course ! Yes ! it worked.

Many Thanks :slight_smile:

1 Like