Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

18.4 Text zeichnen > Lösung

Lösung

Für eingebaute GD-Schriftarten verwenden Sie ImageString( ):

ImageString($image, 1, $x, $y, 'I love PHP Cookbook', $text_color);

Für TrueType-Schriftarten verwenden Sie ImageTTFText( ):

ImageTTFText($image, $size, 0, $x, $y, $text_color, '/pfad/zu/font.ttf',
             'I love PHP Cookbook');

Für PostScript-Type-1-Schriftarten verwenden Sie ImagePSLoadFont( ) und ImagePSText( )

$font = ImagePSLoadFont('/pfad/zu/font.pfb');
ImagePSText($image, 'I love PHP Cookbook', $font, $size,
            $text_color, $background_color, $x, $y);

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint