Font_Table_kern

`kern` font table.

Defined (1)

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

/lib/dompdf/lib/php-font-lib/classes/Font_Table_kern.php  
  1. class Font_Table_kern extends Font_Table { 
  2. protected function _parse() { 
  3. $font = $this->getFont(); 
  4.  
  5. $data = $font->unpack(array( 
  6. "version" => self::uint16,  
  7. "nTables" => self::uint16,  
  8.  
  9. // only the first subtable will be parsed 
  10. "subtableVersion" => self::uint16,  
  11. "length" => self::uint16,  
  12. "coverage" => self::uint16,  
  13. )); 
  14.  
  15. $data["format"] = ($data["coverage"] >> 8); 
  16.  
  17. $subtable = array(); 
  18.  
  19. switch($data["format"]) { 
  20. case 0: 
  21. $subtable = $font->unpack(array( 
  22. "nPairs" => self::uint16,  
  23. "searchRange" => self::uint16,  
  24. "entrySelector" => self::uint16,  
  25. "rangeShift" => self::uint16,  
  26. )); 
  27.  
  28. $pairs = array(); 
  29. $tree = array(); 
  30.  
  31. for ($i = 0; $i < $subtable["nPairs"]; $i++) { 
  32. $left = $font->readUInt16(); 
  33. $right = $font->readUInt16(); 
  34. $value = $font->readInt16(); 
  35.  
  36. $pairs[] = array( 
  37. "left" => $left,  
  38. "right" => $right,  
  39. "value" => $value,  
  40. ); 
  41.  
  42. $tree[$left][$right] = $value; 
  43.  
  44. //$subtable["pairs"] = $pairs; 
  45. $subtable["tree"] = $tree; 
  46. break; 
  47.  
  48. case 1: 
  49. case 2: 
  50. case 3: 
  51. break; 
  52.  
  53. $data["subtable"] = $subtable; 
  54.  
  55. $this->data = $data;