Well I had a different problem, the "create font" menu actually works well when you check the "all characters", and of course, choose a font where arabic letters are implemented. But if you get to type something in Arabic in PED, it's saved in the isolated form (not connected), moreover, it's displayed in the default left-to-right order, so I developed a generic static method to fix these 2 issues and thought I'd share it here:
Code:
// in some .java file
class someClass
{
public static String fixArabicUnicode(String s)
{
final int[] keys = {
0x627 // aa
,0x628 // b
,0x629 // t>
,0x62a // t
,0x62b // th
,0x62c // g
,0x62d // H
,0x62e // kh
,0x62f // d
,0x630 // dh
,0x631 // r
,0x632 // z
,0x633 // s
,0x634 // sh
,0x635 // S
,0x636 // D
,0x637 // T
,0x638 // Z
,0x639 // 3
,0x63a // G
,0x641 // f
,0x642 // q
,0x643 // k
,0x644 // l
,0x645 // m
,0x646 // n
,0x647 // h
,0x648 // w
,0x649 // E
,0x64a // ee
};
final int[] values = { // quadraples := <isolated, final, initial, medial>
0xFE8D, 0XFE8E, -1, -1 // aa
,0xFE8F, 0xFE90, 0xFE91, 0xFE92 // b
,0xFE93, 0xFE94, -1, -1 // t>
,0xFE95, 0xFE96, 0xFE97, 0xFE98 // t
,0xFE99, 0xFE9A, 0xFE9B, 0xFE9C // th
,0xFE9D, 0xFE9E, 0xFE9F, 0xFEA0 // g
,0xFEA1, 0xFEA2, 0xFEA3, 0xFEA4 // H
,0xFEA5, 0xFEA6, 0xFEA7, 0xFEA8 // kh
,0xFEA9, 0XFEAA, -1, -1 // d
,0XFEAB, 0XFEAC, -1, -1 // dh
,0XFEAD, 0XFEAE, -1, -1 // r
,0XFEAF, 0XFEB0, -1, -1 // z
,0XFEB1, 0XFEB2, 0XFEB3, 0XFEB4 // s
,0XFEB5, 0XFEB6, 0XFEB7, 0XFEB8 // sh
,0XFEB9, 0XFEBA, 0XFEBB, 0XFEBC // S
,0XFEBD, 0XFEBE, 0XFEBF, 0XFEC0 // D
,0XFEC1, 0XFEC2, 0XFEC3, 0XFEC4 // T
,0XFEC5, 0XFEC6, 0XFEC7, 0XFEC8 // Z
,0XFEC9, 0XFECA, 0XFECB, 0XFECC // 3
,0XFECD, 0XFECE, 0XFECF, 0XFED0 // G
,0XFED1, 0XFED2, 0XFED3, 0XFED4 // f
,0XFED5, 0XFED6, 0XFED7, 0XFED8 // q
,0XFED9, 0XFEDA, 0XFEDB, 0XFEDC // k
,0XFEDD, 0XFEDE, 0XFEDF, 0XFEE0 // l
,0XFEE1, 0XFEE2, 0XFEE3, 0XFEE4 // m
,0XFEE5, 0XFEE6, 0XFEE7, 0XFEE8 // n
,0XFEE9, 0XFEEA, 0XFEEB, 0XFEEC // h
,0XFEED, 0XFEEE, -1, -1 // w
,0XFEEF, 0XFEF0, -1, -1 // E
,0XFEF1, 0XFEF2, 0XFEF3, 0XFEF4 // ee
};
final String spaces = " \t\r\n\f";
try
{
int[] ret = new int[s.length()] ;
int i, idx, I;
boolean sow, eow, efsel=false; // start of word, end of word, last char char separated the line
for(i=0; i<s.length(); i++)
{
//System.out.println ("char " + Integer.toString(s.codePointAt(i), 16) );
sow = ( i==0 || spaces.indexOf(s.charAt(i-1)) >=0 );
eow = ( i== s.length()-1 || spaces.indexOf(s.charAt(i+1)) >=0 ) ;
I = ret.length - i - 1;
idx = Arrays.binarySearch(keys, s.codePointAt(i));
//if (efsel) System.out.println("efsel is active with letter " + s.codePointAt(i));
if ( idx < 0 )
{
ret[I] = s.codePointAt(i);
efsel = true;
//ret[I] = 'n';
} else
{
if (sow && eow) // isolated
{
idx = idx*4;
ret[I] = values[idx];
efsel = false;
//ret[I] = 'i';
}
else if (eow) // final
{
idx = efsel? idx*4: idx*4+1;
ret[I] = (values[idx]);
efsel = false;
}
else if (sow || efsel) // initial
{
//if (efsel) System.out.println("efsel is active with letter " + Integer.toString(s.codePointAt(i), 16));
boolean oldefsel = efsel;
idx = idx*4+2;
if (values[idx] < 0)
{
// identical to isolated
ret[I] = (values[idx-2]);
efsel = true;
}
else
{
ret[I] = (values[idx]);
efsel = false;
}
//if (oldefsel) ret[I] = '>';
}
else // medial
{
idx = idx*4+3;
if (values[idx] < 0)
{
// identical to final
ret[I] = (values[idx-2]);
efsel = true;
}
else
{
ret[I] = (values[idx]);
efsel = false;
}
//if (efsel) ret[I] = '<';
}
}
}
return new String(ret, 0, ret.length);
} catch (Exception e)
{
return s;
}
}
}
// somewhere in your sketch
text(someClass.fixArabicUnicode("<arabic text>"), 0, 0 );
have fun!