Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
CffData
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
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
1<?php
2
3declare(strict_types=1);
4
5namespace Phpdftk\FontParser;
6
7/**
8 * Parsed CFF (Compact Font Format) table structure.
9 *
10 * Stores the parsed components of a CFF table for subsetting.
11 * Charstrings are stored as opaque byte arrays — no charstring
12 * interpretation is performed.
13 */
14readonly class CffData
15{
16    /**
17     * @param int      $major              CFF major version (always 1)
18     * @param int      $minor              CFF minor version
19     * @param int      $hdrSize            Header size in bytes
20     * @param string   $nameIndexData      Raw Name INDEX bytes
21     * @param array<int|string, int|float|array<int, int|float>> $topDictOperators Top DICT operator => operand(s)
22     * @param string   $stringIndexData    Raw String INDEX bytes
23     * @param string   $globalSubrIndexData Raw Global Subr INDEX bytes
24     * @param array<int, string> $charStrings GID => raw charstring bytes
25     * @param string   $privateDictData    Raw Private DICT bytes
26     * @param string   $localSubrIndexData Raw Local Subr INDEX bytes (may be empty)
27     * @param array<int, int> $charset     GID => SID/CID mapping (GID 0 = .notdef always)
28     * @param ?string  $fdArrayData        Raw FDArray INDEX bytes (CIDFont only)
29     * @param ?string  $fdSelectData       Raw FDSelect bytes (CIDFont only)
30     */
31    public function __construct(
32        public int $major,
33        public int $minor,
34        public int $hdrSize,
35        public string $nameIndexData,
36        public array $topDictOperators,
37        public string $stringIndexData,
38        public string $globalSubrIndexData,
39        public array $charStrings,
40        public string $privateDictData,
41        public string $localSubrIndexData,
42        public array $charset,
43        public ?string $fdArrayData = null,
44        public ?string $fdSelectData = null,
45    ) {}
46}