Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Maxp
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2declare(strict_types=1);
3/**
4 * Pop PHP Framework (https://www.popphp.org/)
5 *
6 * @link       https://github.com/popphp/popphp-framework
7 * @author     Nick Sagona, III <nick@popphp.org>
8 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Pdf\Build\Font\TrueType\Table;
16
17/**
18 * MAXP table class
19 *
20 * @category   Pop
21 * @package    Pop\Pdf
22 * @author     Nick Sagona, III <nick@popphp.org>
23 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
24 * @license    https://www.popphp.org/license     New BSD License
25 * @version    6.0.0
26 */
27class Maxp extends AbstractTable
28{
29
30    /**
31     * Font table properties
32     * @var array
33     */
34    protected array $properties = [
35        'numberOfGlyphs' => 0
36    ];
37
38    /**
39     * Constructor
40     *
41     * Instantiate a TTF 'maxp' table object.
42     *
43     * @param  \Pop\Pdf\Build\Font\TrueType $font
44     */
45    public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
46    {
47        $bytePos = $font->tableInfo['maxp']->offset + 4;
48        $ary     = unpack('nnumberOfGlyphs/', $font->read($bytePos, 2));
49        $this->properties['numberOfGlyphs'] = $ary['numberOfGlyphs'];
50    }
51
52}