About rus_stringtable

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Message
Author
cjckem
Space Floater
Posts: 21
Joined: Sat Jul 07, 2012 9:54 am

About rus_stringtable

#1 Post by cjckem »

Hello.
I have a question about the display font.
There is two files rus_stringtable (this is old versions, for object lesson)
rus_stringtable.txt - there is no chr(13)+chr(10) at the end of file, which font is displayed properly
and
rus_stringtable1.txt - there is chr(13)+chr(10) at the end of file, and font in game looks bad

In new version bad looking font not corrected in a similar way. For example - http://freeorion.org/index.php?title=Ru ... oldid=8618
this file not work properly, But if we reduce the description of the LRN_ARTIF_MINDS_DESC and LRN_XENOARCH_DESC to one line, font begin displayed correctly.

How to win in this unequal battle with the font? :( Help me, please
Attachments
problem.zip
In archive:
rus_stringtable.txt
rus_stringtable1.txt
allok.png
badlook.png
(216.53 KiB) Downloaded 36 times

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12853
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About rus_stringtable

#2 Post by Geoff the Medio »

I haven't looked at your attachments, but if the issue is that files that have Windows-style CR+LF endlines aren't displayed properly, can you not just save your file as Linux-style LF only? A decent text editor should be able to do this.

cjckem
Space Floater
Posts: 21
Joined: Sat Jul 07, 2012 9:54 am

Re: About rus_stringtable

#3 Post by cjckem »

it does not help. I replaced all of the CR + LF to LF, font is still displayed with some bugs (only on russian letters) - as in the screenshot in the attachment.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12853
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About rus_stringtable

#4 Post by Geoff the Medio »

What encoding are you files saved in? Anything other than UTF-8 is likely to cause problems...

cjckem
Space Floater
Posts: 21
Joined: Sat Jul 07, 2012 9:54 am

Re: About rus_stringtable

#5 Post by cjckem »

Anything other than UTF-8 is likely to cause problems...
I now it. codepage UTF-8

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12853
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About rus_stringtable

#6 Post by Geoff the Medio »

cjckem wrote:I now it. codepage UTF-8
Sorry, I don't understand that...

cjckem
Space Floater
Posts: 21
Joined: Sat Jul 07, 2012 9:54 am

Re: About rus_stringtable

#7 Post by cjckem »

Sorry, *I know it*
Files encoded in the UTF-8. I started to translate Freeorion in 2009, and even then found out that the encoding of the text must be UTF-8 :)



!!!!!!!UPDATE!!!!!: The source of the problem is the font file, I found it by using arial.ttf from russian windows 7
Last edited by cjckem on Sun Jul 15, 2012 6:46 am, edited 1 time in total.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12853
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About rus_stringtable

#8 Post by Geoff the Medio »

Hmm... It's very strange that the two very similar files produce or don't produce those text artifacts so consistently. If tzlaine were around, he might be able to fix it, but I can only guess. And what I do guess is that perhaps you're using a character from a different code page in the problematic file that isn't in the working file?

From my tweaking, the issues seem to be specific to the LRN_FORCE_FIELD_DESC string; I copied all the other different lines into the working file, and it still works, but copying that line causes the artifacts to appear.

Edit: Tweaked a bit more, and I have no idea what's going on. No particular character seems to be the problem, but making the LRN_FORCE_FIELD_DESC a bit longer beyond a threshold (which is about 3 characters less than the length of the string in the problematic file) causes it to mess up all the fonts. No particular characters selectively cause this to happen differently from others, as far as I can tell.

All I can suggest is to try to shorten that particular string's text below the magic threshold...

Edit 2: Using only 'a' characters, the length of the string that causes problems is 513 characters; one more than a power of 2, which seems conspicuous. I'm guessing the Cyrillic characters you're using are 2 or more bytes each, so it ends up being that the length of string that causes the problem is also over 512 bytes, but that this is about 286 characters of Russian text.

Of course, there are other strings int he file over 512 characters long that don't cause problems, so who knows...

Edit 3: A longer than 512 characters string copied from later in the file onto the LRN_FORCE_FIELD_DESC string causes the artifacts, even though the same text later in the file doesn't...

cjckem
Space Floater
Posts: 21
Joined: Sat Jul 07, 2012 9:54 am

Re: About rus_stringtable

#9 Post by cjckem »

Cyrillic characters you're using are 2 or more bytes each
yes, all Cirillic characters is 2 bytes long in UTF-8, but I'm sure there are more reasons than the string length, as I also tried to check out some options with the cuts strings.

Can we hope that this bug will be fixed, or someone will call the exact causes of the bug? Translation takes time, I would like to see it was not spent in the empty :(

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12853
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About rus_stringtable

#10 Post by Geoff the Medio »

cjckem wrote:Can we hope that this bug will be fixed, or someone will call the exact causes of the bug?
You can hope, but I have no idea if or when it will be fixed.

For now, it seems that the problem can be avoided by shortening whenever strings it randomly decides are not allowed to be long.

cjckem
Space Floater
Posts: 21
Joined: Sat Jul 07, 2012 9:54 am

Re: About rus_stringtable

#11 Post by cjckem »

Hurray!!! The source of the problem is the font file. I found it by replacing in game settings DejaVuSans.ttf to arial.ttf from windows 7.
What can we do now? Arial is not open-source font :(

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12853
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About rus_stringtable

#12 Post by Geoff the Medio »

That changing the font file fixes it for you doesn't really make the original font file the "source" of the problem. It's likely some weird interaction between GiGi, freetype, FreeOrion, and the particular font file and text being used.

That said, no, the Windows Ariel font file isn't an acceptable replacement. We don't have to use DejaVu fonts, but what we do use needs to be available under a free license.

You might try the latest version of the DejaVu fonts: http://dejavu-fonts.org/wiki/Download

cjckem
Space Floater
Posts: 21
Joined: Sat Jul 07, 2012 9:54 am

Re: About rus_stringtable

#13 Post by cjckem »

Geoff the Medio wrote:That said, no, the Windows Ariel font file isn't an acceptable replacement. We don't have to use DejaVu fonts, but what we do use needs to be available under a free license.
I am understand
Geoff the Medio wrote:You might try the latest version of the DejaVu fonts: http://dejavu-fonts.org/wiki/Download
I tried, it does not help. Second translator - Node49 (which my translation adapted to fresh versions) says that he replaced the font to Arial does not help. Strange.

Any way I'll try to find a free license font, which will help

cjckem
Space Floater
Posts: 21
Joined: Sat Jul 07, 2012 9:54 am

Re: About rus_stringtable

#14 Post by cjckem »

now SVN5030 is crash with font arial.ttf

APPCRASH
app: freeorion.exe
ver: 0.0.0.0
time: 5004704c
name module: GiGi.dll
ver module: 0.0.0.0
time module: 4ffbe31c
: c0000005
: 00051959
OC: 6.1.7601.2.1.0.256.48
lang: 1049
info 1: 0a9e
info 2: 0a9e372d3b4ad19135b953a78882e789
info 3: 0a9e
info 4: 0a9e372d3b4ad19135b953a78882e789

I think it's not normal

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12853
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: About rus_stringtable

#15 Post by Geoff the Medio »

cjckem wrote:now SVN5030 is crash with font arial.ttf
You'll need to provide more details: what were you doing before the crash (something in particular in the GUI, or just starting up?), is it reproducible, does it happen with any other font files? Also, attach freeorion.log and ogre.log to a post, from immediately after the crash... The stuff in the Windows crash report is pretty much useless.

Post Reply