★ wanayoo — archive 1999 http://php.net/manual/cs/function.imageloadfont.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Graphics
Quick Reference
English version of this pageGerman version of this pageJapanese version of this page
Italian version of this pageFrench version of this pageHungarian version of this page
Spanish version of this pageDutch version of this pageBrazilian Portuguese version of this page
Korean version of this pageCzech version of this page
Graphics
* GetImageSize
* ImageArc
* ImageChar
* ImageCharUp
* ImageColorAllocate
* ImageColorDeAllocate
* ImageColorAt
* ImageColorClosest
* ImageColorExact
* ImageColorResolve
* ImageGammaCorrect
* ImageColorSet
* ImageColorsForIndex
* ImageColorsTotal
* ImageColorTransparent
* ImageCopy
* ImageCopyResized
* ImageCreate
* ImageCreateFromGIF
* ImageCreateFromJPEG
* ImageCreateFromPNG
* ImageCreateFromWBMP
* ImageCreateFromString
* ImageDashedLine
* ImageDestroy
* ImageFill
* ImageFilledPolygon
* ImageFilledRectangle
* ImageFillToBorder
* ImageFontHeight
* ImageFontWidth
* ImageGIF
* ImagePNG
* ImageJPEG
* ImageWBMP
* ImageInterlace
* ImageLine
* ImageLoadFont
* ImagePolygon
* ImagePSBBox
* ImagePSEncodeFont
* ImagePSFreeFont
* ImagePSLoadFont
* ImagePsExtendFont
* ImagePsSlantFont
* ImagePSText
* ImageRectangle
* ImageSetPixel
* ImageString
* ImageStringUp
* ImageSX
* ImageSY
* ImageTTFBBox
* ImageTTFText
* ImageTypes
* read_exif_data

  Thanks to:
 Chek.com
 easyDNS
 VA Linux Systems

  Related sites:
Apache
MySQL
PostgreSQL
Zend Tech.

  Community:
LinuxFund.org
OSDN
Manual: ImageLoadFont
View the source code for this pageSearch the site



Previous page
 ImageLine
 Updated
Thu, 01 Mar 2001
ImagePolygon 
Next page


ImageLoadFont

(PHP 3, PHP 4 )

ImageLoadFont -- Load a new font

Description

int imageloadfont (string file)

ImageLoadFont() loads a user-defined bitmap font and returns an identifier for the font (that is always greater than 5, so it will not conflict with the built-in fonts).

The font file format is currently binary and architecture dependent. This means you should generate the font files on the same type of CPU as the machine you are running PHP on.

Tabulka 1. Font file format

byte positionC data typedescription
byte 0-3intnumber of characters in the font
byte 4-7int value of first character in the font (often 32 for space)
byte 8-11intpixel width of each character
byte 12-15intpixel height of each character
byte 16-char array with character data, one byte per pixel in each character, for a total of (nchars*width*height) bytes.

See also ImageFontWidth() and ImageFontHeight().


User Contributed Notes: ImageLoadFont


angryziber@mail.com
23-Aug-2000 07:23am
You all should look at the GD image library site for information on extra fonts, it can be found at http://www.boutell.com/gd/


webmaster@linuxdownloads.org
29-Jan-2001 07:16pm
You can also use the ImageTTFText() function in order to change the font - or anything that has to do whith it.

I used somth. like:

<?php
$im = imagecreate (50, 250);
$bgcolor = ImageColorAllocate ($im, 0x77, 0x77, 0x77);
$font = ImageColorAllocate ($im, 0x00, 0x00, 0x00);
ImageTTFText ($im, 35, 90, 40, 230, $font, "../arial.ttf", "mytext");
Imagepng ($im, "pic.png");
ImageDestroy ($im);
echo "<html><body><img src=/old?u=http%3A%2F%2Fphp.net%2Fmanual%2Fcs%2F%5C%26quot%3Bpic.png%5C%26quot%3B&y=1999 border=0></body></html>";

?>

Works fine ;-)



 About Notes


Previous page
 ImageLine
 Updated
Thu, 01 Mar 2001
ImagePolygon 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.