PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.2
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.2
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 1.9.14 All 163 releases
woocommerce-pos / vendor_prefixed / dompdf / php-font-lib / src / FontLib / Table / Table.php

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

84 lines 2.0 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\Table;
9
10 use WCPOS\Vendor\FontLib\TrueType\File;
11 use WCPOS\Vendor\FontLib\Font;
12 use WCPOS\Vendor\FontLib\BinaryStream;
13 /**
14 * Generic font table.
15 *
16 * @package php-font-lib
17 */
18 class Table extends BinaryStream
19 {
20 /**
21 * @var DirectoryEntry
22 */
23 protected $entry;
24 protected $def = array();
25 public $data;
26 public final function __construct(DirectoryEntry $entry)
27 {
28 $this->entry = $entry;
29 $entry->setTable($this);
30 }
31 /**
32 * @return File
33 */
34 public function getFont()
35 {
36 return $this->entry->getFont();
37 }
38 protected function _encode()
39 {
40 if (empty($this->data)) {
41 Font::d(" >> Table is empty");
42 return 0;
43 }
44 return $this->getFont()->pack($this->def, $this->data);
45 }
46 protected function _parse()
47 {
48 $this->data = $this->getFont()->unpack($this->def);
49 }
50 protected function _parseRaw()
51 {
52 $this->data = $this->getFont()->read($this->entry->length);
53 }
54 protected function _encodeRaw()
55 {
56 return $this->getFont()->write($this->data, $this->entry->length);
57 }
58 public function toHTML()
59 {
60 return "<pre>" . \var_export($this->data, \true) . "</pre>";
61 }
62 public final function encode()
63 {
64 $this->entry->startWrite();
65 if (\false && empty($this->def)) {
66 $length = $this->_encodeRaw();
67 } else {
68 $length = $this->_encode();
69 }
70 $this->entry->endWrite();
71 return $length;
72 }
73 public final function parse()
74 {
75 $this->entry->startRead();
76 if (\false && empty($this->def)) {
77 $this->_parseRaw();
78 } else {
79 $this->_parse();
80 }
81 $this->entry->endRead();
82 }
83 }
84