print math symbol into image created with GD

K

Kai Schlamp

Hy!

I am using the GD::Simple libs to draw a simple diagram. My problem
is, that I have to put some math symbols in there (for example the
symbol for delta and my).
Is there an easy way to do that?

Best regards,
Kai
 
D

Dr.Ruud

Kai Schlamp schreef:
I am using the GD::Simple libs to draw a simple diagram. My problem
is, that I have to put some math symbols in there (for example the
symbol for delta and my).
Is there an easy way to do that?

Yes, with a proper font.
 
K

Kai Schlamp

Yep ... figured it out ... used a truetype font named symbol.ttf from
my windows installation.
Some (solved) problems I encountered (if anyone is interested).
my $image = GD::Simple->new($image_width,$image_height,1); # the 1 is
important, as only then true trype fonts are shown.
$image->stringFT(0x000000, "absolute_path_to/symbol.ttf", 14, 0, 10,
10, "s"); # prints a sigma symbol in the image.

Best regards,
Kai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top