Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

true type font in GD::Graph

by Anonymous Monk
on Sep 03, 2009 at 15:41 UTC ( [id://793229]=perlquestion: print w/replies, xml ) Need Help??

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

Hi,

I am trying to set the font for GD::Graph using the following code. But default font is not changing! Environment: Windows XP SP3, Perl v5.10

$my_graph->set_title_font('C:/WINDOWS/Fonts/arial.ttf', 14)

I have also tried using font_path method, but could not succeed.

use GD::Text; GD::Text->font_path('c:/windows/fonts/')

Could you please help me resolve this issue ? Thanks in advance

Best

Ram

Replies are listed 'Best First'.
Re: true type font in GD::Graph
by hawtin (Prior) on Sep 03, 2009 at 15:55 UTC

    Its been a while since I last looked at fonts in GD. I have an old piece of code that says:

    # $image->stringFT($line,'/dosc/windows/Fonts/arialnb.ttf', # 12,0, # $border+int($x), # int($y), # $name); $image->string(gdMediumBoldFont, int($x)-$x_offset, int($y), $name,$line);

    My recollection is that the commented out stringFT() method worked OK but there was some other issue with it (finding fonts on other machines for example). So in the end I had to resort to the gd*Font set.

    Hope that helps.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found