PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.9
Yatra – Travel Booking & Tour Operator Software v3.0.9
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 / Header.php

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

113 lines 3.2 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 use Exception;
12 use FontLib\Font;
13
14 /**
15 * TrueType font file header.
16 *
17 * @package php-font-lib
18 *
19 * @property File $font
20 */
21 class Header extends \FontLib\Header {
22 protected $def = array(
23 "format" => self::uint32,
24 "numTables" => self::uint16,
25 "searchRange" => self::uint16,
26 "entrySelector" => self::uint16,
27 "rangeShift" => self::uint16,
28 );
29
30 public function parse() {
31 $font = $this->font;
32
33 $this->data = $font->unpack(array(
34 "EOTSize" => self::uint32,
35 "FontDataSize" => self::uint32,
36 "Version" => self::uint32,
37 "Flags" => self::uint32,
38 "FontPANOSE" => array(self::uint8, 10),
39 "Charset" => self::uint8,
40 "Italic" => self::uint8,
41 "Weight" => self::uint32,
42 "fsType" => self::uint16,
43 "MagicNumber" => self::uint16,
44 "UnicodeRange1" => self::uint32,
45 "UnicodeRange2" => self::uint32,
46 "UnicodeRange3" => self::uint32,
47 "UnicodeRange4" => self::uint32,
48 "CodePageRange1" => self::uint32,
49 "CodePageRange2" => self::uint32,
50 "CheckSumAdjustment" => self::uint32,
51 "Reserved1" => self::uint32,
52 "Reserved2" => self::uint32,
53 "Reserved3" => self::uint32,
54 "Reserved4" => self::uint32,
55 ));
56
57 $this->data["Padding1"] = $font->readUInt16();
58 $this->readString("FamilyName");
59
60 $this->data["Padding2"] = $font->readUInt16();
61 $this->readString("StyleName");
62
63 $this->data["Padding3"] = $font->readUInt16();
64 $this->readString("VersionName");
65
66 $this->data["Padding4"] = $font->readUInt16();
67 $this->readString("FullName");
68
69 switch ($this->data["Version"]) {
70 default:
71 throw new Exception("Unknown EOT version " . $this->data["Version"]);
72
73 case 0x00010000:
74 // Nothing to do more
75 break;
76
77 case 0x00020001:
78 $this->data["Padding5"] = $font->readUInt16();
79 $this->readString("RootString");
80 break;
81
82 case 0x00020002:
83 $this->data["Padding5"] = $font->readUInt16();
84 $this->readString("RootString");
85
86 $this->data["RootStringCheckSum"] = $font->readUInt32();
87 $this->data["EUDCCodePage"] = $font->readUInt32();
88
89 $this->data["Padding6"] = $font->readUInt16();
90 $this->readString("Signature");
91
92 $this->data["EUDCFlags"] = $font->readUInt32();
93 $this->data["EUDCFontSize"] = $font->readUInt32();
94 break;
95 }
96
97 if (!empty($this->data["RootString"])) {
98 $this->data["RootString"] = explode("\0", $this->data["RootString"]);
99 }
100 }
101
102 private function readString($name) {
103 $font = $this->font;
104 $size = $font->readUInt16();
105
106 $this->data["{$name}Size"] = $size;
107 $this->data[$name] = Font::UTF16ToUTF8($font->read($size));
108 }
109
110 public function encode() {
111 //return $this->font->pack($this->def, $this->data);
112 }
113 }