FreeOrion

Forums for the FreeOrion project
It is currently Wed Jun 19, 2013 12:08 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: font display a little weird
PostPosted: Tue Aug 07, 2012 11:38 am 
Offline
Space Krill
User avatar

Joined: Tue Aug 07, 2012 11:30 am
Posts: 1
Met all the dependancies, freetype fonts, boost etc etc,
Compiled on Fedora 16, the compile log was pretty much clean, not a single error, FO svn checkout revision 5096 and used GIGI from the source in the FO svn , GIGI revision 1074 in the externals link GG/

But on running freeorion, font's in all controls and dialogs are a little glitchy, readable and all, but something is glitching at the bottom of all the lines, image attached.


Attachments:
File comment: Glitchy text in all dialogs
FO_textglitch.png
FO_textglitch.png [ 80.46 KiB | Viewed 340 times ]
Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Tue Aug 07, 2012 8:39 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
This is a longstanding known issue:
http://sourceforge.net/tracker/?func=de ... tid=544942
viewtopic.php?p=34755#p34755

It's likely some incompatibility between drivers, GiGi, and FreeType. It sometimes depends on font size or seemingly irrelevant modification to the stringtable, like making a particular (but not other) strings slightly longer, or changing the location of the game.


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Sun Aug 19, 2012 9:09 pm 
Offline
Space Floater

Joined: Sat Jun 02, 2012 11:29 pm
Posts: 31
I have the same problem on my openSUSE 12.1 x86_64 system (with freeorion 0.4.0); however, I stumbled upon this:

http://stackoverflow.com/questions/4035 ... and-opengl

See the first answer about changing the pixel byte alignment. Could this have anything to do with it?


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Sun Aug 19, 2012 10:53 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
Try rebuilding the latest SVN with the attached patch applied, which wraps the font render calls with calls to glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

It seems to work for me, but I don't know what would or wouldn't have reproduced the problem before the change for me, so I can't really test...

Note that in the latest SVN, GG code is in the FreeOrion repository, rather than pulled in as an external. Updating might not work right from an older repository version if you don't delete the GG directory first.


Attachments:
Font.cpp.unpack_alignment.patch [2.86 KiB]
Downloaded 5 times
Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Mon Aug 20, 2012 3:12 am 
Offline
Space Floater

Joined: Sat Jun 02, 2012 11:29 pm
Posts: 31
Looks like the simple solution was to remove the .ttf files included with the game, from the shared data directory.


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Mon Aug 20, 2012 3:44 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
Random changes like adding or removing a few characters to the stringtable file, or changing its location, or using a different font, have been reported to seemingly fix cause the issue, only to have it return later, so don't assume it's really fixed until you've tested fairly extensively.


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Tue Aug 21, 2012 1:46 pm 
Offline
Space Floater

Joined: Sat Jun 02, 2012 11:29 pm
Posts: 31
I found a clue as to why removing the fonts from the data directory and moving the game works:

If the font file paths pointed to in the config.xml are nonexistent, then the game displays fonts just fine.

I'm not sure what this means, or even what it could mean...


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Tue Aug 21, 2012 5:18 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
Perhaps you have another copy of the font files that FO uses somewhere in your system path directories? As I said, random changes seem to intermittently fix the issue for others, so using a slightly different font file could do it.


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Tue Aug 21, 2012 5:39 pm 
Offline
Space Floater

Joined: Sat Jun 02, 2012 11:29 pm
Posts: 31
There is an equivalent DejaVuSans.ttf in a system directory; however, it md5sums the exact same as the one included with FO.

Using different font files does not fix it either - so far all that I have tested produced the artifacts; the only consistent pattern so far is if they are found in that config.xml or not. If not, then some default (which looks like DejaVuSans.ttf) is loaded from somewhere and renders properly.

I'll still try to see if I can narrow it further.


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Wed Aug 22, 2012 1:08 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
raptor wrote:
There is an equivalent DejaVuSans.ttf in a system directory; however, it md5sums the exact same as the one included with FO.
What happens if you rename / remove that file as well?


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Wed Aug 22, 2012 3:56 am 
Offline
Space Floater

Joined: Sat Jun 02, 2012 11:29 pm
Posts: 31
Geoff the Medio wrote:
What happens if you rename / remove that file as well?

Most interesting: the in-game fonts still work just fine. Are there other font files that I'm not aware of?


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Wed Aug 22, 2012 4:01 am 
Offline
Space Floater

Joined: Sat Jun 02, 2012 11:29 pm
Posts: 31
Sorry to reply to myself -

Even more interesting:

I ran the 'lsof' command to grab any open resource handles that freeorion may be using - it has libfreetype loaded, but there is not a single font file being used by the game. Is there a built-in one?

The plot thickens...


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Wed Aug 22, 2012 4:15 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8055
Location: Vancouver, BC
raptor wrote:
Is there a built-in one?
Yes, GiGi has a built-in Vera font in DefaultFont.h. I'd have expected an exception to be thrown and possibly a crash if a font file was requested that didn't exist, though... Crashes due to not being able to find font files were quite commonly reported for a while, before the files were moved around.


Top
 Profile  
 
 Post subject: Re: font display a little weird
PostPosted: Wed Aug 22, 2012 4:51 am 
Offline
Space Floater

Joined: Sat Jun 02, 2012 11:29 pm
Posts: 31
So this now means that as long as you don't load any other font, then the default one is used, and is the only that works without artifacts.

So I wonder what the difference is between loading the default and loading a font from a file (maybe only on Linux)?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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