ron7 has asked for the wisdom of the Perl Monks concerning the following question:

Dear All

In testing my TK based app on XP, OSX, FC9, and FC13, the latter totally ignores all the font types specified for the widgets. My fonts are defined like this:

use constant TEXT_FONT => '-Adobe-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*';
I've also tried:
use constant TEXT_FONT = 'TkTextFont';
This changes things for everything except the fc13 box which stays the same no matter what, so I must conclude it's some 'X' thing in the standard FC13 install (I noticed it's missing a lot of utilities usually present. The Devs say they are moving towards a more user-friendly desktop and are dropping the more techie things from the standard install).

I know just enough X to get by, but have never delved into the fonts. Can anyone give me a pointer to what might be causing this?

Replies are listed 'Best First'.
Re: Tk fonts and Fedora 13
by Khen1950fx (Canon) on Feb 05, 2011 at 08:21 UTC
    The vendor's perl-Tk builds Tk with XFT. Specifically, it uses the XFT=1 option, something like:
    %{perl} Makefile.PL INSTALLDIRS=vendor X11LIB=%{libdir} XFT=1
    I'd try downloading Tk from CPAN and then manually install it:
    perl Makefile.PL make make test make install_site
      You've jogged my memory (it was a while ago). I had to cpan install Tk on both the fc9 and 13 boxes. In both acses, the install had to be "forced" due to the number of test case failures (though they run ok, except for the font issue on fc13). I'll try your suggestion of not using the cpan utility.

      Later: No change. The t/font.t said:

      t/font.t .................. 1/34 Font Courier -12 still in cache.
      
      I'll look into that, but don't think it's the problem. Will also try this test case on the working FC9 install for comparison.

      Even later still...

      On both the "working" Tk install (FC9) and "non-working" (FC13) install, the fonts.t test fails test 11 (Value of -size from fontActual (Times font).

      However the "working" font.t test exits with a segmentation fault after test 24 (Core dump check (especially for XFT)) while the "non-working" install continues to the end of the test program, skipping tests 14..23.

      Test 24 runs a test that causes a core dump with the Xft version of Perl/Tk, so it looks like the FC9 (working) version HAS XFT while the non-working one may not.

      To confuse matters more, running the application from the FC9 box over a SSH connection to the FC13 box, the font problem disappears. If I read this right, it suggests that the problem lies with the X font setup on the X server in question, not Tk itself (ie, when the app is run remotely, it's using the local perl modules, but talking with the X system on the machine running the ssh session).

      Listing the fonts (xlsfonts) gives about the same result on both machines. But the utility 'xfontsel' does no exist on the FC13 box (it is on the "working" FC9 machine), so I'm wondering if this is connected to the problem. Maybe some part of X has not been installed?

      Some progress: Installing (yum) xorg-x11-fonts-Type1 on the FC13 box has the Tk apps actually displaying something different--not the same as the FC13 box as I'm getting a serif font instead of Helvetica as specified in the code, but looks like I'm heading in the right direction. Interestingly, the version yum installed was for FC12.

      So looks like Perl was not the culprit. With this on top of other things, I can really find nothing to recommend FC13 to developers.

      Last word on the subject FC13 was also missing the 100dpi x11 fonts. I did a standard install from the DVD adding the servers and programming environments. Looks like X11 fonts are no longer "standard". This release also lacks a DMI driver for the Intel chipset. Devs stay clear.