Right-to-left writing for OPL –
01-28-2012,02:01 PM
Is someone still interested for this ?
I now have some basic code to test.
It was a real pain to code this, because we use UTF-8 encoding, thus it requires to read the "strings" from left-to-right, no matter how we will render them later (in utf-8 you have more that one byte to encode one character, and the decoding needs to start from the first one, which is on the left). The problem is when you have to write right-to-left which would require to start reading the "strings" from the right, and then advance to the left ...
Anyway it is now solved, so if anyone want to test it, speak here !
I join the arabic language file made by fawzisaeed long ago, that I fixed (I mean, removed useless spaces from beginning and end). It need to be corrected and completed (we have more strings now).
For example, line 50:
بدايةخدمة HDL
Which is for "Start HDL Server", I don't think that the word "HDL" should be at the end of the sentence, probably it should be at the "beginning" as in RTL it goes then at the end ... As I don't read arabic I can't be sure anyway ...
For the moment the rendering should be fine, but it still requires a shift/transposition to have the text starting from the right of the screen. But that requires also some code changes for the drawing of pictures, so I first want a feedback before starting to finalize the code.
Also I need to implement wrapping/cliping for RTL text, which is disabled for now.
EDIT: It seems that it is not only applicable for arabic, but also for many other language:
Right-To-Left Script Languages
(Note many languages are also written in other scripts, which may be left-to-right.)
i hope to trans to arabic language
but some word examole hdl cant any tarans
atry to use that file and answer to another time
thanks
يدا بيد للتعريب من قبل الجميع
thanks mr hominem.te.esse that file(beta) is good but there are some broblem
the letter appear seprated for example
ا ع د ا دات ا ل ب ر ن ا م ج
والصحيح: اعدادات البرنامج
example english:
close program
appera: c l o s e p r o g r a m
and there are second prblem
the word in arabic language appare oppesit for example
البرنامج اعدادات
والصحيح اعدادات البرنامج
example for english
apparerogram close
close program
anderstand me
i want to learn mean for this apreviation for trans to arabic language ( english to english)
ID
HDL
PSS
IGR
cdvdfsv
VMC
THANKS FOR YOU
MR I TRY TO CONVERT TXT TO (UTF-8--UNICODE---UNICODE BIG---ANSI)
BUT UTF-8 ONLY RIGHT AND ANOTHER DONT WORK
THANKS
It's hard to understand you fawzisaeed but it's ok you're doing your best.
Try this new version, it will correct the problem concerning the misplaced words. This was due to space and other punctuation characters being used in Left-to-right and right-to-left scripting. theses characters needed to be treated as "neutral" glyph, and do not change the direction of rendering.
But about the space between character, this doesn't seems to be a bug. I can't reproduce it, and it should not happen. At least not for the english (latin) strings, for which there is nothing changed technically in rendering mechanism.
So I guess you didn't used my special font, joined within the archive attachment. Please be sure to use it, and try again.
Make a screencap (or picture) if the problem persist.
NOTE: This is a beta version of OPL, with Right-to-Left scripting compiled by default ! So don't use it for another purpose
Last edited by hominem.te.esse; 02-04-2012 at 05:12 AM.
i am very sory mr hominem.te.esse but iam poor in english werting
that file is good but there are one problem seprated chatacter
ا ع د ا د ا ت
اعدادات
plz upload to me font support for ps2
i use this fonts in my computer and ok no any seprater but when i put to sp2 that seprater is i try to rewerite transef again and compleat 12 line but thate has some appreviation not any transef do you help me that appreviation is
vmc:meaning virtual memory card
ID:
HDL:
PSS:
syscalls:
IGR"
cdvdfsv:
and there are some word not found in file english https://bitbucket.org/ifcaro/open-ps...ng_English.lng
v-sync
ps2smb
mode1+2+3+4+5+6
where ifound it?
help me plz to complate arabic languge file and upload to yuo again
thanks
Did you tried the font (font_arabic.fnt) present into the OPL_TRL2.zip attachment above ?
With this one there should not be any "extra" space between character.
Please someone else double check this too.
You can also put your own font here in attachment, and I'll have a look at it. Mine don't use "kerning", if yours have some, I'm interested to have it.
Note: You DON'T have to translate the specific "english" acronym (or to techy words) like: VMC, ID, HDL, PSS, syscalls, IGR. And it is the same for the other you mentioned, which are even not present in the language files (no internationalization support at all for those): cdvdfsv, vsync, ps2smb, mode1+2+3+4+5+6, ...
Now concerning other language, is there no-one willing to add a translation of OPL for Hebrew, Syriac, Dhivehi, Maldivian, Urdu, Assyrian, Mandekan, ... ?? It's only about translating a few sentence. I'll provide the corresponding font (I have already the hebrew one ready).
1--yes i tried font in that file but not support i put font below plz put this(after change name to font_Arabic.ttf) i used in my computer good but when put in sp2 that is problem
2--i but below to you image for this problem in arabic language you must connected most letter in the word not separated letter in all word
3--- i transelated all word and complementd 12 line in the file blow but after that this file cant mack good when put in ps2 plz help me quick the file is below
thanks
Last edited by fawzisaeed; 02-01-2012 at 07:14 AM.
The problem is not "spaces" between characters, but the characters themselves that are not correct.
To be precise, the problem is about the rendering of arabic itself, which is far more complex than expected, and harder than other common language. This is because in arabic language, each glyph have 4 different rendering, depending of it's position in the word: in front, in middle, at the end or as a single character. Depending of this position, the current glyph is changed by another. This process is called "glyph substitution" and it is not handled by the freetype library.
Have a look at the faq of freetype (the library we use to render font):
FreeType 2 doesn't try to perform a number of sophisticated things, because it focuses on being an excellent font service.
This means that the following features are not supported directly by the library:
text layout The library doesn't support text layout operations. Sophisticated features like glyph substitution, positioning (kerning), justification, bi-directional ordering, etc.m are not part of a font service in itself. They must be handled one level higher."
So, consider the work be finished for this feature, as nothing more can be done easily. The game is over.
I put here your lang_Arabic.lng that I corrected (you had an invalid character just before the "#" character of the first line, thus preventing it to be treated as a comment)