Encoding_Map

Encoding map used to map a code point to a Unicode char.

Defined (1)

The class is defined in the following location(s).

/lib/dompdf/lib/php-font-lib/classes/Encoding_Map.php  
  1. class Encoding_Map { 
  2. private $f; 
  3.  
  4. function __construct($file) { 
  5. $this->f = fopen($file, "r"); 
  6.  
  7. function parse() { 
  8. $map = array(); 
  9.  
  10. while($line = fgets($this->f)) { 
  11. if (preg_match("/^[\!\=]([0-9A-F]{2, })\s+U\+([0-9A-F]{2})([0-9A-F]{2})\s+([^\s]+)/", $line, $matches)) { 
  12. $unicode = (hexdec($matches[2]) << 8) + hexdec($matches[3]); 
  13. $map[hexdec($matches[1])] = array($unicode, $matches[4]); 
  14.  
  15. ksort($map); 
  16.  
  17. return $map;