Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/matt/src/cvs/imlib/docs/class.ImlibText.php
PHP Imlib2 Classes - Imlib

ImlibText

ImlibColor
   |
  +-- ImlibText

Does everything relevant to text drawing

 

public class ImlibText extends ImlibColor

Does everything relevant to text drawing
The routine for dealing text is to load a font, set an image to draw on,and draw a string.

AuthorsMatt McClanahan <cardinal@dodds.net>
Version0.3

 

Methods inherited from ImlibColor

imlibcolor, get_color, get_color_array, set_color, set_color_array

Public Method Summary

void

ImlibText()

ImlibText constructor
bool

draw(int $x, int $y, string $str, [ string $dir ])

Draw a text string onto the current image
bool

free()

Free the currently loaded font
integer

get_image()

Get the current image resource id#
bool

get_size(string $str, int &$w, int &$h, [ string $dir ])

Get the width and height of a given string if it were drawn
bool

load(string $path, string $font, int $size)

Load a font
void

set_image(int $im)

Set the image resource id# to draw on

Fields inherited from ImlibColor

$color

Private Field Summary

unknown

$fnt

Resource id# of the currently loaded font
unknown

$im

Resource id# of the image to draw on

Public Method Details

ImlibText

public void ImlibText( )

  ImlibText constructor

Returns void


draw

public bool draw( int $x, int $y, string $str, [ string $dir ] )

  Draw a text string onto the current image

Parameter
int $x
coordinate of the upper left corner of the string
int $y
coordinate of the upper left corner of the string
string $str
string to draw
string $dir = >>IMLIB_TEXT_TO_RIGHT<<
of the text
Returns bool

False if no font is loaded


free

public bool free( )

  Free the currently loaded font

Returns bool

False if no font is loaded


get_image

public integer get_image( )

  Get the current image resource id#

Returns integer

Image resource id#


get_size

public bool get_size( string $str, int &$w, int &$h, [ string $dir ] )

  Get the width and height of a given string if it were drawn

Parameter
string $str
to measure
int &$w
Width the string would be
int &$h
Height the string would be
string $dir = >>IMLIB_TEXT_TO_RIGHT<<
to measure the string
Returns bool

False if no font is loaded


load

public bool load( string $path, string $font, int $size )

  Load a font
If the font is in the font path, it can be referred to by font name,and the path does not need to be specified. Otherwise, it must bereferred to by filename.

Parameter
string $path
, or current directory if passed blank
string $font
name
int $size
size
Returns bool

False if no font is loaded


set_image

public void set_image( int $im )

  Set the image resource id# to draw on

Parameter
int $im
resource id#
Returns void


Private Field Details

$fnt

private unknown $fnt

>><<

Resource id# of the currently loaded font


$im

private unknown $im

>><<

Resource id# of the image to draw on



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta