Problem with using Hebrew characters

Hello
I am working on a project where I need to use Hebrew characters.
When I work in JAVA mode, any Hebrew text that I use in a text string is recognized as Hebrew text and is displayed correctly when I run the sketch.
With ANDROID mode, the complied sketch does not display the Hebrew characters correctly (I get garbisch text).
I also tried to use specific Hebrew fonts from Google without any success. Can anybody have any idea on how to solve this problem?
Thanks

I found an indirect solution to this problem.

I used the Unicode table, starting at hex 05D0.

I associated a Latin letter to each Hebrew letter, for example:

A for א

B for ב

H for ה

Then I built a Font table (called HebLetters in the sketch) which index is the integer value of the needed Latin character and the content is the Unicode value from the Unicode table in the Hebrew section.

I WANT TO ATTACH THIS TABLE TO THE POST. HOW DO I DO IT?

This is the code for displaying a Hebrew string (here “חודש תשרי”).

void setup() {
size(300,300);
background(0);
String S=“hODS TSRI”; //Latin representation of the Hebrew month of Tishrei
String HebString= LatinToHeb (S); // Translate Latin Letters to Hebrew
textSize(30); fill(0,250,0);
text(HebString, 50, 100); // Display Hebrew text
}

void draw() {
}

String LatinToHeb (String SToConvert) { // Function to convert Latin String to Hebrew String
char C = SToConvert.toCharArray(); // Convert String to char array
String ch=“”;
for (int i=0; i<C.length;i++) {
if (int(C[i]) ==32) { // If the character is a space use 32 as its value within the string
ch+=" “;
} else {
char chars = Character.toChars(HebLetters[int(C[i])-48]); //Extract Unicode value of the character from HebTable
ch +=new String(chars); // Append as next character
println(int(C[i])-48+” “+HebLetters[int(C[i])-48]);
}
}
println(”");
return ch; // Return the converted result (Hebrew String);
}

1 Like