Russian localization - HUD font issue

Custom mods, stories, and artwork based on the Evochron / Arvoch universe.
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

Hello!

I'm working for russian localization of Evochron Mercenary. At current stage, I've issue only in HUD. Seems to be, font is drawn in a HUD with algorithm to adjust tilt of angle, in that case you can see on the problem via screenshot below, that will help to understand me.
I use russian version of evochronfont.ttf, also this problem arrives with any other font with russian letters, my current setfont.txt:
EvochronFontRU (or any other font)
36
0
1
0
1
24
As you see on screenshot below, there are no russian letters in list of cargo bay of target ship (red box), but also problem is in Alt, Grv, W, H and other HUD counters, i.e everywhere. Although I used custom HUD, but problem is persist in original one too. It is strange but dots (perhaps other standard symbols) is drawn in HUD correctly.

May be Font Charset option in setfont.txt file somehow help, but I dont know what exactly means by Charset, especially in digits.

Is there a way to resolve the issue?

Image

Thanks.

[Edited on 5-10-2011 by gh0stwizard]
User avatar
Marvin
Global Moderator
Global Moderator
Posts: 14373
Joined: Wed Mar 04, 2009 5:47 am
Location: Fallon-Reno

Russian localization - HUD font issue

Post by Marvin »

You need to change your font to one with Russian characters. If your computer can correctly display Russian when surfing the Web, then you're on the right track. If you're using Windows XP, you can search for a font name in the following folder:

C:\\WINDOWS\\Fonts

Or, if you have MS Word, you can find the name of an appropriate font in the Font window.
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

Well, current font is perfect display russian characters in game, except HUD. Everywhere, in Game Menu, Shipyard, Inventory Console, Navigation Console, etc, font is displaying russian perfect. On screenshot above you can see fully translated Inventory Console on russian.

I have an idea that problem in encoding in file text.dat. I'have translated text in ANSI encoding and it somehow works. I will continue to find decision...

EDIT:
I found out information for Font Type: MSDN Font::GdiCharSet Property

I edited setfont.txt like this:
Arial
34
0
204
0
1
24
I created text.dat file (see an attachment) with 2 changes in the next lines:
742=Grv:
1451=TRAINING

This strings has correct translation. You will see that in Main Menu TRAINING will typed with typical russian characters. And you will not see any text in HUD (Full mode) for "Grv:" encounter.

I think this problem will also affect on any other arabic, greek, hebrew and others glyphs.

[Edited on 5-10-2011 by gh0stwizard]
User avatar
Marvin
Global Moderator
Global Moderator
Posts: 14373
Joined: Wed Mar 04, 2009 5:47 am
Location: Fallon-Reno

Russian localization - HUD font issue

Post by Marvin »

Image I'd look for a font that works in MS Word and use that (the font name) in place of "Arial."
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

You can try Calibri, Candara (win 7), Tahoma, Verdana, Arial Narrow, Geogria. Also OTF: DejaVu Sans, Liberation Sans and Droid Sans.

Very useful freeware utility for view of installed font is Font Xplorer. In it shows which font supports which languages.
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

Another way how to reproduce this bug:
1. Put in text.dat lines above any chars from your local alphabet, but non-ASCII character (a-z). In instance, choose any green char from this image
Image

And put it to lines described above:
742=<put here any non-ASCII character(-s)>
1451=<put here also at least one non-ASCII character>

Note: Above image is windows-1252 charset, but you can choose any of non-ASCII chars on your keyboard, as you wish.

2. Create or modify your setfont.txt:
<Any font that supports non-ASCII characters>
34
0
1
0
1
24
3. Where is bug?
a) In Main Menu first option (TRAINING) will displays selected non-ASCII character(-s) correctly.
b) In the game with enabled full HUD, 'Grv' (gravity) encounter near ladder will not displays selected non-ASCII char(-s).

It is important to resolve this bug, because russian translation were completed today, current stage: open beta test. All texts were translated, except strings that uses part of HUD.
I also forgot to say that Menu displays text correctly in top of HUD (near compas at top of screen). Blinking text, "formation" and "autopilot", is also displays perfectly.

[Edited on 5-11-2011 by gh0stwizard]

[Edited on 5-11-2011 by gh0stwizard]
User avatar
Vice
Administrator
Administrator
Posts: 12227
Joined: Fri Apr 25, 2003 1:38 am

Russian localization - HUD font issue

Post by Vice »

Not sure if it will solve the problem or not, but you can try to apply the Russian character set for the font type. Here is a list of some of the available types (204 is probably the one you want to try):

