Без опису

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. * `hhea` font table.
  12. *
  13. * @package php-font-lib
  14. */
  15. class hhea extends Table {
  16. protected $def = array(
  17. "version" => self::Fixed,
  18. "ascent" => self::FWord,
  19. "descent" => self::FWord,
  20. "lineGap" => self::FWord,
  21. "advanceWidthMax" => self::uFWord,
  22. "minLeftSideBearing" => self::FWord,
  23. "minRightSideBearing" => self::FWord,
  24. "xMaxExtent" => self::FWord,
  25. "caretSlopeRise" => self::int16,
  26. "caretSlopeRun" => self::int16,
  27. "caretOffset" => self::FWord,
  28. self::int16,
  29. self::int16,
  30. self::int16,
  31. self::int16,
  32. "metricDataFormat" => self::int16,
  33. "numOfLongHorMetrics" => self::uint16,
  34. );
  35. function _encode() {
  36. $font = $this->getFont();
  37. $this->data["numOfLongHorMetrics"] = count($font->getSubset());
  38. return parent::_encode();
  39. }
  40. }