Parser
in package
Pdf font parser class
Tags
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
$font
Font object
protected
AbstractFont|null
$font
= null
$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
getFont()
Get the font object
public
getFont() : AbstractFont|null
Return values
AbstractFont|nullgetFontDescIndex()
Get the font descriptor index
public
getFontDescIndex() : int|null
Return values
int|nullgetFontFileIndex()
Get the font file index
public
getFontFileIndex() : int|null
Return values
int|nullgetFontIndex()
Get the font index
public
getFontIndex() : int|null
Return values
int|nullgetFontName()
Method to get the font name.
public
getFontName() : string
Return values
stringgetFontObjectIndex()
Get the font object index
public
getFontObjectIndex() : int|null
Return values
int|nullgetFontReference()
Method to get the font reference.
public
getFontReference() : string
Return values
stringgetObjects()
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
boolisEmbeddable()
Method to get if the font is embeddable.
public
isEmbeddable() : bool
Return values
boolloadFromStream()
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
setCompression()
Set the compression
public
setCompression(bool $compression) : Parser
Parameters
- $compression : bool
Return values
ParsersetFontDescIndex()
Set the font descriptor index
public
setFontDescIndex(int $index) : Parser
Parameters
- $index : int
Return values
ParsersetFontFileIndex()
Set the font file index
public
setFontFileIndex(int $index) : Parser
Parameters
- $index : int
Return values
ParsersetFontIndex()
Set the font index
public
setFontIndex(int $index) : Parser
Parameters
- $index : int
Return values
ParsersetFontObjectIndex()
Set the font object index
public
setFontObjectIndex(int $index) : Parser
Parameters
- $index : int
Return values
ParsergetGlyphWidthsFromCmap()
Method to to get the glyph widths from the CMap
protected
getGlyphWidthsFromCmap(Cmap $cmap) : array<string|int, mixed>
Parameters
- $cmap : Cmap