PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.20
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.20
1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 All 164 releases
woocommerce-pos / vendor_prefixed / dompdf / php-font-lib / src / FontLib / EOT / Header.php

Header.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.20, at vendor_prefixed/dompdf/php-font-lib/src/FontLib/EOT/Header.php

71 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @package php-font-lib
5 * @link https://github.com/dompdf/php-font-lib
6 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
7 */
8 namespace WCPOS\Vendor\FontLib\EOT;
9
10 use Exception;
11 use WCPOS\Vendor\FontLib\Font;
12 /**
13 * TrueType font file header.
14 *
15 * @package php-font-lib
16 *
17 * @property File $font
18 */
19 class Header extends \WCPOS\Vendor\FontLib\Header
20 {
21 protected $def = array("format" => self::uint32, "numTables" => self::uint16, "searchRange" => self::uint16, "entrySelector" => self::uint16, "rangeShift" => self::uint16);
22 public function parse()
23 {
24 $font = $this->font;
25 $this->data = $font->unpack(array("EOTSize" => self::uint32, "FontDataSize" => self::uint32, "Version" => self::uint32, "Flags" => self::uint32, "FontPANOSE" => array(self::uint8, 10), "Charset" => self::uint8, "Italic" => self::uint8, "Weight" => self::uint32, "fsType" => self::uint16, "MagicNumber" => self::uint16, "UnicodeRange1" => self::uint32, "UnicodeRange2" => self::uint32, "UnicodeRange3" => self::uint32, "UnicodeRange4" => self::uint32, "CodePageRange1" => self::uint32, "CodePageRange2" => self::uint32, "CheckSumAdjustment" => self::uint32, "Reserved1" => self::uint32, "Reserved2" => self::uint32, "Reserved3" => self::uint32, "Reserved4" => self::uint32));
26 $this->data["Padding1"] = $font->readUInt16();
27 $this->readString("FamilyName");
28 $this->data["Padding2"] = $font->readUInt16();
29 $this->readString("StyleName");
30 $this->data["Padding3"] = $font->readUInt16();
31 $this->readString("VersionName");
32 $this->data["Padding4"] = $font->readUInt16();
33 $this->readString("FullName");
34 switch ($this->data["Version"]) {
35 default:
36 throw new Exception("Unknown EOT version " . $this->data["Version"]);
37 case 0x10000:
38 // Nothing to do more
39 break;
40 case 0x20001:
41 $this->data["Padding5"] = $font->readUInt16();
42 $this->readString("RootString");
43 break;
44 case 0x20002:
45 $this->data["Padding5"] = $font->readUInt16();
46 $this->readString("RootString");
47 $this->data["RootStringCheckSum"] = $font->readUInt32();
48 $this->data["EUDCCodePage"] = $font->readUInt32();
49 $this->data["Padding6"] = $font->readUInt16();
50 $this->readString("Signature");
51 $this->data["EUDCFlags"] = $font->readUInt32();
52 $this->data["EUDCFontSize"] = $font->readUInt32();
53 break;
54 }
55 if (!empty($this->data["RootString"])) {
56 $this->data["RootString"] = \explode("\x00", $this->data["RootString"]);
57 }
58 }
59 private function readString($name)
60 {
61 $font = $this->font;
62 $size = $font->readUInt16();
63 $this->data["{$name}Size"] = $size;
64 $this->data[$name] = Font::UTF16ToUTF8($font->read($size));
65 }
66 public function encode()
67 {
68 //return $this->font->pack($this->def, $this->data);
69 }
70 }
71