How to apply PHP functions imagettftext processing Pictures _php Tutorial

Source: Internet
Author: User
Tags vector font

Defined

Write TTF text to the diagram.

Grammar:

Array imagettftext (int im, int size, int angle, int x, int y, int col, string fontfile, string text);

return value:

Array

Function Type:

Graphics processing

PHP function Imagettftext Content Description:

This function writes the TTF (TrueType fonts) font text to the picture. The parameter size is the dimension of the glyph, angle is the angle of the font, clockwise, 0 degrees is the horizontal, that is, the direction of three o'clock (from left to right), 90 degrees from the bottom to the top of the text; x, y two parameter is the coordinate value of the text (the origin is the upper left corner);

The parameter col is the color of the word, the fontfile is the font file name, or the remote file; text is, of course, the string content. The return value is an array of eight elements, the first two are the lower left x, y coordinates, the third to fourth is the bottom right corner of the x, Y coordinates, and the fifth to sixth and 72 or 82 groups are the X, y coordinates of the upper right and upper left respectively. Treat the Rice ⒁ badger neon timid using this function, the system should be fitted with GD and freetype two function libraries.

PHP function Imagettftext Usage Example

This example creates a black basemap with a 400x30 pixel size and writes out I am number one with the arial vector font!! of white-lettering.

 
 
    1. < ? PHP
    2. Header ("Content-type:image/gif");
    3. $ im = imagecreate (400,30);
    4. $ Black = imagecolorallocate ($im,
      0,0,0);
    5. $ White = imagecolorallocate ($im,
      255,255,255);
    6. Imagettftext ($im, 20, 0, 10, 20,
      $white, "/somewhere/arial.ttf",
      "I am number one!!");
    7. Imagegif ($im);
    8. Imagedestroy ($im);
    9. ?>


http://www.bkjia.com/PHPjc/446059.html www.bkjia.com true http://www.bkjia.com/PHPjc/446059.html techarticle defines the Write TTF text to the diagram. Syntax: array imagettftext (int im, int size, int angle, int x, int y, int col, string fontfile, string text); Return value: Array function type: Graphic ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.