Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Post
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
7 / 7
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 * POST 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 Post extends AbstractTable
27{
28
29    /**
30     * Font table properties
31     * @var array
32     */
33    protected array $properties = [
34        'italicAngle' => 0,
35        'fixed'       => 0
36    ];
37
38    /**
39     * Constructor
40     *
41     * Instantiate a TTF 'post' 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['post']->offset + 4;
48
49        $italicBytes  = $font->read($bytePos, 4);
50        $this->properties['italicAngle'] = $font->readFixed(16, 16, $italicBytes);
51
52        $bytePos += 8;
53
54        $ary = unpack('nfixed/', $font->read($bytePos, 2));
55        $ary = $font->shiftToSigned($ary);
56        $this->properties['fixed'] = $ary['fixed'];
57    }
58
59}