Documentation

Font
in package

Pdf font 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

Constants

ARIAL  = 'Arial'
Standard font constants
ARIAL_BOLD  = 'Arial,Bold'
ARIAL_BOLD_ITALIC  = 'Arial,BoldItalic'
ARIAL_ITALIC  = 'Arial,Italic'
COURIER  = 'Courier'
COURIER_BOLD  = 'Courier-Bold'
COURIER_BOLD_OBLIQUE  = 'Courier-BoldOblique'
COURIER_NEW  = 'CourierNew'
COURIER_NEW_BOLD  = 'CourierNew,Bold'
COURIER_NEW_BOLD_ITALIC  = 'CourierNew,BoldItalic'
COURIER_NEW_ITALIC  = 'CourierNew,Italic'
COURIER_OBLIQUE  = 'Courier-Oblique'
HELVETICA  = 'Helvetica'
HELVETICA_BOLD  = 'Helvetica-Bold'
HELVETICA_BOLD_OBLIQUE  = 'Helvetica-BoldOblique'
HELVETICA_OBLIQUE  = 'Helvetica-Oblique'
SYMBOL  = 'Symbol'
TIMES_BOLD  = 'Times-Bold'
TIMES_BOLD_ITALIC  = 'Times-BoldItalic'
TIMES_ITALIC  = 'Times-Italic'
TIMES_NEW_ROMAN  = 'TimesNewRoman'
TIMES_NEW_ROMAN_BOLD  = 'TimesNewRoman,Bold'
TIMES_NEW_ROMAN_BOLDITALIC  = 'TimesNewRoman,BoldItalic'
TIMES_NEW_ROMAN_ITALIC  = 'TimesNewRoman,Italic'
TIMES_ROMAN  = 'Times-Roman'
ZAPF_DINGBATS  = 'ZapfDingbats'

Properties

$font  : string|null
Font
$isEmbedded  : bool
Flag for an embedded font file
$isStandard  : bool
Flag for a standard font
$name  : string|null
Font name
$parser  : Parser|null
Font parser
$standardFonts  : array<string|int, mixed>
Standard PDF fonts

Methods

__construct()  : mixed
Constructor
getFont()  : string|null
Get font
getName()  : string|null
Get font name
getParsedFont()  : AbstractFont|null
Get the font parser
getStandardFonts()  : array<string|int, mixed>
Get available standard fonts
getStringWidth()  : mixed
Attempt to get string width
isEmbedded()  : bool
Determine if the font is an embedded font
isStandard()  : bool
Determine if the font is a standard font
parser()  : Parser|null
Get the font parser
setFont()  : Font
Set font
standardFonts()  : array<string|int, mixed>
Get standard PDF fonts in an array

Constants

ARIAL

Standard font constants

public mixed ARIAL = 'Arial'

ARIAL_BOLD

public mixed ARIAL_BOLD = 'Arial,Bold'

ARIAL_BOLD_ITALIC

public mixed ARIAL_BOLD_ITALIC = 'Arial,BoldItalic'

ARIAL_ITALIC

public mixed ARIAL_ITALIC = 'Arial,Italic'

COURIER

public mixed COURIER = 'Courier'

COURIER_BOLD

public mixed COURIER_BOLD = 'Courier-Bold'

COURIER_BOLD_OBLIQUE

public mixed COURIER_BOLD_OBLIQUE = 'Courier-BoldOblique'

COURIER_NEW

public mixed COURIER_NEW = 'CourierNew'

COURIER_NEW_BOLD

public mixed COURIER_NEW_BOLD = 'CourierNew,Bold'

COURIER_NEW_BOLD_ITALIC

public mixed COURIER_NEW_BOLD_ITALIC = 'CourierNew,BoldItalic'

COURIER_NEW_ITALIC

public mixed COURIER_NEW_ITALIC = 'CourierNew,Italic'

COURIER_OBLIQUE

public mixed COURIER_OBLIQUE = 'Courier-Oblique'

HELVETICA

public mixed HELVETICA = 'Helvetica'

HELVETICA_BOLD

public mixed HELVETICA_BOLD = 'Helvetica-Bold'

HELVETICA_BOLD_OBLIQUE

public mixed HELVETICA_BOLD_OBLIQUE = 'Helvetica-BoldOblique'

HELVETICA_OBLIQUE

public mixed HELVETICA_OBLIQUE = 'Helvetica-Oblique'

SYMBOL

public mixed SYMBOL = 'Symbol'

TIMES_BOLD

public mixed TIMES_BOLD = 'Times-Bold'

TIMES_BOLD_ITALIC

public mixed TIMES_BOLD_ITALIC = 'Times-BoldItalic'

TIMES_ITALIC

public mixed TIMES_ITALIC = 'Times-Italic'

TIMES_NEW_ROMAN

public mixed TIMES_NEW_ROMAN = 'TimesNewRoman'

TIMES_NEW_ROMAN_BOLD

public mixed TIMES_NEW_ROMAN_BOLD = 'TimesNewRoman,Bold'

TIMES_NEW_ROMAN_BOLDITALIC

public mixed TIMES_NEW_ROMAN_BOLDITALIC = 'TimesNewRoman,BoldItalic'

TIMES_NEW_ROMAN_ITALIC

public mixed TIMES_NEW_ROMAN_ITALIC = 'TimesNewRoman,Italic'

TIMES_ROMAN

public mixed TIMES_ROMAN = 'Times-Roman'

ZAPF_DINGBATS

public mixed ZAPF_DINGBATS = 'ZapfDingbats'

Properties

$font

Font

protected string|null $font = null

$isEmbedded

Flag for an embedded font file

protected bool $isEmbedded = false

$isStandard

Flag for a standard font

protected bool $isStandard = false

$name

Font name

protected string|null $name = null

$parser

Font parser

protected Parser|null $parser = null

$standardFonts

Standard PDF fonts

protected array<string|int, mixed> $standardFonts = ['Arial', 'Arial,Italic', 'Arial,Bold', 'Arial,BoldItalic', 'Courier', 'CourierNew', 'Courier-Oblique', 'CourierNew,Italic', 'Courier-Bold', 'CourierNew,Bold', 'Courier-BoldOblique', 'CourierNew,BoldItalic', 'Helvetica', 'Helvetica-Oblique', 'Helvetica-Bold', 'Helvetica-BoldOblique', 'Symbol', 'Times-Roman', 'Times-Bold', 'Times-Italic', 'Times-BoldItalic', 'TimesNewRoman', 'TimesNewRoman,Italic', 'TimesNewRoman,Bold', 'TimesNewRoman,BoldItalic', 'ZapfDingbats']

Methods

__construct()

Constructor

public __construct([string|null $font = null ]) : mixed

Instantiate a PDF font.

Parameters
$font : string|null = null

getFont()

Get font

public getFont() : string|null
Return values
string|null

getName()

Get font name

public getName() : string|null
Return values
string|null

getStandardFonts()

Get available standard fonts

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

getStringWidth()

Attempt to get string width

public getStringWidth(string $string, mixed $size) : mixed
Parameters
$string : string
$size : mixed
Tags
throws
Exception

isEmbedded()

Determine if the font is an embedded font

public isEmbedded() : bool
Return values
bool

isStandard()

Determine if the font is a standard font

public isStandard() : bool
Return values
bool

parser()

Get the font parser

public parser() : Parser|null
Return values
Parser|null

setFont()

Set font

public setFont(string $font) : Font
Parameters
$font : string
Tags
throws
InvalidArgumentException|Exception
Return values
Font

standardFonts()

Get standard PDF fonts in an array

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

        
On this page

Search results