Documentation

Parser
in package

Pdf font parser class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

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

version
5.2.0

Table of Contents

Properties

$compression  : bool
Font compression flag
$font  : AbstractFont|null
Font object
$fontDescIndex  : int|null
Font descriptor index
$fontFileIndex  : int|null
Font file index
$fontIndex  : int|null
Font reference index
$fontObjectIndex  : int|null
Font object index
$objects  : array<string|int, mixed>
Font objects

Methods

__construct()  : mixed
Constructor
getFont()  : AbstractFont|null
Get the font object
getFontDescIndex()  : int|null
Get the font descriptor index
getFontFileIndex()  : int|null
Get the font file index
getFontIndex()  : int|null
Get the font index
getFontName()  : string
Method to get the font name.
getFontObjectIndex()  : int|null
Get the font object index
getFontReference()  : string
Method to get the font reference.
getObjects()  : array<string|int, mixed>
Get the font objects
isCompressed()  : bool
Get whether or not the font objects are compressed
isEmbeddable()  : bool
Method to get if the font is embeddable.
loadFromStream()  : void
Load font from stream
parse()  : void
Parse the font data and create the font objects
setCompression()  : Parser
Set the compression
setFontDescIndex()  : Parser
Set the font descriptor index
setFontFileIndex()  : Parser
Set the font file index
setFontIndex()  : Parser
Set the font index
setFontObjectIndex()  : Parser
Set the font object index
getGlyphWidthsFromCmap()  : array<string|int, mixed>
Method to to get the glyph widths from the CMap

Properties

$compression

Font compression flag

protected bool $compression = false

$fontDescIndex

Font descriptor index

protected int|null $fontDescIndex = null

$fontFileIndex

Font file index

protected int|null $fontFileIndex = null

$fontIndex

Font reference index

protected int|null $fontIndex = null

$fontObjectIndex

Font object index

protected int|null $fontObjectIndex = null

$objects

Font objects

protected array<string|int, mixed> $objects = []

Methods

__construct()

Constructor

public __construct(string $fontFile[, bool $compression = false ]) : mixed

Instantiate a font parser object

Parameters
$fontFile : string
$compression : bool = false
Tags
throws
Exception|Exception

getFontDescIndex()

Get the font descriptor index

public getFontDescIndex() : int|null
Return values
int|null

getFontFileIndex()

Get the font file index

public getFontFileIndex() : int|null
Return values
int|null

getFontIndex()

Get the font index

public getFontIndex() : int|null
Return values
int|null

getFontName()

Method to get the font name.

public getFontName() : string
Return values
string

getFontObjectIndex()

Get the font object index

public getFontObjectIndex() : int|null
Return values
int|null

getFontReference()

Method to get the font reference.

public getFontReference() : string
Return values
string

getObjects()

Get the font objects

public getObjects() : array<string|int, mixed>
Return values
array<string|int, mixed>

isCompressed()

Get whether or not the font objects are compressed

public isCompressed() : bool
Return values
bool

isEmbeddable()

Method to get if the font is embeddable.

public isEmbeddable() : bool
Return values
bool

loadFromStream()

Load font from stream

public static loadFromStream(string $stream) : void
Parameters
$stream : string

parse()

Parse the font data and create the font objects

public parse() : void
Tags
throws
Exception

setCompression()

Set the compression

public setCompression(bool $compression) : Parser
Parameters
$compression : bool
Return values
Parser

setFontDescIndex()

Set the font descriptor index

public setFontDescIndex(int $index) : Parser
Parameters
$index : int
Return values
Parser

setFontFileIndex()

Set the font file index

public setFontFileIndex(int $index) : Parser
Parameters
$index : int
Return values
Parser

setFontIndex()

Set the font index

public setFontIndex(int $index) : Parser
Parameters
$index : int
Return values
Parser

setFontObjectIndex()

Set the font object index

public setFontObjectIndex(int $index) : Parser
Parameters
$index : int
Return values
Parser

getGlyphWidthsFromCmap()

Method to to get the glyph widths from the CMap

protected getGlyphWidthsFromCmap(Cmap $cmap) : array<string|int, mixed>
Parameters
$cmap : Cmap
Return values
array<string|int, mixed>

        
On this page

Search results