暂无描述

maxp.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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\Table\Type;
  9. use FontLib\Table\Table;
  10. /**
  11. * `maxp` font table.
  12. *
  13. * @package php-font-lib
  14. */
  15. class maxp extends Table {
  16. protected $def = array(
  17. "version" => self::Fixed,
  18. "numGlyphs" => self::uint16,
  19. "maxPoints" => self::uint16,
  20. "maxContours" => self::uint16,
  21. "maxComponentPoints" => self::uint16,
  22. "maxComponentContours" => self::uint16,
  23. "maxZones" => self::uint16,
  24. "maxTwilightPoints" => self::uint16,
  25. "maxStorage" => self::uint16,
  26. "maxFunctionDefs" => self::uint16,
  27. "maxInstructionDefs" => self::uint16,
  28. "maxStackElements" => self::uint16,
  29. "maxSizeOfInstructions" => self::uint16,
  30. "maxComponentElements" => self::uint16,
  31. "maxComponentDepth" => self::uint16,
  32. );
  33. function _encode() {
  34. $font = $this->getFont();
  35. $this->data["numGlyphs"] = count($font->getSubset());
  36. return parent::_encode();
  37. }
  38. }