RUS symbols in the game?

[TwT]~Darkness

Pirate
Registered
LV
0
 
Joined
Mar 11, 2026
Messages
19
Reaction score
2
Points
8
Good afternoon. I’ve run into an issue with fonts in the game. The plan was to keep English as the main language, but add Russian text using “\” and generally implement Cyrillic characters in the game. However, everything ends up looking broken—the client refuses to display the font correctly.

Has anyone encountered something like this before? Could someone suggest how to fix it? My Windows settings are configured correctly, and UTF-8 is disabled. I set the server/client file encoding to ANSI, convert to ANSI, and then save. The characters do appear, but as you can see from the screenshots, they’re distorted.

Maybe someone can explain what’s going wrong?
Perhaps I made a mistake somewhere or missed something.

Thanks in advance to anyone who responds.


1774050946777.webp1774051309799.webp1774051371683.webp
 
This is a very ancient and lost knowledge.

In the MPFont.cpp file, remove all constructs of the following form:
C++:
if ( *ch & 0x80 )
{
    ch++;
    offset = w * 2 + ASSIZE;
}
....
if ( ch[0] & 0x80 )
{
    n++;
    ch[1] = szText[n];
    offset = w + ASSIZE;
}
There are seven such places in the file. They are slightly different, but they all check for 0x80.
Previously, the logic was: “if the high bit is set (& 0x80), we assume that the character is two bytes.” This is suitable for Chinese/Korean ANSI pages (DBCS), but not for Russian CP1251, where a Russian letter is one byte 0xC0..0xFF.
If you don't remove this check:
- the parser "eats" an extra byte (ch++ / n++),
- the width is calculated as for a 2-byte glyph,
- the string "moves", and the characters break.

Further in the function CMPFont::TextToTexture
C++:
::TextOut(_hDc, 0, 0, sz, c1 & 0x80 ? 2 : 1);
replace with
::TextOut(_hDc, 0, -2, sz, c1 & 0x100 ? 2 : 1);
and the function CMPFont::FillTextToTex
C++:
::TextOut(_hDc, 0, 0, sz, ch[0] & 0x80 ? 2 : 1);
replace with
::TextOut(_hDc, 0, -2, sz, ch[0] & 0x100 ? 2 : 1);

0x80 for Russian bytes is almost always true, and TextOut gets a length of 2 (incorrect for CP1251).
0x100 in a typical build with unsigned char is almost always false, so the length becomes 1.
This is essentially a "hack" to disable two-byte mode without rewriting the code.

A shift of -2 raises the character image by 2 pixels to remove the visual “sagging”/clipping at the bottom and better fit the Cyrillic characters into the atlas cell.
 
  • Love
Reactions: [TwT]~Darkness