phpdftk API Documentation

Type1Font extends Font
in package

Type 1 font (/Subtype /Type1).

Supports the 14 standard PDF fonts as well as custom Type 1 fonts.

Table of Contents

Constants

PDF_TYPE  = 'Font'

Properties

$baseFont  : PdfName|null
$encoding  : PdfReference|PdfName|null
$firstChar  : int|null
$fontDescriptor  : PdfReference|null
$generationNumber  : int
$lastChar  : int|null
$objectNumber  : int
$parsedFontData  : Type1Data|null
$subtype  : PdfName|null
$toUnicode  : PdfReference|null
$widths  : PdfArray|null

Methods

__construct()  : mixed
fromFile()  : self
Create a Type1Font from a PFB or PFA font file.
toIndirectObject()  : string
Wrap the object in an indirect object structure: X Y obj ... endobj
toPdf()  : string
Serialize the object's dictionary/value to PDF syntax.

Constants

PDF_TYPE

public mixed PDF_TYPE = 'Font'

Properties

$firstChar

public int|null $firstChar = null

$generationNumber

public int $generationNumber = 0

$lastChar

public int|null $lastChar = null

Methods

__construct()

public __construct(StandardFont|string $font[, bool $embedWidths = true ]) : mixed
Parameters
$font : StandardFont|string
$embedWidths : bool = true

fromFile()

Create a Type1Font from a PFB or PFA font file.

public static fromFile(string $path) : self

Parses the font program, extracts metrics and encoding, and prepares the font for embedding via PdfWriter.

Parameters
$path : string
Return values
self

toIndirectObject()

Wrap the object in an indirect object structure: X Y obj ... endobj

public toIndirectObject() : string
Return values
string

toPdf()

Serialize the object's dictionary/value to PDF syntax.

public toPdf() : string
Return values
string

        
On this page

Search results