FontInfo
in package
Pdf extract font info class
Tags
Table of Contents
Properties
- $cidToGidMap : mixed
- $embeddedFontBytes : string|null
- $encoding : mixed
- $isType0 : bool
- $toUnicodeCMap : array<string|int, mixed>|null
Methods
- __construct() : mixed
- Constructor
- resolve() : self|null
- Resolve a font dict (or reference to one) into a FontInfo value object
- extractFontFile2() : string|null
- Extract and decode a font descriptor's /FontFile2 embedded TrueType program
- parseCMapStream() : array<string|int, mixed>|null
- Decode and parse a CMap stream (e.g. /ToUnicode or an embedded /Encoding CMap)
- resolveSimple() : self
- Resolve a simple (non-Type0) font dict
- resolveType0() : self
- Resolve a Type0/CID composite font dict
Properties
$cidToGidMap read-only
public
mixed
$cidToGidMap
$embeddedFontBytes read-only
public
string|null
$embeddedFontBytes
$encoding read-only
public
mixed
$encoding
$isType0 read-only
public
bool
$isType0
$toUnicodeCMap read-only
public
array<string|int, mixed>|null
$toUnicodeCMap
Methods
__construct()
Constructor
public
__construct(bool $isType0, mixed $encoding, array<string|int, mixed>|null $toUnicodeCMap, mixed $cidToGidMap, string|null $embeddedFontBytes) : mixed
Instantiate a resolved font info value object.
Parameters
- $isType0 : bool
-
Whether this is a Type0/CID composite font
- $encoding : mixed
-
Name, Differences dict, or parsed embedded CMap array
- $toUnicodeCMap : array<string|int, mixed>|null
-
Parsed /ToUnicode CMap, null if absent
- $cidToGidMap : mixed
-
'Identity' marker string, or raw CIDToGIDMap stream bytes
- $embeddedFontBytes : string|null
-
Decoded /FontFile2 bytes, null if not embedded
resolve()
Resolve a font dict (or reference to one) into a FontInfo value object
public
static resolve(Document $doc, mixed $fontRef) : self|null
Parameters
- $doc : Document
- $fontRef : mixed
Return values
self|nullextractFontFile2()
Extract and decode a font descriptor's /FontFile2 embedded TrueType program
protected
static extractFontFile2(Document $doc, mixed $descriptor) : string|null
Parameters
- $doc : Document
- $descriptor : mixed
Return values
string|nullparseCMapStream()
Decode and parse a CMap stream (e.g. /ToUnicode or an embedded /Encoding CMap)
protected
static parseCMapStream(Document $doc, mixed $stream) : array<string|int, mixed>|null
Parameters
- $doc : Document
- $stream : mixed
Return values
array<string|int, mixed>|nullresolveSimple()
Resolve a simple (non-Type0) font dict
protected
static resolveSimple(Document $doc, array<string|int, mixed> $fontDict, array<string|int, mixed>|null $toUnicodeCMap) : self
Parameters
- $doc : Document
- $fontDict : array<string|int, mixed>
- $toUnicodeCMap : array<string|int, mixed>|null
Return values
selfresolveType0()
Resolve a Type0/CID composite font dict
protected
static resolveType0(Document $doc, array<string|int, mixed> $fontDict, array<string|int, mixed>|null $toUnicodeCMap) : self
Parameters
- $doc : Document
- $fontDict : array<string|int, mixed>
- $toUnicodeCMap : array<string|int, mixed>|null