The flash plugin and X.Org 7.0 (X11R7) font problems
If you are lucky to have fresh X11R7 on your desktop with all its new features and nice filesystem layout you might have noticed that some things have compatibility problems with it. Namely, if you have flash plugin installed you might not see text in flash content displayed properly, depending on how your Linux distribution handled the upgrade.
Having already had trouble with that (for other reasons I'll explain later) this time fix for the problem was a no brainer. The reason for problems is that the official flash plugin does some font handling of it's own, not using system font file server or X server itself. But it still depends on some filesystem paths and configuration to be in place so it can find font files it needs. By doing
strings libflashplayer.so and carefully skipping over lots of uninteresting text, you can find that flash plugin looks for
/usr/X11R6/lib/X11/fs/config file which is the configuration file of the font server. Next it parses
"catalogue = " line in it to find all available fonts on the system. The trouble is that new release of X.Org server got rid of
/usr/X11R6 system path in favour of putting binaries and other files in the more appropriate places in the filesystem, just like the other linux applications do.
The solution to the problem is simple. You need to put a symlink in the appropriate place so flash plugin can still reach the configuration file it needs. At least until they fix the plugin so it is compatible with the new X.Org. In Debian GNU/Linux unstable, which I use,
/usr/X11R6 tree still exists although it is mostly emptied. So what I did is just put the
fs -> /etc/X11/fs symlink in the
/usr/X11R6/lib/X11 directory and restarted the browser. And voila, now I can see all installed fonts in all their infinite glory (thanks to freetype which is getting better and better with every release).
Now, as I promised, I'll tell you another advice on the same subject. It seems that parser that is built in the flash plugin is not very clever, so even if you have the above mentioned font server configuration file in the right place, you can still have problems if you break
"catalogue = " line and proceed to put your font directories on the following lines. The font server will work just fine, but flash plugin will come to the conclusion that you don't have any fonts installed on the system. So, always put your font paths on the same line right after "catalogue = " string. No matter how ugly it gets, everything will work and you'll be able to see text in the flash content.
Ugh, there is yet another bug in need of resolving. You just got to love binary only extensions for your linux desktop, although this time it seems that a linux package bug is to blame. But only flashplugin is affected (as usual).
If you have followed all advices above and you still don't see text properly, change to your
/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType directory and check that you have
fonts.dir files in it. If you don't, you'll need to run
in that directory to create fresh ones. In that order! That should fix the problem.
If you miss any of the above commands, make sure you have installed ttmkfdir & xfonts-utils packages. Also, gsfonts-x11 package is said to be needed by flash plugin (although it seems we only ever have trouble with truetype fonts).