admannon   10-26-2016, 09:15 PM
#8
เสร็จซะที (น่าจะประมาณ 95% ที่รองรับ ที่เหลือคือฟอนต์มันเป็นอย่างนั้นอยู่แล้ว)

ก่อนทำ
[Image: G1fce19.png]

หลังทำ
[Image: jJSGJ9j.png]

เปลี่ยน Font ด้วย
[Image: gPFr3zS.png]

ส่วนนี้ก็ Plugin เนอะ
Code:
//=============================================================================
// ThaiMessageBoxFix.js
//=============================================================================

/*:
* @plugindesc
* Fix font render that contain upper or/and lower glypts in message box.
* @author Admannon
*
* @help This plugin does not provide plugin commands.
*/

(function () {

   Window_Base.prototype.TH_VOVEL_MARK = "ุูึัี๊้็่๋ิฺื์ํ";

   var _WinBase_convertEscChar = Window_Base.prototype.convertEscapeCharacters;
   Window_Base.prototype.convertEscapeCharacters = function (text) {
       text = _WinBase_convertEscChar(text);
       text = text.replace(new RegExp("([" + this.TH_VOVEL_MARK + "])ำ", "g"), "ํ$1า");
       text = text.replace(/ำ/g, "ํา");
       return text;
   };

   var _Window_Base_processNormChar = Window_Base.prototype.processNormalCharacter;
   Window_Base.prototype.processNormalCharacter = function (textState) {
       var c = textState.text[textState.index++];
       var d = textState.text[textState.index];
       while (this.TH_VOVEL_MARK.contains(d)) {
           c += textState.text[textState.index++];
           d = textState.text[textState.index];
       }
       var w = this.textWidth(c);
       this.contents.drawText(c, textState.x, textState.y, w * 2, textState.height);
       textState.x += w;
   };

})();


ปล. แก้ ( c ) ที่บอร์ดนี้มันดันแก้เป็น ©

edited เพิ่ม by OP_Jum_RPG
ดาวน์โหลดเวอร์ชั่นแก้ไข (อันเดียวกับโพส 12)
https://gist.github.com/admannon/700168e...840f7473c4

/puke/puke/puke/puke/puke/puke/puke/puke/puke/puke/puke/puke/puke/puke/puke
This post was last modified: 11-17-2018, 02:39 PM by OP_Jum_RPG.
  
Users browsing this thread: 1 Guest(s)
Powered By MyBB, © 2002-2024 MyBB Group.
Made with by Curves UI.