Documentation

SimpleDecoder
in package

Pdf extract simple font decoder class

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
6.0.0

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
string

buildSymbolTable()

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
string

detectFallbackEncoding()

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
Return values
string

        
On this page

Search results