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