Jump to content
Eternal Lands Official Forums
kilolife

Chat in any language. Now for the Russian.

Recommended Posts

Here is simple patch. Compile and work on Linux, win and FreeBSD.

 

http://developer.berlios.de/patch/index.ph...p;group_id=1256

 

This patch need special font. Ready font for russian chars and source code (fontrus.xcf open it in GIMP) for design any font for different non-english language here:

http://afkt.ru/el/russian_v_00.3.tar.bz2

 

You can add hook like

else if (unikey >= NNNN && unikey <= MMMM ) { # See utf-8 charmap for proper boundary
 switch (unikey) {
 //begin remap Russian letter to exist english
 case AAAA:return BB;

for any language,

I use all free cell in fontmap for russian letters. So you have to do remap for your language, just as was done for the Russian.

 

Thank you for your attention.

Comments are welcome.

Edited by kilolife

Share this post


Link to post
Share on other sites
Can someone look at this patch and see if it causes problems?

I've started having a look but don't know that part of the client code too well so it may take a little digging around. The code compiles and runs fine, the font works fine but I haven't figured how to produce the extra characters yet. kilolife has moved some code around so it's worth putting another pair of eyes on that. kilolife has also been careful in his README to say the patch should only be used on the test server. It might be useful for you to approve use of this patch on the main server so that more testing can be done. If someone else has this patch covered then say so, otherwise I'll look at it more over the next few days.

Share this post


Link to post
Share on other sites

Thanks for see to patch.

but I haven't figured how to produce the extra characters yet. kilolife has moved some code around so it's worth putting another pair of eyes on that.

For example, take Cherokee alphabet.

install gucharmap, select Cherokee and see boundary. From 0x13A0 to 0x13F4, or, in decimal from 5024 to 5108.

Add to code

//Set hook for Cherokee utf-16 .
else if (unikey >=  5024 && unikey <= 5108 )
{
 switch (unikey) {
 //begin remap Cherokee letter to exist english
 .....
 case 5034:return 65; //Letter A in English same as letter A in Cherokee.
 .....
 }
//begin remap to original Cherokee letter. In this point we free to place new letter from 217 to 252 fontmap cell.
switch (unikey) {
case 5064:return 217;//Cherokee letter QUI
....
 }
}

Next, we must take GIMP, beautiful Cherokee font, file fontrus.xcf and fill xcf file and save as fontcher.bmp

As a result, Cherokee people, (who switch to fontcher.bmp font in game chat font settings, of course) can chat on the Cherokee language.

And, in any case, all people can chat on english.

 

Thank you for your attention.

Sorry for my bad english.

Edited by kilolife

Share this post


Link to post
Share on other sites

In my opinion, this patch is great :)

I tested it on WindowsXP, WindowsVIsta (mingw compiler from Dev-C++ suite). Not found problems, any bugs. It would be great if the patch can be used in Main server. Because, no one with whom to talk in Test server :/

kilolife +1

Share this post


Link to post
Share on other sites

With only an English keyboard, this patch is very difficult for me to test. However, I think I have found some issues.

 

1) The move of the character conversion functions from get_font_char() to key_to_char() unfortunately breaks the display of existing text (such as in the encyclopedia) were non-English characters are used. For example "æ" and "ß". These character are no longer visible. It also means, I think, that it will not be possible to create text external from the client such as a Russian encyclopedia. Moving all the conversion code back into get_font_char() should work though.

 

2) I think, rather than use a new font file for Russian, the Russian symbols need to be added to the existing font files. If this is not done, only players using the special Russian font will be able to see Russian text in chat etc. Also, should Russian language support be fully added to the client then having to select both a special font and the language mode would be unnecessarily complicated.

Edited by bluap

Share this post


Link to post
Share on other sites

Thanks for test!

 

About issues:

 

1)confirm, will work on

 

2)No problem to add russian to existing font. I need only the names of fonts used. Or some *,ttf files. I make special font for example and for easy testing.

Share this post


Link to post
Share on other sites
2)No problem to add russian to existing font. I need only the names of fonts used. Or some *,ttf files. I make special font for example and for easy testing.

 

Umm... the "fonts" are stored in bitmaps in your EternalLands folder, in "textures", like font.bmp, font2.bmp and so on.

 

They are NOT *.ttf files or something like that.

 

Those bmp's have space left for 50 more chars, 3 rows with 14 characters at the bottom plus 8 characters in the last used line.

 

After having a short look at Wikipedia about the cyrillic alphabet, it looks like that it has more than 26 letters, and upper and lower case too.

 

So the complete cyrillic alphabet might not fit into the existing bitmaps.

 

So it might be needed to enlarge those bitmaps (and the code in the client which uses them) to add the full cyrillic alphabet.

 

*waits for a request to add kanji or simplified chinese too*

 

:D

 

Piper

Share this post


Link to post
Share on other sites
Umm... the "fonts" are stored in bitmaps in your EternalLands folder, in "textures", like font.bmp, font2.bmp and so on.

They are NOT *.ttf files or something like that.

Those bmp's have space left for 50 more chars, 3 rows with 14 characters at the bottom plus 8 characters in the last used line.

After having a short look at Wikipedia about the cyrillic alphabet, it looks like that it has more than 26 letters, and upper and lower case too.

So the complete cyrillic alphabet might not fit into the existing bitmaps.

So it might be needed to enlarge those bitmaps (and the code in the client which uses them) to add the full cyrillic alphabet.

*waits for a request to add kanji or simplified chinese too*

 

:o

 

Piper

Thanks for comment.

I know about font.bmp. But i (and you too) can quick compile font.bmp from any *.ttf

This patch enlarge bmp up to 12 lines (from 10)(and modify client code to use them) to add extra space for letters.

 

My goal - to allow ethnic groups to communicate in their native language, just now, without changing server code.

And by making minimal changes in the client code.

 

Clients send messages to each other through the server, using one-byte encoding.

Under these restrictions, no easy way to implement a complete multilingual chat.

But we can allow to communicate Russian with Russian, Chinese with Chinese etc, using a special font for every case.

Edited by kilolife

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×