Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I cannot change font or size for labels etc.
For example from GD::Graph (modified)
(It is included in the build directory of the distribution.)
my $font_spec = "Dustismo_Sans"; $my_graph->set_y_label_font($font_spec, 12); $my_graph->set_x_label_font($font_spec, 12); $my_graph->set_y_axis_font($font_spec, 10); $my_graph->set_x_axis_font($font_spec, 36); $my_graph->set_title_font($font_spec, 48); $my_graph->set_legend_font($font_spec, 8); $my_graph->set_values_font($font_spec, 8);
Dustismo_Sans.ttf is in pwd. And I have tried "Dustismo_Sans" and "Dustismo_Sans.ttf" and "/home/john/Dustismo_Sans.ttf" for $font_spec

Whatever I put in $font_spec or in the size field, the appearance of the resulting image is always the same!


1. I assume that GD would look for the font file given a relative (to pwd) file name or an absolute file name. Correct?

2. Why can I not change size or font?

3. My OS is FC 8. I loaded msttcorefonts-2.0-1.spec, Microsoft TTL fonts, and they are usable by OpenOffice but I cannot locate corresponding .ttf files. Do they exist as such and if so, where are they?


uname -a Linux scan #1 SMP Thu Dec 18 19:19:45 EST 2008 i686 i6 +86 i386 This is perl, v5.8.8 built for i386-linux-thread-multi GD-2.45 GDGraph-1.44 GDTextUtil-0.86

In reply to GD::Graph cannot change font by kp2a

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (3)
    As of 2018-01-20 04:11 GMT
    Find Nodes?
      Voting Booth?
      How did you see in the new year?

      Results (226 votes). Check out past polls.