Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Font question regarding GD.pm

by socketdave (Curate)
on Jul 19, 2005 at 13:51 UTC ( [id://476091]=note: print w/replies, xml ) Need Help??


in reply to Font question regarding GD.pm

I've never tried this, but it looks like you can specify a path to a font file with GD::Text: $gd_text->set_font('/usr/fonts/arial.ttf', 12);.... That may be worth a try.

Replies are listed 'Best First'.
Re^2: Font question regarding GD.pm
by Baz (Friar) on Jul 19, 2005 at 14:46 UTC
    Thanks for the reply.

    OK, lets say I create the following text using GD::Text, how then do I use it with a GD::Image object? In other words, what method do I call to position $gd_text on a png image?
    my $gd_text = GD::Text->new( text => 'Some text', font => 'times.ttf', ptsize => 14, );
      Take a peek at this thread:
      http://groups-beta.google.com/group/comp.lang.perl.misc/browse_thread/thread/e0e3efc840f45279/0ec9568510bfb279?q=gd::text+gd::image&rnum=2&hl=en#0ec9568510bfb279
      The section titled "GD + GD::Text example" may give you a starting point. If this doesn't help, let me know. This is a useful thing to know and I'll try to get it working...
      Found the method $im->stringFT($black,$font,30.0,-0.5,130,130,"Goodbye cruel world!");
      and it works fine.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (8)
As of 2024-04-23 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found