drawtext & drawtextEx

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
hello i make research to find way to supporting Arabic language in Windows_msssage, And during the search is what caught my attention.

in rpg_windows.js i found this code

Window_Base.prototype.drawTextEx = function(text, x, y) { if (text) { var textState = { index: 0, x: x, y: y, left: x }; textState.text = this.convertEscapeCharacters(text); textState.height = this.calcTextHeight(textState, false); this.resetFontSettings(); while (textState.index < textState.text.length) { this.processCharacter(textState); } return textState.x - x; } else { return 0; }};Before i dont change anyghing Arabic letters appear correctly and interrelated only in the splash screen.


Window_Base.prototype.drawText = function(text, x, y) { if (text) { var textState = { index: 0, x: x, y: y, left: x }; textState.text = this.convertEscapeCharacters(text); textState.height = this.calcTextHeight(textState, false); this.resetFontSettings(); while (textState.index < textState.text.length) { this.processCharacter(textState); } return textState.x - x; } else { return 0; }};But, after i change code such drawTextEx to drawText, Arabic letters appear unrelated and reversed.


note:Writing in Arabic only supported on the splash screen

1. The question here is, what is the difference between drawtextEx and drawtext ??

2. why after i change drawtextEx to drawtext, Arabic letters appear incorrectly and is not connected to and reversed [img 2] !!??

3. Can writing code that depends on drawtextEx in Windows_msssage , Even connected to the Arabic letters appear correctly?

need help.

more info about Arabic language here

http://forums.rpgmakerweb.com/index.php?/topic/50277-arabic-supporting/
 
Last edited by a moderator:

Victor Sant

Veteran
Veteran
Joined
Mar 17, 2012
Messages
1,694
Reaction score
1,452
First Language
Portuguese
Primarily Uses
  1. drawTextEx pass through each character and draws them individually in the order they are on the editor. (it does as it to allow the use of the escape codes, such as \c[x] to change text color)
    drawText draws the text as a whole, working with languages that goes from right to left.
  2. look at 1.
  3. I kinda doubt that you could do that, even if you can reverse the drawTextEx but they will be still unrelated. You can try to adapt the drawText to wherever drawTextEx is used, but you would lose all the possible codes that edit text.
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
drawText works with alignment, because it is directly passed to the underlying canvas element. drawTextEx always starts at the left, prints a single character and moves its internal x position by the width of this character, which means it will never draw interrelated characters.
 

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
in fact. I actually do not have any programming experience, But I want to know if this problem was possible to fix it or not?


I can pay $ for solving this problem.. Anyone interested can send me a PM...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Can I get you to do a few things for me?


I'd like you to please create a new project, go to the Terms tab in the database, and translate a heap of terms to Arabic.


Then on the map, add a Show Text, Show Choices, and Name Input Processing command, all in Arabic.


Once that's done, please zip up the Data folder from the new project and send it to me. Let me know if I need to install a special font.


Out of interest, does anyone know what other languages are written right to left?
 

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
Can I get you to do a few things for me?

I'd like you to please create a new project, go to the Terms tab in the database, and translate a heap of terms to Arabic.

Then on the map, add a Show Text, Show Choices, and Name Input Processing command, all in Arabic.

Once that's done, please zip up the Data folder from the new project and send it to me. Let me know if I need to install a special font.

Out of interest, does anyone know what other languages are written right to left?
Sure i will do any thing just to fix this issues.

here all info you need about Arabic as you ask.

https://www.mediafire.com/?np94n8a82n495pd

this demo included:

- Readme.txt

- info about Arabic letters and Arabic language

- See me (Folder)

- Arabic alphabet .txt inside (See me Folder) to put it in (rpg_windows.js)

- Photos from some places of the Arabic language problems (Inside See me Folder)

- Tahoma Font (maybe you need it but i don't use it coz mv by default show Arabic)

hope this demo to help and understand how arabic words work.

there many languages read from right to left such

Arabic

Persian

Hebrew

source:

http://www.i18nguy.com/temp/rtl.html

https://en.wikipedia.org/wiki/Right-to-left

Edit

Arabic Window_NameInput Update v1.0

Code:
//Arabic have 28 letters.//Arabic is written from right to left.//Arabic letters to be related to be Useful word,//Example:العربية = Arabic , مرحبا = Hello , انا احبك = I love you.Window_NameInput.Arabic =        [ 'ا','ب','ت','ث','ج',  'و','ي','ﺀ','آ','أ',          'ح','خ','د','ذ','ر',  'لا','لآ','ة','لأ','ّ',          'ز','س','ش','ص','ض',  'َ','ً','ُ','ٌ','ِ',          'ط','ظ','ع','غ','ف',  'ٍ','ْ','ـ','ئ','ؤ',          'ق','ك','ل','م','ن',  ',','الله','لله','','',          'ه','[',']','^','_',  '','{','}','|','~',          '0','1','2','3','4',  '!','#','$','%','&',          '5','6','7','8','9',  '(',')','*','+','-',          '/','=','@','<','>',  ':',';',' ','صفحة','تم' ];
or http://pastebin.com/WRXVR4jM
 
Last edited by a moderator:

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
OMG, i fix items , skills, Equip, description in Arabic !!

i will Continue research!!

but right now i don't find how to fix Window_Message?



Edit: Excuse me, I forgot to explain the way ^^

1. go to rpg_windows

2. find this code

Window_Help.prototype.refresh = function() { this.contents.clear(); this.drawTextEx(this._text, this.textPadding(), 0);};change it to
Code:
Window_Help.prototype.refresh = function() {    this.contents.clear();    this.drawText(this._text, this.textPadding(), 0);};
then save it this will fix items , skills, Equip, description in Arabic.But I do not know that this matter will cause problems in the future or not
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Window_Message displays its text one character at a time, and adds a space between characters manually. You would be looking for a way to make it show a word at a time, or the whole message at once. But it still needs to handle the escape codes and drawing icons.


Nice going!
 

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
to make Window_Message displays its text one, is hard with my level in programming :( ,


I believe that there is a solution to this problem. For this reason, i put subject here ,to asking help.
 
Last edited by a moderator:

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
  • drawTextEx pass through each character and draws them individually in the order they are on the editor. (it does as it to allow the use of the escape codes, such as \c[x] to change text color)
    drawText draws the text as a whole, working with languages that goes from right to left.

  • look at 1.

  • I kinda doubt that you could do that, even if you can reverse the drawTextEx but they will be still unrelated. You can try to adapt the drawText to wherever drawTextEx is used, but you would lose all the possible codes that edit text.
you are right Victor,I lost ability like escape codes, such as \c[x] to change text color.


Do you think that there is a solution to this problem?

Window_Message displays its text one character at a time, and adds a space between characters manually. You would be looking for a way to make it show a word at a time, or the whole message at once. But it still needs to handle the escape codes and drawing icons.


Nice going!
I wish to fix this problem, by MV development team or any person who has the ability to do this.


This will open the door to develop games for many languages such as Arabic,Persian etc languages.
 

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
how to fix ScrollText in Arabic

first find code

Window_ScrollText.prototype.refresh = function() { var textState = { index: 0 }; textState.text = this.convertEscapeCharacters(this._text); this.resetFontSettings(); this._allTextHeight = this.calcTextHeight(textState, true); this.createContents(); this.origin.y = -this.height; this.drawTextEx(this._text, this.textPadding(), 1);};change it to
Code:
Window_ScrollText.prototype.refresh = function() {    var textState = { index: 0 };    textState.text = this.convertEscapeCharacters(this._text);    this.resetFontSettings();    this._allTextHeight = this.calcTextHeight(textState, true);    this.createContents();    this.origin.y = -this.height;    this.drawText(this._text, this.textPadding(), 0);};
before change


after change you see arabic is fix ^^



note: this change you lost ability like escape codes, such as \c[x] to change text color.

Arab user is still suffering in Rpg maker mv :(

Edit: the magic is by this code this.drawText(this._text, this.textPadding(), 0); anyone can Is it possible to explain how one use this code in all the texts of the engine ؟؟
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
You could do this:

Code:
Window_Base.prototype.drawTextEx = function(text, x, y) {    this.drawText(text, x, y, Graphics.boxWidth, "left");};
Note, that this will completely disable all escape characters like \c[...] or \v[...] throughout the whole game and might break a lot of plugins.
 

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
You could do this:

Window_Base.prototype.drawTextEx = function(text, x, y) { this.drawText(text, x, y, Graphics.boxWidth, "left");};Note, that this will completely disable all escape characters like \c[...] or \v[...] throughout the whole game and might break a lot of plugins.
amazing sir Iavra, you fix items , skills, Equip, Save, profile description and ScrollText, battlelog text in Arabic just in one code i put it as plugin!!

and working like charm!! , I really appreciate your help, thanks.

but how about Window_Message is there any code can fix arabic ?

Our problem is still.

 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
Window_Message would need special treatment, since it also offers the option to have short wait times between printing characters, so it doesn't call drawTextEx directly, but its subfunctions. You'll need to at least modfy the "startMessage" and "updateMessage" functions, probably more.
 

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
I give up...
 

dhofari9

Villager
Member
Joined
Mar 7, 2014
Messages
16
Reaction score
1
First Language
arabic
not give up please .. i am also searching for it


i just have the same problem you have here ..


so i need to pop up the topic
 

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
not give up please .. i am also searching for it


i just have the same problem you have here ..


so i need to pop up the topic
i give up coz, there no way to fix this problem in mv only can do it is the rpg maker mv company or we will got a lot problems by another plugins.


And this is not new, all the company's Products do not support Arabic language properly.
 
Last edited by a moderator:

q8fft3

Veteran
Veteran
Joined
Aug 17, 2014
Messages
82
Reaction score
7
First Language
arabic
Primarily Uses
@biud436 ... we Finally made it ;)  by sir @biud436 , he code plugin to fixed Arabic language in Message System, hope all arab users give him full supporting..


you can find Arabic plugin here


http://biud436.tistory.com/62










Message to Arabic speakers:


اتمنى من مستخدمي الإضافة ان يقدم الدعم الكافي لصانع السكربت سواء التعليقات في موقعه او الدعم المادي و المعنوي له وايضاً تحصلونه  موجود في موقعه هنا


http://biud436.tistory.com


وايضاً عنده قناة على اليوتيوب ، هذا الشخص ما قصر حقيقة في كتابة السكربت..


واذا احد يبي شرح عن السكربت باللغة العربية يخبرني راح اسوي شرح هنا في المنتدى اذا حاب.


والتوفيق للجميع...
 
Last edited by a moderator:

mrcopra

Veteran
Veteran
Joined
Jul 21, 2015
Messages
452
Reaction score
158
First Language
Not English
Primarily Uses
N/A

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,855
Messages
1,017,012
Members
137,563
Latest member
MinyakaAeon
Top