Class: I2CE Encoding (4.0.5)
This article describes the class I2CE_Encoding .
- Location: Part of the module textlayout in the package TextLayout Tools 4.0.5-release
- Source: Defined in the file lib/I2CE_Encoding.php on line 10
helper library to store/look-up glyphnames associated to a character code.
Variables
$glyph_names
protected @var $glyph_names an array of arrays with values glyph names and keys unicode codepoints the first index of the array is the encoding type
- Defined in textlayout/lib/I2CE_Encoding.php on line 17
- Type: protected $glyph_names
$encoding
- Defined in textlayout/lib/I2CE_Encoding.php on line 23
- Type: protected $encoding
$mb_encoding
protected @var string $unicode_encoding
- Defined in textlayout/lib/I2CE_Encoding.php on line 28
- Type: protected $mb_encoding
$useMB
- Defined in textlayout/lib/I2CE_Encoding.php on line 59
- Type: protected $useMB
$fix
Some common incorrect glyph names
- Defined in textlayout/lib/I2CE_Encoding.php on line 194
- Type: static public fix $fix
Methods
UnicodeFromCharactercode()
get the multibyte character associated to a character code
- Defined in textlayout/lib/I2CE_Encoding.php on line 100
- Signature: public function UnicodeFromCharactercode($cc)
- Parameters:
- int $cc
the character code
- int $cc
- Returns: int
unicode codepoint
UnicodeFromGlyphname()
get the multibyte character associated to a glyphname
- Defined in textlayout/lib/I2CE_Encoding.php on line 86
- Signature: public function UnicodeFromGlyphname($gn)
- Parameters:
- string $gn
the glyp hname
- string $gn
- Returns: string
n character in the selected encoding
UnicodeToCharacterCode()
get the character code to a unicode codepoint
- Defined in textlayout/lib/I2CE_Encoding.php on line 108
- Signature: public function UnicodeToCharacterCode($in)
- Parameters:
- mixed $in
UnicodeToGlyphname()
get the glpyh name associated to to a unicode codepoint
- Defined in textlayout/lib/I2CE_Encoding.php on line 116
- Signature: public function UnicodeToGlyphname($in)
- Parameters:
- mixed $in
__construct()
@param string $encoding_type -- set to the encoding used needs to be one of PHP multibyte strings encodings
- Defined in textlayout/lib/I2CE_Encoding.php on line 35
- Signature: public function __construct($mb_encoding)
- Parameters:
- $mb_encoding
changeGlyphNames()
Change the glyph names @param $names an associative array with the new value being the value and the old value being the key
- Defined in textlayout/lib/I2CE_Encoding.php on line 173
- Signature: public function changeGlyphNames($names)
- Parameters:
- $names
fixEuro()
Make sure U+20AC has the glyphname euro if it exists in this encoding
- Defined in textlayout/lib/I2CE_Encoding.php on line 187
- Signature: public function fixEuro()
getEncodingType()
Get the unicode encoding to use
- Defined in textlayout/lib/I2CE_Encoding.php on line 74
- Signature: public function getEncodingType()
- Returns: string
$encoding with values:
readMap()
Read in a character encoding from a file
- Defined in textlayout/lib/I2CE_Encoding.php on line 148
- Signature: public function readMap($enc_file)
- Parameters:
- string $enc_file
the file containing the character encoded exmaples are cp1250.map ISO-8859-1.map etc. this function has been graciously stolen from makefont.php
- string $enc_file
setCharacterCode()
Set the character code assoicated to a unicode code point
- Defined in textlayout/lib/I2CE_Encoding.php on line 136
- Signature: public function setCharacterCode($cp,$cc)
- Parameters:
setEncodingType()
- Defined in textlayout/lib/I2CE_Encoding.php on line 44
- Signature: protected function setEncodingType($mb_encoding)
- Parameters:
- $mb_encoding
setGlyphname()
Set the gylph name of a character
- Defined in textlayout/lib/I2CE_Encoding.php on line 127
- Signature: public function setGlyphname($cp,$gn)
- Parameters:
useMB()
- Defined in textlayout/lib/I2CE_Encoding.php on line 65
- Signature: public function useMB()