PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / vendor / phenx / php-font-lib / src / FontLib / EOT / File.php

File.php in Yatra – Travel Booking & Tour Operator Software 3.0.16, at vendor/phenx/php-font-lib/src/FontLib/EOT/File.php

160 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package php-font-lib
4 * @link https://github.com/dompdf/php-font-lib
5 * @author Fabien Ménager <[email protected]>
6 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
7 */
8
9 namespace FontLib\EOT;
10
11 /**
12 * EOT font file.
13 *
14 * @package php-font-lib
15 */
16 class File extends \FontLib\TrueType\File {
17 const TTEMBED_SUBSET = 0x00000001;
18 const TTEMBED_TTCOMPRESSED = 0x00000004;
19 const TTEMBED_FAILIFVARIATIONSIMULATED = 0x00000010;
20 const TTMBED_EMBEDEUDC = 0x00000020;
21 const TTEMBED_VALIDATIONTESTS = 0x00000040; // Deprecated
22 const TTEMBED_WEBOBJECT = 0x00000080;
23 const TTEMBED_XORENCRYPTDATA = 0x10000000;
24
25 /**
26 * @var Header
27 */
28 public $header;
29
30 function parseHeader() {
31 if (!empty($this->header)) {
32 return;
33 }
34
35 $this->header = new Header($this);
36 $this->header->parse();
37 }
38
39 function parse() {
40 $this->parseHeader();
41
42 $flags = $this->header->data["Flags"];
43
44 if ($flags & self::TTEMBED_TTCOMPRESSED) {
45 $mtx_version = $this->readUInt8();
46 $mtx_copy_limit = $this->readUInt8() << 16 | $this->readUInt8() << 8 | $this->readUInt8();
47 $mtx_offset_1 = $this->readUInt8() << 16 | $this->readUInt8() << 8 | $this->readUInt8();
48 $mtx_offset_2 = $this->readUInt8() << 16 | $this->readUInt8() << 8 | $this->readUInt8();
49 /*
50 var_dump("$mtx_version $mtx_copy_limit $mtx_offset_1 $mtx_offset_2");
51
52 $pos = $this->pos();
53 $size = $mtx_offset_1 - $pos;
54 var_dump("pos: $pos");
55 var_dump("size: $size");*/
56 }
57
58 if ($flags & self::TTEMBED_XORENCRYPTDATA) {
59 // Process XOR
60 }
61 // TODO Read font data ...
62 }
63
64 /**
65 * Little endian version of the read method
66 *
67 * @param int $n The number of bytes to read
68 *
69 * @return string
70 */
71 public function read($n) {
72 if ($n < 1) {
73 return "";
74 }
75
76 $string = (string) fread($this->f, $n);
77 $chunks = mb_str_split($string, 2, '8bit');
78 $chunks = array_map("strrev", $chunks);
79 return implode("", $chunks);
80 }
81
82 public function readUInt32() {
83 $uint32 = parent::readUInt32();
84
85 return $uint32 >> 16 & 0x0000FFFF | $uint32 << 16 & 0xFFFF0000;
86 }
87
88 /**
89 * Get font copyright
90 *
91 * @return string|null
92 */
93 function getFontCopyright() {
94 return null;
95 }
96
97 /**
98 * Get font name
99 *
100 * @return string|null
101 */
102 function getFontName() {
103 return $this->header->data["FamilyName"];
104 }
105
106 /**
107 * Get font subfamily
108 *
109 * @return string|null
110 */
111 function getFontSubfamily() {
112 return $this->header->data["StyleName"];
113 }
114
115 /**
116 * Get font subfamily ID
117 *
118 * @return string|null
119 */
120 function getFontSubfamilyID() {
121 return $this->header->data["StyleName"];
122 }
123
124 /**
125 * Get font full name
126 *
127 * @return string|null
128 */
129 function getFontFullName() {
130 return $this->header->data["FullName"];
131 }
132
133 /**
134 * Get font version
135 *
136 * @return string|null
137 */
138 function getFontVersion() {
139 return $this->header->data["VersionName"];
140 }
141
142 /**
143 * Get font weight
144 *
145 * @return string|null
146 */
147 function getFontWeight() {
148 return $this->header->data["Weight"];
149 }
150
151 /**
152 * Get font Postscript name
153 *
154 * @return string|null
155 */
156 function getFontPostscriptName() {
157 return null;
158 }
159 }
160