phpdftk API Documentation

Type0FontFactory
in package

Factory that builds a complete Type 0 composite font stack from TrueType font data.

Produces the object graph: Type0Font (top-level) /Encoding /Identity-H /ToUnicode -> CMap stream (GID -> Unicode) /DescendantFonts [CIDFontType2] /CIDSystemInfo (Adobe-Identity-0) /FontDescriptor -> FontDescriptor /FontFile2 -> embedded font stream /DW (default width) /W (per-CID widths array) /CIDToGIDMap /Identity

Table of Contents

Methods

fromTrueTypeData()  : PdfStream, 6: array}
Build the complete Type 0 font stack from parsed TrueType data.

Methods

fromTrueTypeData()

Build the complete Type 0 font stack from parsed TrueType data.

public static fromTrueTypeData(TrueTypeData $data, array<string|int, int> $usedCodepoints[, bool $vertical = false ]) : PdfStream, 6: array}

The subsetter renumbers kept glyphs into a compact 0..N-1 range, so the returned unicodeToGidSubset map points at the post-subset GIDs that callers should emit in content streams. The /W widths and /ToUnicode CMap are likewise built against post-subset GIDs so the three views agree.

Parameters
$data : TrueTypeData

Parsed font data

$usedCodepoints : array<string|int, int>

Unicode codepoints used in the document

$vertical : bool = false

Use Identity-V encoding for vertical writing mode

Return values
PdfStream, 6: array}

        
On this page

Search results