AyamiKaze / YU-RIS-PATCH

TO CHANGE FONT
GNU General Public License v3.0
0 stars 1 forks source link

russian characters ? #1

Closed imKota closed 4 years ago

imKota commented 4 years ago

Hello, @MZSHproject Could you add support for Russian characters?

AyamiKaze commented 4 years ago

Hello, @MZSHproject Could you add support for Russian characters?

For Russian, change lfCharSet and lfFaceName in CreateFontIndirectA to Russian, and change characters check table in exe. To find characters check table, you can find it in TextOutA.

AyamiKaze commented 4 years ago

@MZSHproject Could you tell us more about the "characters check table"?

In exe. you can find a table like this:

0019b540h: 00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b550h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b560h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
0019b570h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
0019b580h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
0019b590h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................
0019b5a0h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b5b0h: 01 01 01 01 01 01 01 01 01 01 01 01 01 00 00 00 ; ................

This is characters check table.
We can see it like this:
19b541-19b55F: 0x81-0x9F
19b5a0-19b5bc: 0xE0-0xFC
This is range od SJIS characters. You should change it to Russian.
eg: In Chinese, it will be changed like this:

0019b540h: 00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b550h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b560h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b570h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b580h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b590h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b5a0h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................
0019b5b0h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 00 ; ................

AyamiKaze commented 4 years ago

@MZSHproject can you help? please T_T So what's the problem now? By away, pls tell me what's game's name because different game maybe use different types. Likes Whirlpool. after 2016, their scripts are not ybn file. About char table, if you will use double-char, you may change it. If you want to know more about char table, I think debuging by yourself is the best way.

AyamiKaze commented 4 years ago

@MZSHproject can you help? please T_T

dllmain.zip If you have no idea, This code maybe help you. Try to map the chars. About map: https://github.com/jszhtian/Fragment/tree/master/ToHeart2_ScriptEngine

AyamiKaze commented 4 years ago

@MZSHproject in japanese version image

with

dllmain.zip

`uint16_t SjisUnicodeTable[65536]; void init_fnt_table() { auto fs = fopen("CHS.TBL", "rb");//MAP TABLE. MADE BY YOURSELF if (!fs) { MessageBox(0, L"Can't Find AymTextOut Suppost List File.", L"Aym", 0); return; } fread(SjisUnicodeTable, 1, 65536 * 2, fs); fclose(fs); }

PVOID g_pOldTextOutA = NULL; typedef int(WINAPI PfuncTextOutA)(HDC hdc, int x, int y, LPCSTR lpString, int c); int WINAPI NewTextOutA(HDC hdc, int x, int y, LPCSTR lpString, int c) { unsigned short uChar = 0; memcpy((unsigned char)&uChar + 1, lpString, 1); memcpy((unsigned char)&uChar, lpString + 1, 1); if (uChar >= 0x81 && uChar <= 0x9F || uChar >= 0xE0 && uChar <= 0xFC); { uChar = SjisUnicodeTable[uChar]; unsigned char p = 0; memcpy(&p, (unsigned char)&uChar + 1, 1); memcpy((unsigned char)&uChar + 1, (unsigned char)&uChar, 1); memcpy((unsigned char*)&uChar, &p, 1); //return TextOutW(hdc, x, y, (LPWSTR)uChar, c); } return ((PfuncTextOutA)g_pOldTextOutA)(hdc, x, y, (LPCSTR)&uChar, c); }` For Whirlpool, Because the SJIS encoding, you can't change the codepage of text. I think you can map chars to SJIS. It can be displayed. This is an example in Chinese: SU~DG3({G4ZH2$01 CFPM(Y

AyamiKaze commented 4 years ago

@MZSHproject hello!

auto fs = fopen("CHS.TBL", "rb");//MAP TABLE. MADE BY YOURSELF

This is exactly the problem. I tried to do it.. rus.tbl.zip

Do you have discord/skype/telegram ?

RU.zip telegram: AyamiKaze