Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
OpenType
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
2 / 2
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 parseRequiredTables
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
2
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;
15
16use Pop\Pdf\Build\Font\Exception;
17
18/**
19 * OpenType font class
20 *
21 * @category   Pop
22 * @package    Pop\Pdf
23 * @author     Nick Sagona, III <dev@nolainteractive.com>
24 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
25 * @license    http://www.popphp.org/license     New BSD License
26 * @version    5.0.0
27 */
28class OpenType extends \Pop\Pdf\Build\Font\TrueType
29{
30
31    /**
32     * Constructor
33     *
34     * Instantiate a OpenType font file object based on a pre-existing font file on disk.
35     *
36     * @param  ?string $fontFile
37     * @param  ?string $fontStream
38     * @throws Exception|\Pop\Utils\Exception
39     */
40    public function __construct(?string $fontFile = null, ?string $fontStream = null)
41    {
42        parent::__construct($fontFile, $fontStream);
43    }
44
45    /**
46     * Method to parse the required tables of the OpenType font file.
47     *
48     * @return void
49     */
50    protected function parseRequiredTables(): void
51    {
52        // OS/2
53        if (isset($this->tableInfo['OS/2'])) {
54            $this->properties['tables']['OS/2'] = new Table\Os2($this);
55
56            $this->properties['flags']['isSerif']       = $this->properties['tables']['OS/2']['flags']['isSerif'];
57            $this->properties['flags']['isScript']      = $this->properties['tables']['OS/2']['flags']['isScript'];
58            $this->properties['flags']['isSymbolic']    = $this->properties['tables']['OS/2']['flags']['isSymbolic'];
59            $this->properties['flags']['isNonSymbolic'] = $this->properties['tables']['OS/2']['flags']['isNonSymbolic'];
60            $this->properties['capHeight']              = $this->properties['tables']['OS/2']['capHeight'];
61        }
62    }
63
64}