SimpleDecoder
in package
Pdf extract simple font decoder class
Tags
Table of Contents
Properties
- $tableCache : WeakMap
- Per-FontInfo cache of built byte-to-Unicode tables
Methods
- decode() : string
- Decode a simple (non-Type0) font's raw byte string to Unicode text
- buildSymbolTable() : array<string|int, mixed>
- Build the Symbol font's byte-to-Unicode table
- buildTable() : array<string|int, mixed>
- Build a byte-to-Unicode table for a font, applying /Differences overrides
- codepointToUtf8() : string
- Convert a Unicode codepoint to a UTF-8 string
- detectFallbackEncoding() : string
- Guess a fallback encoding from an embedded font's own cmap table when /Encoding is absent
Properties
$tableCache
Per-FontInfo cache of built byte-to-Unicode tables
protected
static WeakMap
$tableCache
Methods
decode()
Decode a simple (non-Type0) font's raw byte string to Unicode text
public
static decode(string $rawBytes, FontInfo $info) : string
Parameters
- $rawBytes : string
- $info : FontInfo
Return values
stringbuildSymbolTable()
Build the Symbol font's byte-to-Unicode table
protected
static buildSymbolTable() : array<string|int, mixed>
Return values
array<string|int, mixed>buildTable()
Build a byte-to-Unicode table for a font, applying /Differences overrides
protected
static buildTable(FontInfo $info) : array<string|int, mixed>
Parameters
- $info : FontInfo
Return values
array<string|int, mixed>codepointToUtf8()
Convert a Unicode codepoint to a UTF-8 string
protected
static codepointToUtf8(int $codepoint) : string
Parameters
- $codepoint : int
Return values
stringdetectFallbackEncoding()
Guess a fallback encoding from an embedded font's own cmap table when /Encoding is absent
protected
static detectFallbackEncoding(string|null $embeddedFontBytes) : string
Parameters
- $embeddedFontBytes : string|null