imageloadfont

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ozi

    imageloadfont

    Hi!

    Does enybody know how to make file
    with verdana 10 font for imageloadfont() function?

    I found few working fonts on:


    ozi



  • Niall Kavanagh

    #2
    Re: imageloadfont

    ozi <ozi@post.pl> wrote:[color=blue]
    > Hi![/color]
    [color=blue]
    > Does enybody know how to make file
    > with verdana 10 font for imageloadfont() function?[/color]

    I assume you mean a TrueType font called verdana?

    imageloadfont() is for bitmap fonts; you want likely want to use
    imagettftext():

    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


    --
    niall

    Comment

    • ozi

      #3
      Re: imageloadfont

      > I assume you mean a TrueType font called verdana?

      Yes :)
      [color=blue]
      > imageloadfont() is for bitmap fonts;[/color]

      And i want to create verdana 10 bitmap font or convert
      verdana from ttf to bitmap to use it with
      imagestringup() function.
      I need to write vertical text.
      [color=blue]
      > you want likely want to use
      > imagettftext():
      >
      > http://www.php.net/manual/en/function.imagettftext.php[/color]

      imagettftext() example:

      Can You see the difference?

      ozi


      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: imageloadfont

        "ozi" <ozi@post.pl> wrote in message news:<c80a2a$o2 2$1@atlantis.ne ws.tpi.pl>...
        <snip>[color=blue]
        > imagettftext() example:
        > http://217.153.145.170/~ozi/image/vertical_text.php
        > Can You see the difference?[/color]

        Do you mean this (user note)? <http://in.php.net/imagettftext#27 685>

        --
        | Just another PHP saint |
        Email: rrjanbiah-at-Y!com

        Comment

        • Niall Kavanagh

          #5
          Re: imageloadfont

          ozi <ozi@post.pl> wrote:[color=blue][color=green]
          >> I assume you mean a TrueType font called verdana?[/color][/color]
          [color=blue]
          > Yes :)[/color]
          [color=blue][color=green]
          >> imageloadfont() is for bitmap fonts;[/color][/color]
          [color=blue]
          > And i want to create verdana 10 bitmap font or convert
          > verdana from ttf to bitmap to use it with
          > imagestringup() function.[/color]

          Converting a font is not possible in PHP, and so offtopic.
          [color=blue]
          > I need to write vertical text.[/color]

          Use the "angle" parameter for imagettftext() to specify what direction
          to write the text.
          [color=blue][color=green]
          >> you want likely want to use
          >> imagettftext():
          >>
          >> http://www.php.net/manual/en/function.imagettftext.php[/color][/color]
          [color=blue]
          > imagettftext() example:
          > http://217.153.145.170/~ozi/image/vertical_text.php
          > Can You see the difference?[/color]

          I only see an error message. ;( Could you post your code?

          --
          niall



          Comment

          • ozi

            #6
            Re: imageloadfont

            > Converting a font is not possible in PHP, and so offtopic.

            I don't want to convert font in PHP.
            I wanto to create this font under linux or windows to use if with
            imageloadfont() .
            I just can't find the tool to do this :(
            [color=blue][color=green]
            > > I need to write vertical text.[/color][/color]
            [color=blue]
            > Use the "angle" parameter for imagettftext() to specify what direction
            > to write the text.[/color]

            I know that :)
            [color=blue]
            > I only see an error message. ;( Could you post your code?[/color]

            Hmmmm, it works on my computer.

            header("content-type:image/png");
            $Image=ImageCre ate(400,30);
            $black=ImageCol orAllocate($Ima ge,0,0,0);
            $white=ImageCol orAllocate($Ima ge,255,255,255) ;
            imagefill($Imag e, 0, 0, $white);
            ImageTTFText($I mage, 10, 0, 10, 20, $black,
            "/home/ozi/public_html/image/verdana.ttf","T his is verdana 10");
            ImagePNG($Image , "/home/ozi/public_html/image/im.png");
            ImageDestroy($I mage);
            echo '<img src="im.png" border="0"><br />';
            echo 'This is verdana 10 from css file (body { font: normal 10px
            Verdana; })!';

            Screenshot:


            ozi


            Comment

            • ozi

              #7
              Re: imageloadfont

              > Do you mean this (user note)? <http://in.php.net/imagettftext#27 685>

              Interesting but i changed my code to:
              $r = (10/96)*72;
              ImageTTFText($I mage, $r, 0, 10, 20, $black,
              "/home/ozi/public_html/image/verdana.ttf","T his is verdana 10");
              and still the difference is big.


              ozi


              Comment

              Working...