FreeOrion

Forums for the FreeOrion project
It is currently Wed Jun 19, 2013 3:49 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: About rus_stringtable
PostPosted: Fri Jul 13, 2012 5:07 pm 
Offline
Space Floater

Joined: Sat Jul 07, 2012 9:54 am
Posts: 21
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:
File comment: In archive:
rus_stringtable.txt
rus_stringtable1.txt
allok.png
badlook.png

problem.zip [216.53 KiB]
Downloaded 8 times
Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Fri Jul 13, 2012 6:18 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
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.


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sat Jul 14, 2012 11:04 am 
Offline
Space Floater

Joined: Sat Jul 07, 2012 9:54 am
Posts: 21
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.


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sat Jul 14, 2012 11:25 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
What encoding are you files saved in? Anything other than UTF-8 is likely to cause problems...


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sat Jul 14, 2012 3:59 pm 
Offline
Space Floater

Joined: Sat Jul 07, 2012 9:54 am
Posts: 21
Quote:
Anything other than UTF-8 is likely to cause problems...

I now it. codepage UTF-8


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sat Jul 14, 2012 5:47 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
cjckem wrote:
I now it. codepage UTF-8
Sorry, I don't understand that...


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sun Jul 15, 2012 3:10 am 
Offline
Space Floater

Joined: Sat Jul 07, 2012 9:54 am
Posts: 21
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.

Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sun Jul 15, 2012 4:25 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
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...


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sun Jul 15, 2012 6:01 am 
Offline
Space Floater

Joined: Sat Jul 07, 2012 9:54 am
Posts: 21
Quote:
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 :(


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sun Jul 15, 2012 6:35 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
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.


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sun Jul 15, 2012 6:52 am 
Offline
Space Floater

Joined: Sat Jul 07, 2012 9:54 am
Posts: 21
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 :(


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sun Jul 15, 2012 6:59 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
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


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Sun Jul 15, 2012 7:09 am 
Offline
Space Floater

Joined: Sat Jul 07, 2012 9:54 am
Posts: 21
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


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Tue Jul 17, 2012 10:15 am 
Offline
Space Floater

Joined: Sat Jul 07, 2012 9:54 am
Posts: 21
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


Top
 Profile  
 
 Post subject: Re: About rus_stringtable
PostPosted: Tue Jul 17, 2012 4:09 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: AhrefsBot, Google [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group