Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Funny fonts in ActivePerl under Linux

by jowe (Sexton)
on Mar 04, 2013 at 18:18 UTC ( [id://1021688]=perlquestion: print w/replies, xml ) Need Help??

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

Hi PerlMonks,


the following szenarios give me some headache:

1. ActivePerl (5.14.3.1404) under MS Windows using different fonts works well.

2. Cross-packaging the code using PerlApp (9.1.1) to Linux (Mint 14.2) using the very same ActivePerl (5.14.3.1404) Linux version gives me just very poor quality fonts (reminds me on plotting 20 years ago).

3. Straight ActivePerl (5.14.3.1404) under Linux without PerlApp: same poor fonts as described under 2.

4. 'native' Perl (5.14) (which comes with the Linux Mint distribution) gives me perfect fonts (as expected).

Could anyone explain what I am doing wrong?

Your help is very much appreciated. Thanks in advance
jowe

Replies are listed 'Best First'.
Re: Funny fonts in ActivePerl under Linux
by moritz (Cardinal) on Mar 04, 2013 at 20:00 UTC

    I am confused. Perl produces input and output through the operating system, and is not concerned with fonts at all.

    Unless you actually use Perl to turn text strings into pixel graphics, be it through a rendering library or through a GUI toolkit. Are you using one of those? If yes, which? If not, how is Perl related to displaying fonts at all?

Re: Funny fonts in ActivePerl under Linux
by ww (Archbishop) on Mar 04, 2013 at 19:54 UTC
    I don't think I understand your problem.... or at least, I don't understand why you're "(c)ross-packaging (some) code using PerlApp (9.1.1)." (Why? What's wrong with moving it across your LAN; sneaker-net-ing; or using FTP?
    PerlApp does NOT compile your script; it packages it together with it's known dependent modules and what AS calls a "modified" Perl interpreter, but the script still has to be compiled and executed on the target machine.)

    My understanding is (in effect) that you're using the "packaging" with the AS utility called PerlApp to move scripts from the Win box to the Mint box... and don't like the way the script looks when you reopen the script in an editor or cat it to a term (or are you unhappy with the font used for whatever OUTPUT the script generates?).

    Alternately, I might read your node as a description of moving scripts from the Win box to the *nix box, then running the script on the 'nix box under what you think is "the very same ActivePerl (5.14.3.1404)" and begin dissatisfied with the appearance of the output, wherever you're seeing it.

    Are you really sure the Active Perl on the 'nix box was compiled with all the exact same options/libs/etc as the M$ Win version? My reaction is "maybe," but I don't quite buy it... and while I won't spend time researching that, you might want to do so. And, of course, given the way PerlApp actually works, you're likely to have issues with fonts because those on your Win box are NOT identical to the 'nix flavor.

    Acknowledged, of course, that both may be mis-understandings.

    In either case, please clarify your problem statement. And note also that you've used some very subjective standards ("poor" & "plotting 20 years ago") to describe the problem. Can you provide something more nearly objective -- even, for example, screen shots in dropbox or similar.


    If you didn't program your executable by toggling in binary, it wasn't really programming!

      "I don't think I understand your problem.... or at least, I don't understand why you're "(c)ross-packaging (some) code using PerlApp (9.1.1)." (Why? What's wrong with moving it across your LAN; sneaker-net-ing; or using FTP?"

      Creating a package can have advantages over moving much code ensuring that the target systems have all prerequisite modules installed. Such things can confuse end users who just expect to run an app. See PAR, pp and these slides for further enlightenment.

      "PerlApp does NOT compile your script; it packages it together with it's known dependent modules and what AS calls a "modified" Perl interpreter, but the script still has to be compiled and executed on the target machine.)"

      OP made no claim to be compiling scripts, they explicitly state they create packaging an app. I'm not sure why you're telling them this.

      "My understanding is (in effect) that you're using the "packaging" with the AS utility called PerlApp to move scripts from the Win box to the Mint box... and don't like the way the script looks when you reopen the script in an editor or cat it to a term (or are you unhappy with the font used for whatever OUTPUT the script generates?)."

      Unlikley. It's far more likely to be a problem relating to a GUI toolkit, my guess.

        1. marto said: "I'm not sure why you're telling them this."

        Because the totality of the OP's "headaches" (and the one that's not a painful "szenario" -- the perfect rendering with the native (Mint) Perl) -- suggested to me that OP does NOT understand the merits and costs of packaging versus simply moving the script.

        2. marto said: "Unlikley." (sic)

        I think your surmise about a toolkit ( and moritz' earlier response ) are likely to home in on the real problem, but your "unlikley" is -- IMO -- off-target: its antecedant is not an unlikely bit of advice or worthless suggestion, but, rather, (part of) my bid to have OP clarify the problem-statement (see the last two paras).


        If you didn't program your executable by toggling in binary, it wasn't really programming!

Re: Funny fonts in ActivePerl under Linux
by marto (Cardinal) on Mar 05, 2013 at 10:00 UTC

    You haven't explained your problem well enough for anyonre to respond with anything other than guess work and truisms. You have to describe what you're packaging and where you see the problem. My guess is that you're packaging some Tk app, and the fonts on your linux system look strange due to antialiasing or whatever.

    Please read How do I post a question effectively? and PerlMonks for the Absolute Beginner. After reading and understanding these please clarify your issue.

Re: Funny fonts in ActivePerl under Linux
by jowe (Sexton) on Mar 05, 2013 at 13:01 UTC
    Sorry guys,

    I forgot to mention, that I'm talking about a Tk script and let's forget about packaging using PerlApp, which was just clouding the issue. The script itself does not make use of any inside '-font' declaration at all. Perl is called
    perl <script-name> -font "<choosen font>"
    And as I mentioned, this works fine with any choosen font under Windows ActivePerl as well as under the 'native' Linux-supplied Perl. The problem is in the Linux ActivePerl distribution. Whatever font I choose, it looks ugly. Is there any additional 'use' or an environment variable required?
    Again sorry, to waste your valuable time.
    Best regards - jowe

      So, it's fine with Perl which ships with your distribution, but not ActiveState Perl on the same machine. My initial suspicion is that this is due to how the Tk has been built by ActiveState. README:

      By default Perl/Tk makes use of client side fonts via freetype2, fontconfig and Xft on Unix systems. This gives anti-aliased fonts for regular text (if you have TrueType or Type1 fonts and they are in your fontconfig config file). See also http://fontconfig.org . To disable this feature run the Makefile.PL with "perl Makefile.PL XFT=0".

      Perhaps you need to do some digging in order to find out the differences between distributions. Out of curiosity is there a specific reason you're using ActiveState Perl on Linux?

        The idea was to develop under Windows using ActivePerl and just cross-package the final result to Linux without any major effort. But after diving into it, the reality looks somehow different.
        The answer may be: Using ActivePerl with PerlApp under Windows and distribution-supplied Perl with PAR::Packer (pp) under Linux.
        Thanks for your help.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1021688]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-23 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found