Debian Codegraph @

vendor/dompdf/php-font-lib/src/FontLib/Header.php

raw
1 <?php
2 /**
3 * @package php-font-lib
4 * @link https://github.com/dompdf/php-font-lib
5 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
6 */
7 namespace FontLib;
8
9 use FontLib\TrueType\File;
10
11 /**
12 * Font header container.
13 *
14 * @package php-font-lib
15 */
16 abstract class Header extends BinaryStream {
17 /**
18 * @var File
19 */
20 protected $font;
21 protected $def = array();
22
23 public $data;
24
25 public function __construct(File $font) {
26 $this->font = $font;
27 }
28
29 public function encode() {
30 return $this->font->pack($this->def, $this->data);
31 }
32
33 public function parse() {
34 $this->data = $this->font->unpack($this->def);
35 }
36 }