EOT
3 years ago
Exception
3 years ago
Glyph
3 years ago
OpenType
3 years ago
Table
3 years ago
TrueType
3 years ago
WOFF
3 years ago
AdobeFontMetrics.php
3 years ago
Autoloader.php
3 years ago
BinaryStream.php
3 years ago
EncodingMap.php
3 years ago
Font.php
3 years ago
Header.php
3 years ago
Header.php
38 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @package php-font-lib |
| 5 | * @link https://github.com/PhenX/php-font-lib |
| 6 | * @author Fabien Ménager <fabien.menager@gmail.com> |
| 7 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License |
| 8 | */ |
| 9 | namespace IAWP\FontLib; |
| 10 | |
| 11 | use IAWP\FontLib\TrueType\File; |
| 12 | /** |
| 13 | * Font header container. |
| 14 | * |
| 15 | * @package php-font-lib |
| 16 | */ |
| 17 | abstract class Header extends BinaryStream |
| 18 | { |
| 19 | /** |
| 20 | * @var File |
| 21 | */ |
| 22 | protected $font; |
| 23 | protected $def = array(); |
| 24 | public $data; |
| 25 | public function __construct(File $font) |
| 26 | { |
| 27 | $this->font = $font; |
| 28 | } |
| 29 | public function encode() |
| 30 | { |
| 31 | return $this->font->pack($this->def, $this->data); |
| 32 | } |
| 33 | public function parse() |
| 34 | { |
| 35 | $this->data = $this->font->unpack($this->def); |
| 36 | } |
| 37 | } |
| 38 |