Font_EOT

EOT font file.

Defined (1)

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

/lib/dompdf/lib/php-font-lib/classes/Font_EOT.php  
  1. class Font_EOT extends Font_TrueType { 
  2. const TTEMBED_SUBSET = 0x00000001; 
  3. const TTEMBED_TTCOMPRESSED = 0x00000004; 
  4. const TTEMBED_FAILIFVARIATIONSIMULATED = 0x00000010; 
  5. const TTMBED_EMBEDEUDC = 0x00000020; 
  6. const TTEMBED_VALIDATIONTESTS = 0x00000040; // Deprecated 
  7. const TTEMBED_WEBOBJECT = 0x00000080; 
  8. const TTEMBED_XORENCRYPTDATA = 0x10000000; 
  9.  
  10. /** 
  11. * @var Font_EOT_Header 
  12. */ 
  13. public $header; 
  14.  
  15. function parseHeader() { 
  16. if (!empty($this->header)) { 
  17. return; 
  18.  
  19. $this->header = new Font_EOT_Header($this); 
  20. $this->header->parse(); 
  21.  
  22. function parse() { 
  23. $this->parseHeader(); 
  24.  
  25. $flags = $this->header->data["Flags"]; 
  26.  
  27. if ($flags & self::TTEMBED_TTCOMPRESSED) { 
  28. $mtx_version = $this->readUInt8(); 
  29. $mtx_copy_limit = $this->readUInt8() << 16 | $this->readUInt8() << 8 | $this->readUInt8(); 
  30. $mtx_offset_1 = $this->readUInt8() << 16 | $this->readUInt8() << 8 | $this->readUInt8(); 
  31. $mtx_offset_2 = $this->readUInt8() << 16 | $this->readUInt8() << 8 | $this->readUInt8(); 
  32.  
  33. /** 
  34. var_dump("$mtx_version $mtx_copy_limit $mtx_offset_1 $mtx_offset_2"); 
  35.   
  36. $pos = $this->pos(); 
  37. $size = $mtx_offset_1 - $pos; 
  38. var_dump("pos: $pos"); 
  39. var_dump("size: $size");*/ 
  40.  
  41. if ($flags & self::TTEMBED_XORENCRYPTDATA) { 
  42. // Process XOR 
  43.  
  44. // TODO Read font data ... 
  45.  
  46. /** 
  47. * Little endian version of the read method 
  48. */ 
  49. public function read($n) { 
  50. if ($n < 1) { 
  51. return ""; 
  52.  
  53. $string = fread($this->f, $n); 
  54. $chunks = str_split($string, 2); 
  55. $chunks = array_map("strrev", $chunks); 
  56.  
  57. return implode("", $chunks); 
  58.  
  59. public function readUInt32() { 
  60. $uint32 = parent::readUInt32(); 
  61. return $uint32 >> 16 & 0x0000FFFF | $uint32 << 16 & 0xFFFF0000; 
  62.  
  63. /** 
  64. * Get font copyright 
  65. * @return string|null 
  66. */ 
  67. function getFontCopyright() { 
  68. return null; 
  69.  
  70. /** 
  71. * Get font name 
  72. * @return string|null 
  73. */ 
  74. function getFontName() { 
  75. return $this->header->data["FamilyName"]; 
  76.  
  77. /** 
  78. * Get font subfamily 
  79. * @return string|null 
  80. */ 
  81. function getFontSubfamily() { 
  82. return $this->header->data["StyleName"]; 
  83.  
  84. /** 
  85. * Get font subfamily ID 
  86. * @return string|null 
  87. */ 
  88. function getFontSubfamilyID() { 
  89. return $this->header->data["StyleName"]; 
  90.  
  91. /** 
  92. * Get font full name 
  93. * @return string|null 
  94. */ 
  95. function getFontFullName() { 
  96. return $this->header->data["FullName"]; 
  97.  
  98. /** 
  99. * Get font version 
  100. * @return string|null 
  101. */ 
  102. function getFontVersion() { 
  103. return $this->header->data["VersionName"]; 
  104.  
  105. /** 
  106. * Get font weight 
  107. * @return string|null 
  108. */ 
  109. function getFontWeight() { 
  110. return $this->header->data["Weight"]; 
  111.  
  112. /** 
  113. * Get font Postscript name 
  114. * @return string|null 
  115. */ 
  116. function getFontPostscriptName() { 
  117. return null;