Support Freetype+Harfbuzz
Will be needed to handle complex scripts that use combining diacritic marks.
@pureexe do RPG Maker 2000/2003 Thai-scripted games exist? (Apart of your translation). Because RPG Maker 2000 resolution is small, and Thai script for 6×12px width (half width) looks too small to display all diacritics, maybe is worth to break the half fixed width limitation of RPG_RT and use a variable width (or even 12×12px full width) in EasyRPG Player. However, if there exist games translated already, maybe they won't fit if they use too long lines (RPG Maker allows 50 half-width glyphs per line).
For now, We don't have any Thai scripted game created with RPG Maker 2000/2003 yet.
but 12x12 is enough for display thai character.
this is yanderella with nearly correct thai language display.

We use moded RM2000 font you can download it here.
https://www.dropbox.com/s/n6w75c3m0sv5c7n/rm2000.fon?dl=0
and run with this game file (this is test not full game so file just 4MB) http://www.mediafire.com/download/yz4yjzzeiqo9fdz/yanderella-thai-test.rar
Could you write this text normally here on github? So we can see how the correct rendering should look like.
กาลครั้งหนึ่งนานมาแล้ว มีหญิงสาวสวยนามว่า ซินเดอเรลล่า
Okay by measuring I would say that we need at least 22 pixel of height to fit everything with something above (รั้) and below (ญิ) beautifully. Needs some testing if freetype can somehow squash this in less.
I think the long term solution for this is to modify the whole rendering code of the Player to render with more pixels...
@pureexe how readable would you consider this?

It is just a font rendering test using a fixed width font (Arundina Sans Mono) using freetype+harfbuzz at 11 px height (with auto width), seems to fit exactly 6 px width as RPG_RT does, which is good.
@fdelapena wow! pretty good. it's 100% display correctly.
@fdelapena That's great! It seemed to display perfectly. Only that the fonts looked a bit blurry but that's not a big problem anyways.
Thank you for showing that to us!
We will looking forward to see RM2000/2003 to be able to support Thai perfectly.
@whateverzone I'm currently investigating ways to improve the rendering by using higher resolutions. This will result in great font rendering because doubling the resolution already gives 4 times the pixel. But the blurry font is a good start. When a better rendering is implemented it will "just work" without any ingame changes :)
@fdelapena I would be interested in a screenshot without AA :D
@Ghabry Wow! Thank you for telling me that! I hope your investigation goes well. We really want to see RM2000/2003's games with Thai version and also translation works such as Ib, Wadanohara etc.
Thank you very much for helping us ^^.
Here some real rendering tests in the engine. Without harfbuzz, so the diacritics are wrong:
Normal resolution (1x / 320x240)

HiRes (2x / 640x480):

@Ghabry Can you make diacritics display correctly?
@pureexe Not with the current codebase. But is of course possible to implement. The font rendering on the screenshot is already modified code, so this is the first step for fixing diacritics. Just wanted to show you a real version so you can check how readable 1x and 2x is. Do you consider 1x readable?
@Ghabry I confirmed 1x and 2x is readable font.
@whateverzone Do you think is it readable?
@pureexe Yes, I do.
Update for the Thai people. Working again on this, hope I can get some results soon ^^ (around November)
Thank you for working on this again.
Hello! It's been a while. I just wondered if you are still working on this or not.
Yes, I finally made some progress :D. Though this is still not complete because I also have to rework the messagebox code which renders char-by-char and this won't work with harfbuzz.

I think the 1bit-rendering looks better on that resolution:

Works now in message boxes. Due to tecnical reasons (need to split at most \-command codes) the rendering gets worse as I can't render in one go. To fix this I would need to analyze the right part of the bounding box and crop the empty rows :/
Well and some stuff just can't be simulated because Freetype moves some glyphs below others for esthetics.

Using a different "Hinter". Does this look better or worse?

About the configuration. I don't want to support font-config or any font substitution now because have no idea how to use this and not worth the afford by now imo.
I would propose a configuration in the RPG_RT.ini:
[EasyRPG]
Font=Arial;12;Mincho;11
Font2=Verdana;11
The font depends on which Font is selected for the system graphic. When one font is not defined it uses the normal built-in one.
Assuming the System graphic Font is the 1st this will look in the "Font" folder of the game for Arial.ttf and Mincho.ttf and render Arial glyphs with size 12 and when a glyph is missing in the font it renders a Mincho glyph with size 11.
As a "flow chart":
Missing Missing Missing
Arial 12pt -------> Mincho 11pt -------> built-in -------> <?>
Same for the command line: --font and --font2
WIP Harfbuzz branch: https://github.com/Ghabry/easyrpg-player/commits/harfbuzz
Wasn't that hard. Only lost two hours because I forgot to divide offset with 64 :facepalm: . Not very intuitive because normal Freetype doesn't need this divide for offset (bitmap) :roll_eyes:
Size calculation has some bugs and it doesn't work for the message box yet. The message box is hard to do because the text appears glyph by glyph and it has all this command processing etc.
Comparison (click to enlarge):
Left is w/o HB, Right is w/ HB
The Thai rendering of the stacked glyphs is correct now (trust me, I compared this with SDL_TTF and in Chrome ;))

Spot the difference ;) (look for ligatures and letters that are "moved under" other letters like e.g. in case of 'To')

Added (Experimental) shaping support for Window Message. Even works properly for color codes etc. :)

Sans Serif vs. Serif:
กาลครั้งหนึ่ง Alexกำลังเรียนภาษาไทย Unicodeเจ๋งมาก!

@pureexe better late than never I guess :thinking:
Looking good! Better late than never 😊