About rus_stringtable
Moderator: Oberlus
About rus_stringtable
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
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 60 times
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: About rus_stringtable
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.
Re: About rus_stringtable
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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: About rus_stringtable
What encoding are you files saved in? Anything other than UTF-8 is likely to cause problems...
Re: About rus_stringtable
I now it. codepage UTF-8Anything other than UTF-8 is likely to cause problems...
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: About rus_stringtable
Sorry, I don't understand that...cjckem wrote:I now it. codepage UTF-8
Re: About rus_stringtable
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
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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: About rus_stringtable
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...
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...
Re: About rus_stringtable
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.Cyrillic characters you're using are 2 or more bytes each
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
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: About rus_stringtable
You can hope, but I have no idea if or when it will be fixed.cjckem wrote:Can we hope that this bug will be fixed, or someone will call the exact causes of the bug?
For now, it seems that the problem can be avoided by shortening whenever strings it randomly decides are not allowed to be long.
Re: About rus_stringtable
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
What can we do now? Arial is not open-source font
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: About rus_stringtable
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
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
Re: About rus_stringtable
I am understandGeoff 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 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.Geoff the Medio wrote:You might try the latest version of the DejaVu fonts: http://dejavu-fonts.org/wiki/Download
Any way I'll try to find a free license font, which will help
Re: About rus_stringtable
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
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
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: About rus_stringtable
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.cjckem wrote:now SVN5030 is crash with font arial.ttf