暫無描述

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