Font

php\swing\Font

Constants


constant PLAIN
constant BOLD
constant ITALIC

Properties


property family

string

read-only

Family name of font

property fontName

string

read-only

property name

string

read-only

property psName

string

read-only

PostScript name of font

property size

int

read-only

property size2D

int

read-only

property style

int

read-only

property italicAngle

double

read-only

property attributes

string[]

read-only

property numGlyphs

int

read-only

Methods


__construct($name, $style, $size)
Parameters:
  • $namestring
  • $styleint - - PLAIN, BOLD, ITALIC
  • $sizeint
isBold()
Returns:bool
isItalic()
Returns:bool
isPlain()
Returns:bool
isTransformed()
Returns:bool
getBaselineFor($symbol)
Parameters:
  • $symbolstring - - one char
Returns:

int

canDisplay($symbol)
Parameters:
  • $symbolstring - - one char
Returns:

bool

canDisplayUpTo($string)

Indicates whether or not this Font can display a specified String.

Parameters:
  • $stringstring
Returns:

int - an offset into $string that points to the first character in $string that this

Font cannot display; or -1 if this Font can display all characters in $string.

static decode($str)

Decode font by using a specified string

Parameters:
  • $strstring
Returns:

php\swing\Font

static create($source, $trueType = true)

Create new font by using Stream or File

throws php\io\IOException

throws php\swing\\Exception

Parameters:
Returns:

php\swing\Font

static get($name)

Get font by name

Parameters:
  • $namestring
Returns:

php\swing\Font, null - return null if not exists