Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

font(6) [plan9 man page]

FONT(6) 							   Games Manual 							   FONT(6)

NAME
font, subfont - external format for fonts and subfonts SYNOPSIS
#include <libg.h> DESCRIPTION
Fonts and subfonts are described in cachechars(2). External fonts are described by a plain text file that can be read using rdfontfile. The format of the file is a header followed by any number of subfont range specifications. The header contains two numbers: the height and the ascent, both in pixels. The height is the inter-line spacing and the ascent is the distance from the top of the line to the baseline. These numbers are chosen to display consis- tently all the subfonts of the font. A subfont range specification contains two or three numbers and a file name. The numbers are the inclusive range of characters covered by the subfont, with an optional starting position within the subfont, and the file name names an external file suitable for rdsubfontfile. The minimum number of a covered range is mapped to the specified starting position (default zero) of the corresponding subfont. If the subfont file name does not begin with a slash, it is taken relative to the directory containing the font file. Each field must be followed by some white space. Each numeric field may be C-format decimal, octal, or hexadecimal. External subfonts are represented in a more rigid format that can be read and written using rdsubfontfile and wrsubfontfile (see subfal- loc(2)). The format for subfont files is: a bitmap containing character images, followed by a subfont header, followed by character infor- mation. The bitmap has the format for external bitmap files described in bitmap(6). The subfont header has 3 decimal strings: n, height, and ascent. Each number is right-justified and blank padded in 11 characters, followed by a blank. The character info consists of n+1 6-byte entries, each giving the Fontchar x (2 bytes, low order byte first), top, bottom, left, and width. The x field of the last Fontchar is used to calculate the bitmap width of the previous character; the other fields in the last Fontchar are irrelevant. Note that the convention of using the character with value zero (NUL) to represent characters of zero width (see bitblt(2)) means that fonts should have, as their zeroth character, one with non-zero width. FILES
/lib/font/bit/* font directories SEE ALSO
graphics(2), bitblt(2), cachechars(2), subfalloc(2) FONT(6)

Check Out this Related Man Page

IMAGELOADFONT(3)							 1							  IMAGELOADFONT(3)

imageloadfont - Load a new font

SYNOPSIS
int imageloadfont (string $file) DESCRIPTION
imageloadfont(3) loads a user-defined bitmap and returns its identifier. PARAMETERS
o $file - 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. Font file format +--------------+--------------------------------------+---+ |byte position | | | | | | | | | C data type | | | | | | | | description | | | | | | +--------------+--------------------------------------+---+ | byte 0-3 | | | | | | | | | int | | | | | | | | number of characters in the font | | | | | | | byte 4-7 | | | | | | | | | int | | | | | | | | value of first character in the | | | | font (often 32 for space) | | | | | | | byte 8-11 | | | | | | | | | int | | | | | | | | pixel width of each character | | | | | | | byte 12-15 | | | | | | | | | int | | | | | | | | pixel 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. | | | | | | +--------------+--------------------------------------+---+ RETURN VALUES
The font identifier which is always bigger than 5 to avoid conflicts with built-in fonts or FALSE on errors. EXAMPLES
Example #1 imageloadfont(3) usage example <?php // Create a new image instance $im = imagecreatetruecolor(50, 20); $black = imagecolorallocate($im, 0, 0, 0); $white = imagecolorallocate($im, 255, 255, 255); // Make the background white imagefilledrectangle($im, 0, 0, 49, 19, $white); // Load the gd font and write 'Hello' $font = imageloadfont('./04b.gdf'); imagestring($im, $font, 0, 0, 'Hello', $black); // Output to browser header('Content-type: image/png'); imagepng($im); imagedestroy($im); ?> SEE ALSO
imagefontwidth(3), imagefontheight(3). PHP Documentation Group IMAGELOADFONT(3)
Man Page