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