print math symbol into image created with GD

Discussion in 'Perl Misc' started by Kai Schlamp, Apr 17, 2007.

  1. Kai Schlamp

    Kai Schlamp Guest

    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
     
    Kai Schlamp, Apr 17, 2007
    #1
    1. Advertising

  2. Kai Schlamp

    Dr.Ruud Guest

    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.

    --
    Affijn, Ruud

    "Gewoon is een tijger."
     
    Dr.Ruud, Apr 18, 2007
    #2
    1. Advertising

  3. Kai Schlamp

    Kai Schlamp Guest

    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
     
    Kai Schlamp, Apr 18, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pervinder
    Replies:
    1
    Views:
    667
    Jacek Dziedzic
    Sep 22, 2004
  2. baumann@pan
    Replies:
    1
    Views:
    763
    Richard Bos
    Apr 15, 2005
  3. Song Ma
    Replies:
    2
    Views:
    251
    Charles Oliver Nutter
    Jul 20, 2008
  4. VK
    Replies:
    15
    Views:
    1,286
    Dr J R Stockton
    May 2, 2010
  5. Replies:
    6
    Views:
    1,975
Loading...

Share This Page