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
2/**
3 * Pop PHP Framework (http://www.popphp.org/)
4 *
5 * @link       https://github.com/popphp/popphp-framework
6 * @author     Nick Sagona, III <dev@nolainteractive.com>
7 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
8 * @license    http://www.popphp.org/license     New BSD License
9 */
10
11/**
12 * @namespace
13 */
14namespace Pop\Pdf\Build\Font\TrueType\Table;
15
16/**
17 * MAXP table class
18 *
19 * @category   Pop
20 * @package    Pop\Pdf
21 * @author     Nick Sagona, III <dev@nolainteractive.com>
22 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
23 * @license    http://www.popphp.org/license     New BSD License
24 * @version    5.0.0
25 */
26class Maxp extends AbstractTable
27{
28
29    /**
30     * Font table properties
31     * @var array
32     */
33    protected array $properties = [
34        'numberOfGlyphs' => 0
35    ];
36
37    /**
38     * Constructor
39     *
40     * Instantiate a TTF 'maxp' table object.
41     *
42     * @param  \Pop\Pdf\Build\Font\TrueType $font
43     */
44    public function __construct(\Pop\Pdf\Build\Font\TrueType $font)
45    {
46        $bytePos = $font->tableInfo['maxp']->offset + 4;
47        $ary     = unpack('nnumberOfGlyphs/', $font->read($bytePos, 2));
48        $this->properties['numberOfGlyphs'] = $ary['numberOfGlyphs'];
49    }
50
51}