DEFAULT_CHARSET 1
SYMBOL_CHARSET 2
OEM_CHARSET 255
TURKISH_CHARSET 162
EASTEUROPE_CHARSET 238
RUSSIAN_CHARSET 204
MAC_CHARSET 77
BALTIC_CHARSET 186
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

Vice, thank you for response. I tried to use 204 charset, its doesn't help, as with default charset it is everywhere perfect, except HUD.
User avatar
Marvin
Global Moderator
Global Moderator
Posts: 14373
Joined: Wed Mar 04, 2009 5:47 am
Location: Fallon-Reno

Russian localization - HUD font issue

Post by Marvin »

Image Just wondering ... does the Text file affect anything in the HUD display?
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

From post: 107138, Topic: tid=7567, author=Marvin wrote:Image Just wondering ... does the Text file affect anything in the HUD display?
It is not a problem of text file. This is problem of text rendering. There are blank spaces instead of chars.
Maarschalk
Captain
Captain
Posts: 7641
Joined: Wed Feb 25, 2009 12:24 am
Location: USA, Also check your six!

Russian localization - HUD font issue

Post by Maarschalk »

Is it maybe resolution related? Some characters look different or strange on certain resolutions and maybe the HUD is set at a different resulotion.....I'm just guessing here to a possible cause....;)
Arvoch Alliance Stat:


Evochron Legends Stats:


Evochron Mercenary Stats:


Darkness is the absence of Light as Evil is the absence of Good
Whitewolfkf
Ensign
Ensign
Posts: 15
Joined: Sun May 15, 2011 3:31 pm
Location: Russia

Russian localization - HUD font issue

Post by Whitewolfkf »

Hmm... Whether there in setfont.txt par. which responsible for the font size in HUD?
Maybe it`s anological problem? http://www.starwraith.com/forum/viewtopic.php?t=7298

[Edited on 5-16-2011 by Whitewolfkf]
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

Vice, can you check that game engine uses correct Font() drawing function? I mean that all parameters from setfont.txt used by this function. Maybe there are another function, which may influence the drawing of the font.
All the russian pilots will thank you for resolving this bug.
User avatar
Vice
Administrator
Administrator
Posts: 12227
Joined: Fri Apr 25, 2003 1:38 am

Russian localization - HUD font issue

Post by Vice »

I'm not sure why the text would not render only for those characters. The only difference is the HUD characters are pre-captured to images and then applied as textures. So it's possible there may either be some positioning issue(s) or compatibility issue. Unfortunately, I don't have the Russian character set to test with, but I would suggest trying different positioning values in the font file to see if they are just displaced in some way. Also, please post the exact font settings you are using for that file.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

I'll check the changes of the coordinates and reported it later today. And what about my theory of non-ASCII characters? Has anyone tried it?

setfont.txt:
EvochronFontRU
38
0
204
0
0
24

EvochronFontRU - modification of original EvochronFont with widows-1251 chars.
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

Well, I tested different positions and there are all is same. Vice, try any font and type in text.dat any char within 80-FF (hex) range, in instance µ - Alt+0181. To verify that the russian letters are not printed do not necessarily have a russian keyboard layout. I now see that any character after the 127 (7F hex) is not displayed. Look here: Wikipedia - Windows-1250
Your font is only up to 127 characters, so that you can use any font with ready-made characters after 127 (80-FF hex).
User avatar
Vice
Administrator
Administrator
Posts: 12227
Joined: Fri Apr 25, 2003 1:38 am

Russian localization - HUD font issue

Post by Vice »

I tried out a few ideas and they didn't work either. We may have hit a limitation with the development platform used for the game, for which there would not be a practical solution for. I may try some other ideas tomorrow to see if there might be some kind of work-around.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

I have one risky proposition - to translate all texts in UTF-8. Before this course to check the behavior DBPro to work with unicode. Vice, you have considered this option?
User avatar
Vice
Administrator
Administrator
Posts: 12227
Joined: Fri Apr 25, 2003 1:38 am

Russian localization - HUD font issue

Post by Vice »

Do you mean the text.dat file? If so, it can be saved to a different text format for testing, but the result may still be the same.
StarWraith 3D Games
www.starwraith.com | www.spacecombat.org
3D Space Flight and Combat Simulations
gh0stwizard
Ensign
Ensign
Posts: 27
Joined: Tue May 10, 2011 11:20 am
Location: St.-Petersburg, Russia

Russian localization - HUD font issue

Post by gh0stwizard »

I tested text files in UTF-8 encoding - nothing good, but expected: .exe reads all files in ANSI encoding, so it is explains why you added line with character encoding in setfont.txt. In game all lines from UTF-8 looks bad:
1. abracadabra
2. per each char from text file game is show 2 chars (UTF-8 is 2-byte encoding).