Class: I2CE FontMetricMultiDirection: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 5: Line 5:
** [[Class: I2CE_FontMetricTTF | I2CE_FontMetricTTF]]
** [[Class: I2CE_FontMetricTTF | I2CE_FontMetricTTF]]
*Location: Part of the module [[TextLayout Tools Module List#textlayout|textlayout]] in the package [https://launchpad.net/textlayout TextLayout Tools]
*Location: Part of the module [[TextLayout Tools Module List#textlayout|textlayout]] in the package [https://launchpad.net/textlayout TextLayout Tools]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.1-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php lib/I2CE_FontMetricMultiDirection.php]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L23 lib/I2CE_FontMetricMultiDirection.php] on line 23
*Author: Carl Leitner <litlfred@ibiblio.org>
*Author: Carl Leitner <litlfred@ibiblio.org>
Class to contain information about  font metrics. Setup to handle multiple directions.
Class to contain information about  font metrics. Setup to handle multiple directions.
Line 11: Line 11:
===$font_metrics===
===$font_metrics===
protecteed @var array of I2CE_FontMetric $font_metrics contains the fonr metrics that are global or for  user defined directions
protecteed @var array of I2CE_FontMetric $font_metrics contains the fonr metrics that are global or for  user defined directions
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L29 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 29
*Type: protected $font_metrics
*Type: protected $font_metrics


===$direction===
===$direction===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L58 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 58
*Type: protected $direction
*Type: protected $direction


===$directions===
===$directions===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L63 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 63
*Type: protected $directions
*Type: protected $directions


Line 22: Line 25:
===__construct()===
===__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]
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]
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L39 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 39
*Signature: public function __construct($directions,$encoding)
*Signature: public function __construct($directions,$encoding)
*Parameters:
*Parameters:
Line 28: Line 32:
===getAllFontCharacteristics()===
===getAllFontCharacteristics()===
Get all the font information
Get all the font information
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L361 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 361
*Signature: public function getAllFontCharacteristics()
*Signature: public function getAllFontCharacteristics()
===getAscender()===
===getAscender()===
get the asceneder value
get the asceneder value
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L558 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 558
*Signature: public function getAscender()
*Signature: public function getAscender()
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ]<br/>$ascender *
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ]<br/>$ascender *
===getBoundingBox()===
===getBoundingBox()===
Get the bounding box $returns array $bbox of numeric. The bounding box in llx lly urx ury order
Get the bounding box $returns array $bbox of numeric. The bounding box in llx lly urx ury order
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L297 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 297
*Signature: public function getBoundingBox()
*Signature: public function getBoundingBox()
===getCharacterHeight()===
===getCharacterHeight()===
Gets the character height of a character
Gets the character height of a character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L186 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 186
*Signature: public function getCharacterHeight($ch,$use_font_size)
*Signature: public function getCharacterHeight($ch,$use_font_size)
*Parameters:
*Parameters:
Line 46: Line 54:
===getCharacterHeights()===
===getCharacterHeights()===
Get the character heights
Get the character heights
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L244 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 244
*Signature: public function getCharacterHeights()
*Signature: public function getCharacterHeights()
*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
*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
===getCharacterInfo()===
===getCharacterInfo()===
Get information associated to  a character
Get information associated to  a character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L130 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 130
*Signature: public function getCharacterInfo($ch,$key)
*Signature: public function getCharacterInfo($ch,$key)
*Parameters:
*Parameters:
Line 57: Line 67:
===getCharacterWidth()===
===getCharacterWidth()===
Gets the character width of a character
Gets the character width of a character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L172 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 172
*Signature: public function getCharacterWidth($ch,$use_font_size)
*Signature: public function getCharacterWidth($ch,$use_font_size)
*Parameters:
*Parameters:
Line 65: Line 76:
===getCharacterWidths()===
===getCharacterWidths()===
Get the character widths
Get the character widths
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L229 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 229
*Signature: public function getCharacterWidths()
*Signature: public function getCharacterWidths()
*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
*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
===getDescender()===
===getDescender()===
get the desceneder value
get the desceneder value
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L586 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 586
*Signature: public function getDescender()
*Signature: public function getDescender()
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ]<br/>$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
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L323 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 323
*Signature: public function getDirection()
*Signature: public function getDirection()
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php mixed ]
===getDirections()===
===getDirections()===
Function to get the possible directions
Function to get the possible directions
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L311 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 311
*Signature: public function getDirections($add_global)
*Signature: public function getDirections($add_global)
*Parameters:
*Parameters:
Line 84: Line 99:
===getEncoding()===
===getEncoding()===
Get the encoding information for the font. This is global info
Get the encoding information for the font. This is global info
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L533 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 533
*Signature: public function getEncoding()
*Signature: public function getEncoding()
*Returns: [[Class: I2CE_Encoding | I2CE_Encoding]]
*Returns: [[Class: I2CE_Encoding | I2CE_Encoding]]
===getFixedStringWidth()===
===getFixedStringWidth()===
Function caluclulate the length of a fixed width string
Function caluclulate the length of a fixed width string
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L102 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 102
*Signature: protected function getFixedStringWidth($string,$use_font_size)
*Signature: protected function getFixedStringWidth($string,$use_font_size)
*Parameters:
*Parameters:
Line 96: Line 113:
===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)
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L158 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 158
*Signature: public function getFixedWidth()
*Signature: public function getFixedWidth()
*Returns: number<br/>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 @param $key
Get a global font characteristic @param $key
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L349 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 349
*Signature: public function getFontCharacteristic($key)
*Signature: public function getFontCharacteristic($key)
*Parameters:
*Parameters:
Line 106: Line 125:
===getFontSize()===
===getFontSize()===
Get the font size.  This is global info.
Get the font size.  This is global info.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L638 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 638
*Signature: public function getFontSize()
*Signature: public function getFontSize()
*Returns: [http://www.php.net/manual/en/language.types.integer.php int ]
*Returns: [http://www.php.net/manual/en/language.types.integer.php int ]
===getKerningByGroup()===
===getKerningByGroup()===
get the kerning values associated to a pair of groups
get the kerning values associated to a pair of groups
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L461 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 461
*Signature: public function getKerningByGroup($g1,$g2,$use_font_size)
*Signature: public function getKerningByGroup($g1,$g2,$use_font_size)
*Parameters:
*Parameters:
Line 119: Line 140:
===getKerningByPair()===
===getKerningByPair()===
get the kerning values associated to a pair of character
get the kerning values associated to a pair of character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L435 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 435
*Signature: public function getKerningByPair($ch1,$ch2,$use_font_size)
*Signature: public function getKerningByPair($ch1,$ch2,$use_font_size)
*Parameters:
*Parameters:
Line 128: Line 150:
===getKerningGroup()===
===getKerningGroup()===
Get the kerning groups associated to a character
Get the kerning groups associated to a character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L406 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 406
*Signature: public function getKerningGroup($ch)
*Signature: public function getKerningGroup($ch)
*Parameters:
*Parameters:
Line 134: Line 157:
===getKerningValue()===
===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 --
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 --
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L379 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 379
*Signature: public function getKerningValue($ch1,$ch2,$use_font_size)
*Signature: public function getKerningValue($ch1,$ch2,$use_font_size)
*Parameters:
*Parameters:
Line 143: Line 167:
===getLinegap()===
===getLinegap()===
get the line gap value
get the line gap value
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L614 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 614
*Signature: public function getLinegap()
*Signature: public function getLinegap()
*Returns: [http://www.php.net/manual/en/language.pseudo-types.php numeric ]<br/>$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
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L72 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 72
*Signature: public function getStringWidth($string,$use_font_size)
*Signature: public function getStringWidth($string,$use_font_size)
*Parameters:
*Parameters:
Line 155: Line 181:
===getTrackingValues()===
===getTrackingValues()===
Get the tracking values for the current font size
Get the tracking values for the current font size
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L392 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 392
*Signature: public function getTrackingValues()
*Signature: public function getTrackingValues()
*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
*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
===getVariableStringWidth()===
===getVariableStringWidth()===
Function caluclulate the length of a variable width string
Function caluclulate the length of a variable width string
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L87 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 87
*Signature: protected function getVariableStringWidth($string,$use_font_size)
*Signature: protected function getVariableStringWidth($string,$use_font_size)
*Parameters:
*Parameters:
Line 167: Line 195:
===isFixedWidth()===
===isFixedWidth()===
Check to see if the current font is fixed width
Check to see if the current font is fixed width
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L114 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 114
*Signature: public function isFixedWidth()
*Signature: public function isFixedWidth()
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]<br/>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
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L542 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 542
*Signature: public function setAscender($ascender)
*Signature: public function setAscender($ascender)
*Parameters:
*Parameters:
Line 176: Line 206:
===setBoundingBox()===
===setBoundingBox()===
Set the bounding box $param array $bbox of numeric. The bounding box in llx lly urx ury order
Set the bounding box $param array $bbox of numeric. The bounding box in llx lly urx ury order
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L282 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 282
*Signature: public function setBoundingBox($bbox)
*Signature: public function setBoundingBox($bbox)
*Parameters:
*Parameters:
Line 181: Line 212:
===setCharacterHeight()===
===setCharacterHeight()===
Sets the character height of a character
Sets the character height of a character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L214 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 214
*Signature: public function setCharacterHeight($ch,$h)
*Signature: public function setCharacterHeight($ch,$h)
*Parameters:
*Parameters:
Line 187: Line 219:
===setCharacterInfo()===
===setCharacterInfo()===
Sets information associated to  a character
Sets information associated to  a character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L144 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 144
*Signature: public function setCharacterInfo($ch,$key,$value)
*Signature: public function setCharacterInfo($ch,$key,$value)
*Parameters:
*Parameters:
Line 194: Line 227:
===setCharacterWidth()===
===setCharacterWidth()===
Sets the character width of a character
Sets the character width of a character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L201 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 201
*Signature: public function setCharacterWidth($ch,$w)
*Signature: public function setCharacterWidth($ch,$w)
*Parameters:
*Parameters:
Line 200: Line 234:
===setDescender()===
===setDescender()===
set the desceneder value
set the desceneder value
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L570 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 570
*Signature: public function setDescender($descender)
*Signature: public function setDescender($descender)
*Parameters:
*Parameters:
Line 205: Line 240:
===setDirection()===
===setDirection()===
Function to set the font direction @params mixed $direction. -1 is global information, all other values are user defined directions.
Function to set the font direction @params mixed $direction. -1 is global information, all other values are user defined directions.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L257 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 257
*Signature: public function setDirection($direction)
*Signature: public function setDirection($direction)
*Parameters:
*Parameters:
Line 210: Line 246:
===setFixedHeightSize()===
===setFixedHeightSize()===
set the fixed height character size
set the fixed height character size
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L518 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 518
*Signature: public function setFixedHeightSize($height)
*Signature: public function setFixedHeightSize($height)
*Parameters:
*Parameters:
Line 215: Line 252:
===setFixedWidth()===
===setFixedWidth()===
Set whether or not this is a fixed width font @parma boolean $is_fixed_width
Set whether or not this is a fixed width font @parma boolean $is_fixed_width
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L487 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 487
*Signature: public function setFixedWidth($is_fixed_width)
*Signature: public function setFixedWidth($is_fixed_width)
*Parameters:
*Parameters:
Line 220: Line 258:
===setFixedWidthSize()===
===setFixedWidthSize()===
set the fixed width character size
set the fixed width character size
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L502 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 502
*Signature: public function setFixedWidthSize($width)
*Signature: public function setFixedWidthSize($width)
*Parameters:
*Parameters:
Line 225: Line 264:
===setFontCharacteristic()===
===setFontCharacteristic()===
Set a  font characteristic
Set a  font characteristic
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L333 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 333
*Signature: public function setFontCharacteristic($key,$value)
*Signature: public function setFontCharacteristic($key,$value)
*Parameters:
*Parameters:
Line 231: Line 271:
===setFontSize()===
===setFontSize()===
Set the font size.  This is global info. @params int $size
Set the font size.  This is global info. @params int $size
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L627 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 627
*Signature: public function setFontSize($size)
*Signature: public function setFontSize($size)
*Parameters:
*Parameters:
Line 236: Line 277:
===setGlobal()===
===setGlobal()===
Specify that we are working with global font metric information, e.g. glpyhnames, font size, etc.
Specify that we are working with global font metric information, e.g. glpyhnames, font size, etc.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L273 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 273
*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
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L471 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 471
*Signature: public function setKerningByGroup($g1,$g2,$kern)
*Signature: public function setKerningByGroup($g1,$g2,$kern)
*Parameters:
*Parameters:
Line 246: Line 289:
===setKerningByPair()===
===setKerningByPair()===
set the kerning values associated to a pair of character
set the kerning values associated to a pair of character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L444 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 444
*Signature: public function setKerningByPair($ch1,$ch2,$kern)
*Signature: public function setKerningByPair($ch1,$ch2,$kern)
*Parameters:
*Parameters:
Line 253: Line 297:
===setKerningGroup()===
===setKerningGroup()===
Set the kerning groups associated to a character
Set the kerning groups associated to a character
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L418 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 418
*Signature: public function setKerningGroup($ch,$group)
*Signature: public function setKerningGroup($ch,$group)
*Parameters:
*Parameters:
Line 259: Line 304:
===setLinegap()===
===setLinegap()===
set the line gap value
set the line gap value
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/textlayout/4.0.2-release/annotate/head:/lib/I2CE_FontMetricMultiDirection.php#L598 textlayout/lib/I2CE_FontMetricMultiDirection.php] on line 598
*Signature: public function setLinegap($linegap)
*Signature: public function setLinegap($linegap)
*Parameters:
*Parameters:

Revision as of 08:49, 10 November 2009

This article describes 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

$direction

$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]

  • Defined in textlayout/lib/I2CE_FontMetricMultiDirection.php on line 39
  • 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

getAscender()

get the asceneder value

getBoundingBox()

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

getCharacterHeight()

Gets the character height of a character

getCharacterHeights()

Get the character heights

  • Defined in textlayout/lib/I2CE_FontMetricMultiDirection.php on line 244
  • 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

getCharacterWidth()

Gets the character width of a character

getCharacterWidths()

Get the character widths

  • Defined in textlayout/lib/I2CE_FontMetricMultiDirection.php on line 229
  • 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

getDirection()

Function to get the font direction

getDirections()

Function to get the possible directions

  • Defined in textlayout/lib/I2CE_FontMetricMultiDirection.php on line 311
  • 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

  • Defined in textlayout/lib/I2CE_FontMetricMultiDirection.php on line 102
  • 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)

