__construct()
render()
setFont()
setHandleParagraphs()
setJustification()
setOptions()
setOutputWidth()
setRightToLeft()
setSmushMode()
_addChar()
_appendLine()
_clearLine()
_getLetter()
_loadChar()
_loadFont()
_putString()
_readMagic()
_setUsedSmush()
_skipToEol()
_smushAmount()
_smushem()
_splitLine()
_uniOrd()
$charHeight
$charList
$currentChar
$currentCharWidth
$fontLoaded
$fontOptions
$fontSmush
$germanChars
$handleParagraphs
$hardBlank
$inCharLine
$inCharLineLength
$inCharLineLengthLimit
$justification
$maxLength
$outlineLength
$outlineLengthLimit
$output
$outputLine
$outputWidth
$previousCharWidth
$rightToLeft
$skipOptions
$smushMode
$smushOverride
$userSmush
DIRECTION_LEFT_TO_RIGHT
DIRECTION_RIGHT_TO_LEFT
FONTFILE_MAGIC_NUMBER
JUSTIFICATION_CENTER
JUSTIFICATION_LEFT
JUSTIFICATION_RIGHT
SMO_FORCE
SMO_NO
SMO_YES
SM_BIGX
SM_EQUAL
SM_HARDBLANK
SM_HIERARCHY
SM_KERN
SM_LOWLINE
SM_PAIR
SM_SMUSH
Zend\Text\Figlet is a PHP implementation of FIGlet
__construct(array | \Traversable $options)
If no font is given, the standard font is used. You can also supply multiple options via the $options variable, which can either be an array or an instance of Zend\Config\Config.
array\Traversable
Options for the output
render(string $text, string $encoding) : string
string
Text to convert to a figlet text
string
Encoding of the input string
\Zend\Text\Figlet\Exception\InvalidArgumentException |
When $text is not a string |
---|---|
\Zend\Text\Figlet\Exception\UnexpectedValueException |
When $text it not properly encoded |
string
setHandleParagraphs(bool $handleParagraphs) : \Zend\Text\Figlet\Figlet
bool
Whether to handle paragraphs or not
setJustification(int $justification) : \Zend\Text\Figlet\Figlet
0 stands for left aligned, 1 for centered and 2 for right aligned.
int
Justification of the output text
setOutputWidth(int $outputWidth) : \Zend\Text\Figlet\Figlet
int
Output with which should be used for word wrapping and justification
setRightToLeft(int $rightToLeft) : \Zend\Text\Figlet\Figlet
For writing from left to right, use Zend\Text\Figlet::DIRECTION_LEFT_TO_RIGHT. For writing from right to left, use Zend\Text\Figlet::DIRECTION_RIGHT_TO_LEFT.
int
Right-to-left mode
setSmushMode(int $smushMode) : \Zend\Text\Figlet\Figlet
Use one of the constants of Zend\Text\Figlet::SM_*, you may combine them.
int
Smush mode to use for generating text
_addChar(string $char) : bool
Returns true if this can be done, false otherwise.
string
Character which to add to the output
bool
_appendLine() : void
_clearLine() : void
_getLetter(string $char) : void
string
The character from which to get the letter of
_loadChar(resource $fp) : array
resource
File pointer to the font file
array
_loadFont(string $fontFile) : void
string
Font file to load
\Zend\Text\Figlet\Exception\RuntimeException |
When font file was not found |
---|---|
\Zend\Text\Figlet\Exception\RuntimeException |
When GZIP library is required but not found |
\Zend\Text\Figlet\Exception\RuntimeException |
When font file is not readable |
\Zend\Text\Figlet\Exception\UnexpectedValueException |
When font file is not a FIGlet 2 font file |
_putString(string $string) : void
If outputWidth is 1, puts the entire string; otherwise puts at most outputWidth - 1 characters. Puts a newline at the end of the string. The string is left- justified, centered or right-justified (taking outputWidth as the screen width) if justification is 0, 1 or 2 respectively.
string
The string to add to the output
_readMagic(resource $fp) : string
resource
File pointer to the font file
string
_setUsedSmush() : void
_skipToEol(resource $fp) : void
resource
File pointer to the font file
_smushAmount() : int
int
_smushem(string $leftChar, string $rightChar) : string
Returns smushed character or false if no smushing can be done.
Smushmode values are sum of following (all values smush blanks):
1: Smush equal chars (not hardblanks) 2: Smush '_' with any char in hierarchy below 4: hierarchy: "|", "/\", "[]", "{}", "()", "<>" Each class in hier. can be replaced by later class. 8: [ + ] -> |, { + } -> |, ( + ) -> | 16: / + \ -> X, > + < -> X (only in that order) 32: hardblank + hardblank -> hardblank
string
Left character to smush
string
Right character to smush
string
_splitLine() : void
Makes a new line out of the first part and appends it using appendLine(). Makes a new line out of the second part and returns.
_uniOrd(string $c) : int
string
The char to get the value from
int
$charHeight : int
$charList : array
$currentChar : array
$currentCharWidth : int
$fontLoaded : bool
$fontOptions : array
$fontSmush : int
$germanChars : array
LATIN CAPITAL LETTER A WITH DIAERESIS = A-umlaut LATIN CAPITAL LETTER O WITH DIAERESIS = O-umlaut LATIN CAPITAL LETTER U WITH DIAERESIS = U-umlaut LATIN SMALL LETTER A WITH DIAERESIS = a-umlaut LATIN SMALL LETTER O WITH DIAERESIS = o-umlaut LATIN SMALL LETTER U WITH DIAERESIS = u-umlaut LATIN SMALL LETTER SHARP S = ess-zed
$handleParagraphs : bool
$hardBlank : string
$inCharLine : string
$inCharLineLength : int
$inCharLineLengthLimit : int
$justification : int
For using font default, this parameter should be null, else one of the values of Zend\Text\Figlet::JUSTIFICATION_*
$maxLength : int
$outlineLength : int
$outlineLengthLimit : int
$output : string
$outputLine : array
$outputWidth : int
$previousCharWidth : int
$rightToLeft : int
For using font default, this parameter should be null, else one of the values of Zend\Text\Figlet::DIRECTION_*
$skipOptions : array
$smushMode : int
$smushOverride : int
$userSmush : int
DIRECTION_LEFT_TO_RIGHT
DIRECTION_RIGHT_TO_LEFT
FONTFILE_MAGIC_NUMBER
JUSTIFICATION_CENTER
JUSTIFICATION_LEFT
JUSTIFICATION_RIGHT
SMO_FORCE
SMO_NO
SMO_YES
SM_BIGX
SM_EQUAL
SM_HARDBLANK
SM_HIERARCHY
SM_KERN
SM_LOWLINE
SM_PAIR
SM_SMUSH