Class: I2CE FontMetricMultiDirection: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 19: Line 19:
==Methods==
==Methods==
===__construct()===
===__construct()===
The constructor
The constructor @params array $directions of mixed the directions.  the value -1 is reserved for global information array has a default value of  0 (horizontal) and 1 (vertical).  Sets the direction to be $directions[0]
@params array $directions of mixed the directions.  the value -1 is reserved for global information
array has a default value of  0 (horizontal) and 1 (vertical).  Sets the direction to be $directions[0]
needs to be one that is a valid encoding for PHP multibyte strings.
*Signature: public function __construct($directions,$encoding)
*Signature: public function __construct($directions,$encoding)
Parameters:
*Parameters:
*$directions  
*$directions  
* [[Class: I2CE_Encoding | I2CE_Encoding]] $encoding<br/>the encoding used for the internal storage of strings/characters
** [[Class: I2CE_Encoding | I2CE_Encoding]] $encoding <br/>the encoding used for the internal storage of strings/characters needs to be one that is a valid encoding for PHP multibyte strings.
===getAllFontCharacteristics()===
===getAllFontCharacteristics()===
Get all the font information
Get all the font information
Line 33: Line 30:
get the asceneder value
get the asceneder value
*Signature: public function getAscender()
*Signature: public function getAscender()
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $ascender
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ]<br/>$ascender *
*
===getBoundingBox()===
===getBoundingBox()===
Get the bounding box
Get the bounding box $returns array $bbox of numeric. The bounding box in llx lly urx ury order
$returns array $bbox of numeric. The bounding box in llx lly urx ury order
*Signature: public function getBoundingBox()
*Signature: public function getBoundingBox()
===getCharacterHeight()===
===getCharacterHeight()===
Gets the character height of a character
Gets the character height of a character
@param bool use_font_size default false --
*Signature: public function getCharacterHeight($ch,$use_font_size)
*Signature: public function getCharacterHeight($ch,$use_font_size)
*Returns: [http://www.php.net/manual/en/language.types.float.php float ] the width
*Parameters:
Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch <br/>a character @param bool use_font_size default false --
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch<br/>a character
*$use_font_size  
*$use_font_size  
**Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.types.float.php float ]<br/>the width
===getCharacterHeights()===
===getCharacterHeights()===
Get the character heights
Get the character heights
*Signature: public function getCharacterHeights()
*Signature: public function getCharacterHeights()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ] of number, the values of which are the heights
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of number, the values of which are the heights and the keys of which are some combination of glpyh names, character codes, and unicodes codepoints, or characters
and the keys of which are some combination of
glpyh names, character codes, and unicodes codepoints, or characters
===getCharacterInfo()===
===getCharacterInfo()===
Get information associated to  a character
Get information associated to  a character
*Signature: public function getCharacterInfo($ch,$key)
*Signature: public function getCharacterInfo($ch,$key)
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value
*Parameters:
Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch <br/>a character (or glyphname)
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch<br/>a character (or glyphname)
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $key
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $key
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>$value
===getCharacterWidth()===
===getCharacterWidth()===
Gets the character width of a character
Gets the character width of a character
@param bool use_font_size default false --
*Signature: public function getCharacterWidth($ch,$use_font_size)
*Signature: public function getCharacterWidth($ch,$use_font_size)
*Returns: [http://www.php.net/manual/en/language.types.float.php float ] the width
*Parameters:
Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch <br/>a character @param bool use_font_size default false --
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch<br/>a character
*$use_font_size  
*$use_font_size  
**Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.types.float.php float ]<br/>the width
===getCharacterWidths()===
===getCharacterWidths()===
Get the character widths
Get the character widths
*Signature: public function getCharacterWidths()
*Signature: public function getCharacterWidths()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ] of number, the values of which are the widths
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of number, the values of which are the widths and the keys of which are some combination of glpyh names, character codes, and unicodes codepoints, or characters
and the keys of which are some combination of
glpyh names, character codes, and unicodes codepoints, or characters
===getDescender()===
===getDescender()===
get the desceneder value
get the desceneder value
*Signature: public function getDescender()
*Signature: public function getDescender()
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $descender
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ]<br/>$descender *
*
===getDirection()===
===getDirection()===
Function to get the font direction
Function to get the font direction
Line 88: Line 76:
Function to get the possible directions
Function to get the possible directions
*Signature: public function getDirections($add_global)
*Signature: public function getDirections($add_global)
*Returns: [http://www.php.net/manual/en/language.types.array.php array ] of mixed -- the directions
*Parameters:
Parameters:
** boolena $add_global <br/>(defaults to false) whether or not to include the global direction, -1
* boolena $add_global<br/>(defaults to false) whether or not to include the global direction, -1
***Default Value: false
**Default Value: false
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>of mixed -- the directions
===getEncoding()===
===getEncoding()===
Get the encoding information for the font. This is global info
Get the encoding information for the font. This is global info
Line 98: Line 86:
===getFixedStringWidth()===
===getFixedStringWidth()===
Function caluclulate the length of a fixed width string
Function caluclulate the length of a fixed width string
@param bool use_font_size default false --
*Signature: protected function getFixedStringWidth($string,$use_font_size)
*Signature: protected function getFixedStringWidth($string,$use_font_size)
*Returns: [http://www.php.net/manual/en/language.types.float.php float ] the length of the string
*Parameters:
Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $string <br/>the string we wish to calculate the length of @param bool use_font_size default false --
* [http://www.php.net/manual/en/language.types.string.php string ] $string<br/>the string we wish to calculate the length of
*$use_font_size  
*$use_font_size  
**Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.types.float.php float ]<br/>the length of the string
===getFixedWidth()===
===getFixedWidth()===
Get the width of a character in a fixed width font (for the current direction)
Get the width of a character in a fixed width font (for the current direction)
*Signature: public function getFixedWidth()
*Signature: public function getFixedWidth()
*Returns: number Returns null if called when the current font is not fixed width
*Returns: number<br/>Returns null if called when the current font is not fixed width
===getFontCharacteristic()===
===getFontCharacteristic()===
Get a global font characteristic
Get a global font characteristic @param $key
@param $key
*Signature: public function getFontCharacteristic($key)
*Signature: public function getFontCharacteristic($key)
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]  the value associated to the $key
*Parameters:
Parameters:
*$key  
*$key  
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>the value associated to the $key
===getFontSize()===
===getFontSize()===
Get the font size.  This is global info.
Get the font size.  This is global info.
Line 122: Line 108:
===getKerningByGroup()===
===getKerningByGroup()===
get the kerning values associated to a pair of groups
get the kerning values associated to a pair of groups
@param bool use_font_size default false --
*Signature: public function getKerningByGroup($g1,$g2,$use_font_size)
*Signature: public function getKerningByGroup($g1,$g2,$use_font_size)
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $kern  the kerning value or null if none found
*Parameters:
Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $g1 <br/>the preceeding group
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $g1<br/>the preceeding group
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $g2 <br/>the following group @param bool use_font_size default false --
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $g2<br/>the following group
*$use_font_size  
*$use_font_size  
**Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ]<br/>$kern  the kerning value or null if none found
===getKerningByPair()===
===getKerningByPair()===
get the kerning values associated to a pair of character
get the kerning values associated to a pair of character
@param bool use_font_size default false --
*Signature: public function getKerningByPair($ch1,$ch2,$use_font_size)
*Signature: public function getKerningByPair($ch1,$ch2,$use_font_size)
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ] the kerning value or null if there is none found
*Parameters:
Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch1 <br/>the preceeding character
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch1<br/>the preceeding character
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch2 <br/>the following character @param bool use_font_size default false --
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch2<br/>the following character
*$use_font_size  
*$use_font_size  
**Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ]<br/>the kerning value or null if there is none found
===getKerningGroup()===
===getKerningGroup()===
Get the kerning groups associated to a character
Get the kerning groups associated to a character
*Signature: public function getKerningGroup($ch)
*Signature: public function getKerningGroup($ch)
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ] the group
*Parameters:
Parameters:
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch <br/>the character
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch<br/>the character
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]<br/>the group
===getKerningValue()===
===getKerningValue()===
Return the (horizontal) kerning values for a pair of characters
Return the (horizontal) kerning values for a pair of characters @params string $ch1 the left characcter @params string $ch2 the right character @param bool use_font_size default false --
@params string $ch1 the left characcter
@params string $ch2 the right character
@param bool use_font_size default false --
*Signature: public function getKerningValue($ch1,$ch2,$use_font_size)
*Signature: public function getKerningValue($ch1,$ch2,$use_font_size)
*Returns: [http://www.php.net/manual/en/language.types.float.php float ] the kerning value or null if none is found
*Parameters:
Parameters:
*$ch1  
*$ch1  
*$ch2  
*$ch2  
*$use_font_size  
*$use_font_size  
**Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.types.float.php float ]<br/>the kerning value or null if none is found
===getLinegap()===
===getLinegap()===
get the line gap value
get the line gap value
*Signature: public function getLinegap()
*Signature: public function getLinegap()
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $linegap
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ]<br/>$linegap *
*
===getStringWidth()===
===getStringWidth()===
Caluclulate the length of a string
Caluclulate the length of a string
@param bool use_font_size default false --
*Signature: public function getStringWidth($string,$use_font_size)
*Signature: public function getStringWidth($string,$use_font_size)
*Returns: float/int the length of the string
*Parameters:
Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $string <br/>the string we wish to calculate the length of @param bool use_font_size default false --
* [http://www.php.net/manual/en/language.types.string.php string ] $string<br/>the string we wish to calculate the length of
*$use_font_size  
*$use_font_size  
**Default Value: false
***Default Value: false
*Returns: float/int<br/>the length of the string
===getTrackingValues()===
===getTrackingValues()===
Get the tracking values for the current font size
Get the tracking values for the current font size
*Signature: public function getTrackingValues()
*Signature: public function getTrackingValues()
*Returns: [http://www.php.net/manual/en/language.types.array.php array ] $values of floats.  $values[0] is the minimum, $values[1] is the maximum or null if
*Returns: [http://www.php.net/manual/en/language.types.array.php array ]<br/>$values of floats.  $values[0] is the minimum, $values[1] is the maximum or null if if there is no tracking values
if there is no tracking values
===getVariableStringWidth()===
===getVariableStringWidth()===
Function caluclulate the length of a variable width string
Function caluclulate the length of a variable width string
@param bool use_font_size default false --
*Signature: protected function getVariableStringWidth($string,$use_font_size)
*Signature: protected function getVariableStringWidth($string,$use_font_size)
*Returns: [http://www.php.net/manual/en/language.types.float.php float ] the length of the string
*Parameters:
Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $string <br/>the string we wish to calculate the length of @param bool use_font_size default false --
* [http://www.php.net/manual/en/language.types.string.php string ] $string<br/>the string we wish to calculate the length of
*$use_font_size  
*$use_font_size  
**Default Value: false
***Default Value: false
*Returns: [http://www.php.net/manual/en/language.types.float.php float ]<br/>the length of the string
===isFixedWidth()===
===isFixedWidth()===
Check to see if the current font is fixed width
Check to see if the current font is fixed width
*Signature: public function isFixedWidth()
*Signature: public function isFixedWidth()
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ] true if it is fixed width
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]<br/>true if it is fixed width
===setAscender()===
===setAscender()===
set the asceneder value
set the asceneder value
*
*Signature: public function setAscender($ascender)
*Signature: public function setAscender($ascender)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $ascender
** [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $ascender *
===setBoundingBox()===
===setBoundingBox()===
Set the bounding box
Set the bounding box $param array $bbox of numeric. The bounding box in llx lly urx ury order
$param array $bbox of numeric. The bounding box in llx lly urx ury order
*Signature: public function setBoundingBox($bbox)
*Signature: public function setBoundingBox($bbox)
Parameters:
*Parameters:
*$bbox  
*$bbox  
===setCharacterHeight()===
===setCharacterHeight()===
Sets the character height of a character
Sets the character height of a character
*Signature: public function setCharacterHeight($ch,$h)
*Signature: public function setCharacterHeight($ch,$h)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch<br/>a character
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch <br/>a character
* [http://www.php.net/manual/en/language.types.float.php float ] $h<br/>height
** [http://www.php.net/manual/en/language.types.float.php float ] $h <br/>height
===setCharacterInfo()===
===setCharacterInfo()===
Sets information associated to  a character
Sets information associated to  a character
*Signature: public function setCharacterInfo($ch,$key,$value)
*Signature: public function setCharacterInfo($ch,$key,$value)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch<br/>a character (or glyphname)
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch <br/>a character (or glyphname)
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $key
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $key
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value
===setCharacterWidth()===
===setCharacterWidth()===
Sets the character width of a character
Sets the character width of a character
*Signature: public function setCharacterWidth($ch,$w)
*Signature: public function setCharacterWidth($ch,$w)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch<br/>a character
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch <br/>a character
* [http://www.php.net/manual/en/language.types.float.php float ] $w<br/>the width
** [http://www.php.net/manual/en/language.types.float.php float ] $w <br/>the width
===setDescender()===
===setDescender()===
set the desceneder value
set the desceneder value
*
*Signature: public function setDescender($descender)
*Signature: public function setDescender($descender)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $descender
** [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $descender *
===setDirection()===
===setDirection()===
Function to set the font direction
Function to set the font direction @params mixed $direction. -1 is global information, all other values are user defined directions.
@params mixed $direction. -1 is global information, all other values are
user defined directions.
*Signature: public function setDirection($direction)
*Signature: public function setDirection($direction)
Parameters:
*Parameters:
*$direction  
*$direction  
===setFixedHeightSize()===
===setFixedHeightSize()===
set the fixed height character size
set the fixed height character size
*Signature: public function setFixedHeightSize($height)
*Signature: public function setFixedHeightSize($height)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $height<br/>the height
** [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $height <br/>the height
===setFixedWidth()===
===setFixedWidth()===
Set whether or not this is a fixed width font
Set whether or not this is a fixed width font @parma boolean $is_fixed_width
@parma boolean $is_fixed_width
*Signature: public function setFixedWidth($is_fixed_width)
*Signature: public function setFixedWidth($is_fixed_width)
Parameters:
*Parameters:
*$is_fixed_width  
*$is_fixed_width  
===setFixedWidthSize()===
===setFixedWidthSize()===
set the fixed width character size
set the fixed width character size
*Signature: public function setFixedWidthSize($width)
*Signature: public function setFixedWidthSize($width)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $width<br/>the width
** [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $width <br/>the width
===setFontCharacteristic()===
===setFontCharacteristic()===
Set a  font characteristic
Set a  font characteristic
*Signature: public function setFontCharacteristic($key,$value)
*Signature: public function setFontCharacteristic($key,$value)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.types.string.php string ] $key
** [http://www.php.net/manual/en/language.types.string.php string ] $key
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $value
===setFontSize()===
===setFontSize()===
Set the font size.  This is global info.
Set the font size.  This is global info. @params int $size
@params int $size
*Signature: public function setFontSize($size)
*Signature: public function setFontSize($size)
Parameters:
*Parameters:
*$size  
*$size  
===setGlobal()===
===setGlobal()===
Specify that we are working with global font metric
Specify that we are working with global font metric information, e.g. glpyhnames, font size, etc.
information, e.g. glpyhnames, font size, etc.
*Signature: public function setGlobal()
*Signature: public function setGlobal()
===setKerningByGroup()===
===setKerningByGroup()===
set the kerning values associated to a pair of groups
set the kerning values associated to a pair of groups
@params numeric $kern  the kerning value
*Signature: public function setKerningByGroup($g1,$g2,$kern)
*Signature: public function setKerningByGroup($g1,$g2,$kern)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $g1<br/>the preceeding group
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $g1 <br/>the preceeding group
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $g2<br/>the following group
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $g2 <br/>the following group @params numeric $kern  the kerning value
*$kern  
*$kern  
===setKerningByPair()===
===setKerningByPair()===
set the kerning values associated to a pair of character
set the kerning values associated to a pair of character
@params numeric $kern  the kerning value
*Signature: public function setKerningByPair($ch1,$ch2,$kern)
*Signature: public function setKerningByPair($ch1,$ch2,$kern)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch1<br/>the preceeding character
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch1 <br/>the preceeding character
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch2<br/>the following character
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch2 <br/>the following character @params numeric $kern  the kerning value
*$kern  
*$kern  
===setKerningGroup()===
===setKerningGroup()===
Set the kerning groups associated to a character
Set the kerning groups associated to a character
*Signature: public function setKerningGroup($ch,$group)
*Signature: public function setKerningGroup($ch,$group)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch<br/>the character
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $ch <br/>the character
* [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $group<br/>the group
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $group <br/>the group
===setLinegap()===
===setLinegap()===
set the line gap value
set the line gap value
*
*Signature: public function setLinegap($linegap)
*Signature: public function setLinegap($linegap)
Parameters:
*Parameters:
* [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $linegap
** [http://www.php.net/manual/en/language.pseudo-types.php numeric ] $linegap *
==Inherited Variables==
==Inherited Variables==
===$character_widths===
===$character_widths===

Revision as of 22:43, 16 October 2009

This article desrcibes the class I2CE_FontMetricMultiDirection.

Class to contain information about font metrics. Setup to handle multiple directions.

Variables

$font_metrics

protecteed @var array of I2CE_FontMetric $font_metrics contains the fonr metrics that are global or for user defined directions

  • Type: protected $font_metrics

$direction

  • Type: protected $direction

$directions

  • Type: protected $directions

Methods

__construct()

The constructor @params array $directions of mixed the directions. the value -1 is reserved for global information array has a default value of 0 (horizontal) and 1 (vertical). Sets the direction to be $directions[0]

  • Signature: public function __construct($directions,$encoding)
  • Parameters:
  • $directions
    • I2CE_Encoding $encoding
      the encoding used for the internal storage of strings/characters needs to be one that is a valid encoding for PHP multibyte strings.

getAllFontCharacteristics()

Get all the font information

  • Signature: public function getAllFontCharacteristics()

getAscender()

get the asceneder value

  • Signature: public function getAscender()
  • Returns: numeric
    $ascender *

getBoundingBox()

Get the bounding box $returns array $bbox of numeric. The bounding box in llx lly urx ury order

  • Signature: public function getBoundingBox()

getCharacterHeight()

Gets the character height of a character

  • Signature: public function getCharacterHeight($ch,$use_font_size)
  • Parameters:
    • mixed $ch
      a character @param bool use_font_size default false --
  • $use_font_size
      • Default Value: false
  • Returns: float
    the width

getCharacterHeights()

Get the character heights

  • Signature: public function getCharacterHeights()
  • Returns: array
    of number, the values of which are the heights and the keys of which are some combination of glpyh names, character codes, and unicodes codepoints, or characters

getCharacterInfo()

Get information associated to a character

  • Signature: public function getCharacterInfo($ch,$key)
  • Parameters:
  • Returns: mixed
    $value

getCharacterWidth()

Gets the character width of a character

  • Signature: public function getCharacterWidth($ch,$use_font_size)
  • Parameters:
    • mixed $ch
      a character @param bool use_font_size default false --
  • $use_font_size
      • Default Value: false
  • Returns: float
    the width

getCharacterWidths()

Get the character widths

  • Signature: public function getCharacterWidths()
  • Returns: array
    of number, the values of which are the widths and the keys of which are some combination of glpyh names, character codes, and unicodes codepoints, or characters

getDescender()

get the desceneder value

  • Signature: public function getDescender()
  • Returns: numeric
    $descender *

getDirection()

Function to get the font direction

  • Signature: public function getDirection()
  • Returns: mixed

getDirections()

Function to get the possible directions

  • Signature: public function getDirections($add_global)
  • Parameters:
    • boolena $add_global
      (defaults to false) whether or not to include the global direction, -1
      • Default Value: false
  • Returns: array
    of mixed -- the directions

getEncoding()

Get the encoding information for the font. This is global info

getFixedStringWidth()

Function caluclulate the length of a fixed width string

  • Signature: protected function getFixedStringWidth($string,$use_font_size)
  • Parameters:
    • string $string
      the string we wish to calculate the length of @param bool use_font_size default false --
  • $use_font_size
      • Default Value: false
  • Returns: float
    the length of the string

getFixedWidth()

Get the width of a character in a fixed width font (for the current direction)

  • Signature: public function getFixedWidth()
  • Returns: number
    Returns null if called when the current font is not fixed width

getFontCharacteristic()

Get a global font characteristic @param $key

  • Signature: public function getFontCharacteristic($key)
  • Parameters:
  • $key
  • Returns: mixed
    the value associated to the $key

getFontSize()

Get the font size. This is global info.

  • Signature: public function getFontSize()
  • Returns: int

getKerningByGroup()

get the kerning values associated to a pair of groups

  • Signature: public function getKerningByGroup($g1,$g2,$use_font_size)
  • Parameters:
    • mixed $g1
      the preceeding group
    • mixed $g2
      the following group @param bool use_font_size default false --
  • $use_font_size
      • Default Value: false
  • Returns: numeric
    $kern the kerning value or null if none found

getKerningByPair()

get the kerning values associated to a pair of character

  • Signature: public function getKerningByPair($ch1,$ch2,$use_font_size)
  • Parameters:
    • mixed $ch1
      the preceeding character
    • mixed $ch2
      the following character @param bool use_font_size default false --
  • $use_font_size
      • Default Value: false
  • Returns: numeric
    the kerning value or null if there is none found

getKerningGroup()

Get the kerning groups associated to a character

  • Signature: public function getKerningGroup($ch)
  • Parameters:
  • Returns: mixed
    the group

getKerningValue()

Return the (horizontal) kerning values for a pair of characters @params string $ch1 the left characcter @params string $ch2 the right character @param bool use_font_size default false --

  • Signature: public function getKerningValue($ch1,$ch2,$use_font_size)
  • Parameters:
  • $ch1
  • $ch2
  • $use_font_size
      • Default Value: false
  • Returns: float
    the kerning value or null if none is found

getLinegap()

get the line gap value

  • Signature: public function getLinegap()
  • Returns: numeric
    $linegap *

getStringWidth()

Caluclulate the length of a string

  • Signature: public function getStringWidth($string,$use_font_size)
  • Parameters:
    • string $string
      the string we wish to calculate the length of @param bool use_font_size default false --
  • $use_font_size
      • Default Value: false
  • Returns: float/int
    the length of the string

getTrackingValues()

Get the tracking values for the current font size

  • Signature: public function getTrackingValues()
  • Returns: array
    $values of floats. $values[0] is the minimum, $values[1] is the maximum or null if if there is no tracking values

getVariableStringWidth()

Function caluclulate the length of a variable width string

  • Signature: protected function getVariableStringWidth($string,$use_font_size)
  • Parameters:
    • string $string
      the string we wish to calculate the length of @param bool use_font_size default false --
  • $use_font_size
      • Default Value: false
  • Returns: float
    the length of the string

isFixedWidth()

Check to see if the current font is fixed width

  • Signature: public function isFixedWidth()
  • Returns: boolean
    true if it is fixed width

setAscender()

set the asceneder value

  • Signature: public function setAscender($ascender)
  • Parameters:

setBoundingBox()

Set the bounding box $param array $bbox of numeric. The bounding box in llx lly urx ury order

  • Signature: public function setBoundingBox($bbox)
  • Parameters:
  • $bbox

setCharacterHeight()

Sets the character height of a character

  • Signature: public function setCharacterHeight($ch,$h)
  • Parameters:

setCharacterInfo()

Sets information associated to a character

  • Signature: public function setCharacterInfo($ch,$key,$value)
  • Parameters:

setCharacterWidth()

Sets the character width of a character

  • Signature: public function setCharacterWidth($ch,$w)
  • Parameters:

setDescender()

set the desceneder value

  • Signature: public function setDescender($descender)
  • Parameters:

setDirection()

Function to set the font direction @params mixed $direction. -1 is global information, all other values are user defined directions.

  • Signature: public function setDirection($direction)
  • Parameters:
  • $direction

setFixedHeightSize()

set the fixed height character size

  • Signature: public function setFixedHeightSize($height)
  • Parameters:

setFixedWidth()

Set whether or not this is a fixed width font @parma boolean $is_fixed_width

  • Signature: public function setFixedWidth($is_fixed_width)
  • Parameters:
  • $is_fixed_width

setFixedWidthSize()

set the fixed width character size

  • Signature: public function setFixedWidthSize($width)
  • Parameters:

setFontCharacteristic()

Set a font characteristic

  • Signature: public function setFontCharacteristic($key,$value)
  • Parameters:

setFontSize()

Set the font size. This is global info. @params int $size

  • Signature: public function setFontSize($size)
  • Parameters:
  • $size

setGlobal()

Specify that we are working with global font metric information, e.g. glpyhnames, font size, etc.

  • Signature: public function setGlobal()

setKerningByGroup()

set the kerning values associated to a pair of groups

  • Signature: public function setKerningByGroup($g1,$g2,$kern)
  • Parameters:
    • mixed $g1
      the preceeding group
    • mixed $g2
      the following group @params numeric $kern the kerning value
  • $kern

setKerningByPair()

set the kerning values associated to a pair of character

  • Signature: public function setKerningByPair($ch1,$ch2,$kern)
  • Parameters:
    • mixed $ch1
      the preceeding character
    • mixed $ch2
      the following character @params numeric $kern the kerning value
  • $kern

setKerningGroup()

Set the kerning groups associated to a character

  • Signature: public function setKerningGroup($ch,$group)
  • Parameters:

setLinegap()

set the line gap value

  • Signature: public function setLinegap($linegap)
  • Parameters:

Inherited Variables

$character_widths

Theis public variable is inherited from I2CE_FontMetric->$character_widths

$character_heights

Theis public variable is inherited from I2CE_FontMetric->$character_heights

$character_info

Theis public variable is inherited from I2CE_FontMetric->$character_info

$bbox

Theis protected variable is inherited from I2CE_FontMetric->$bbox

$ascender

Theis protected variable is inherited from I2CE_FontMetric->$ascender

$descender

Theis protected variable is inherited from I2CE_FontMetric->$descender

$linegap

Theis protected variable is inherited from I2CE_FontMetric->$linegap

$is_fixed_width

Theis protected variable is inherited from I2CE_FontMetric->$is_fixed_width

$fixed_character_width

Theis protected variable is inherited from I2CE_FontMetric->$fixed_character_width

$fixed_character_height

Theis protected variable is inherited from I2CE_FontMetric->$fixed_character_height

$size

Theis protected variable is inherited from I2CE_FontMetric->$size

$encoding

Theis protected variable is inherited from I2CE_FontMetric->$encoding

$kerning_table_pairs

Theis protected variable is inherited from I2CE_FontMetric->$kerning_table_pairs

$kerning_table_groups

Theis protected variable is inherited from I2CE_FontMetric->$kerning_table_groups

$kerning_groups

Theis protected variable is inherited from I2CE_FontMetric->$kerning_groups

$font_info

Theis protected variable is inherited from I2CE_FontMetric->$font_info