getFontCharacteristic()

Get a global font characteristic @param $key

getFontSize()

Get the font size. This is global info.

getKerningByGroup()

get the kerning values associated to a pair of groups

  • Defined in textlayout/lib/I2CE_FontMetricMultiDirection.php on line 461
  • 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

  • Defined in textlayout/lib/I2CE_FontMetricMultiDirection.php on line 435
  • 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

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 --

getLinegap()

get the line gap value

getStringWidth()

Caluclulate the length of a string

  • Defined in textlayout/lib/I2CE_FontMetricMultiDirection.php on line 72
  • 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

getVariableStringWidth()

Function caluclulate the length of a variable width string

  • Defined in textlayout/lib/I2CE_FontMetricMultiDirection.php on line 87
  • 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

setAscender()

set the asceneder value

setBoundingBox()

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

setCharacterHeight()

Sets the character height of a character

setCharacterInfo()

Sets information associated to a character

setCharacterWidth()

Sets the character width of a character

setDescender()

set the desceneder value

setDirection()

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

setFixedHeightSize()

set the fixed height character size

setFixedWidth()

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

setFixedWidthSize()

set the fixed width character size

setFontCharacteristic()

Set a font characteristic

setFontSize()

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

setGlobal()

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

setKerningByGroup()

set the kerning values associated to a pair of groups

setKerningByPair()

set the kerning values associated to a pair of character

setKerningGroup()

Set the kerning groups associated to a character

setLinegap()

set the line gap value

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