Hello
Guys i have problems with display Persian(Farsi) strings.
There was an example in the github for Arabic fonts with unicode strings.
The first thing Arabic is different with Persian(Farsi) they haven’t at least 4 characters from Persian(Farsi) .
in that example, you guys have converted what you want to Arabic Presentation Forms-B Unicode with 3rd party apps.
this is not suitable and not possible for me to find out a working 3rd party converter that can convert the Persian text to correct unicode.
because (almost) each character in Persian have 4,5 style to show .
- if the charter was in binning of word .
- if the charter was in middle of word .
- if the charter was in end of word .
4…
they are have different look and will make word not separately.
i made a font for Persian text and applied it to text, but if i use plain text (not Arabic Presentation Forms-B Unicode) it shows separately
Font font = Font.getFont(82, 40, Font.STYLE_PLAIN); g.setFont(font); g.setColor(Colors.NAVY); String s = "سلام"; StringBuilder buf = new StringBuilder(); buf.append(s).reverse(); g.drawString(buf.toString(), width / 2, height / 2, GraphicsContext.HCENTER | GraphicsContext.VCENTER); y += font.getHeight() + PADDING_TEXT;
as you see i didnt convert the text because microej is doing it itself to normal unicode table.
but there is 2 problem.
- The text should be reverse because Persian(Farsi) is RTL . (that will be problem for thousands of characters)
- The text characters displaying desperately not get together as a word, it is because the micrej not detect models Persian characters.
for make this working i need to read the source code of MicroUI and other related things then change it to solve this problem , or what you guys will tell me to solve this problem
the last things is also i cant convert the string to unicode in microEJ java the out put is not unicode anymore, and also is normal unicode not the Arabic Presentation Forms-B Unicode,it is plain text because of limitation.
private static String toUnicode(char ch) { String s = new String("\\u0" + Integer.toHexString(ch)); return s; }
Thanks
Armin.