I am trying to run a perl script, that was created in the Windows environment a while ago, on OS X Mountain Lion. I have installed the latest version of perl, perl-5.18.1, via perlbrew and installed the modules I needed, including PDF::API2, and GD. I installed libgd via homebrew. I am getting the error:

"libgd was not built with FreeType font support"

I don't understand this because it looks as if libgd WAS built with FreeType font support:

'brew info libgd' gd: stable 2.1.0, HEAD http://libgd.bitbucket.org/ /usr/local/Cellar/gd/2.1.0 (33 files, 1.7M) * Built from source with: --with-freetype, --with-libvpx, --with-libti +ff From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/ +gd.rb ==> Dependencies Recommended: libpng, jpeg Optional: freetype, libtiff, libvpx

My code includes the path to the system fonts.

my $fontdir = '/Library/Fonts/'; my $typeface = 'Arial.ttf';

This is the line that the error is referring to:

$gd_text->set_font("$fontdir$typeface", $fsize) or die $gd_text->error;

This worked perfectly on Windows. All I did was change the path for OS X. Are TrueType fonts considered to be FreeType fonts?

This is what I've got in my .bash_profile:

export PATH=/usr/local/bin:$PATH export PATH=$PATH:$HOME/bin export PS1='\w : \u$ ' source ~/perl5/perlbrew/etc/bashrc export PERLBREW_ROOT=/opt/perl5 source ${PERLBREW_ROOT}/etc/bashrc

Did I leave anything out?

My path:

/Users/user/perl5/perlbrew/bin:/Users/user/perl5/perlbrew/perls/perl-5.18.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/opt/ImageMagick/bin:/Users/user/bin

How to solve this problem?


In reply to GD giving me the error "libgd was not built with FreeType font support" by PacoH

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.