Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Zend_Text_Figlet is a PHP implementation of FIGlet
SM_EQUAL = '0x01'
Smush2 layout modes
SM_LOWLINE = '0x02'
SM_HIERARCHY = '0x04'
SM_PAIR = '0x08'
SM_BIGX = '0x10'
SM_HARDBLANK = '0x20'
SM_KERN = '0x40'
SM_SMUSH = '0x80'
SMO_NO = '0'
Smush mode override modes
SMO_YES = '1'
SMO_FORCE = '2'
JUSTIFICATION_LEFT = '0'
Justifications
JUSTIFICATION_CENTER = '1'
JUSTIFICATION_RIGHT = '2'
DIRECTION_LEFT_TO_RIGHT = '0'
Write directions
DIRECTION_RIGHT_TO_LEFT = '1'
FONTFILE_MAGIC_NUMBER = 'flf2'
Magic fontfile number
integer $_charHeight = ''
Height of the characters
array $_charList = 'array'
Array containing all characters of the current font
array $_currentChar = 'null'
Current char
integer $_currentCharWidth = '0'
Current character width
boolean $_fontLoaded = 'false'
Indicates if a font was loaded yet
array $_fontOptions = 'array'
Options of the current font
integer $_fontSmush = '0'
Smush defined by the font
array $_germanChars = 'array'
Latin-1 codes for German letters, respectively:
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
boolean $_handleParagraphs = 'false'
Wether to handle paragraphs || not
string $_hardBlank = ''
Hard blank character
string $_inCharLine = ''
In character line
integer $_inCharLineLength = '0'
In character line length
integer $_inCharLineLengthLimit = '0'
Maximum in character line length
integer $_justification = 'null'
Justification for the text, according to $_outputWidth
For using font default, this parameter should be null, else one of the values of Zend_Text_Figlet::JUSTIFICATION_*
integer $_maxLength = ''
Max length of any character
integer $_outlineLength = '0'
Current outline length
integer $_outlineLengthLimit = '0'
Maxmimum outline length
string $_output = ''
Current output
array $_outputLine = ''
Current output line
integer $_outputWidth = '80'
Output width, defaults to 80.
integer $_previousCharWidth = '0'
Previous character width
integer $_rightToLeft = 'null'
Direction of text-writing, namely right to left
For using font default, this parameter should be null, else one of the values of Zend_Text_Figlet::DIRECTION_*
array $_skipOptions = 'array'
Option keys to skip when calling setOptions()
integer $_smushMode = '0'
Smush mode
integer $_smushOverride = '0'
Override font file smush layout
integer $_userSmush = '0'
Smush defined by the user
__construct(
array|Zend_Config $options
=
null
)
:
Instantiate the FIGlet with a specific font. 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.
_addChar(
string $char
)
:
boolean
Attempts to add the given character onto the end of the current line.
Returns true if this can be done, false otherwise.
_appendLine(
)
:
void
Appends the current line to the output
_clearLine(
)
:
void
Clears the current line
_getLetter(
string $char
)
:
void
Gets the requested character and sets current and previous char width.
_loadChar(
resource $fp
)
:
array
Load a single character from the font file
_loadFont(
string $fontFile
)
:
void
Load the specified font
_putString(
string $string
)
:
void
Puts the given string, substituting blanks for hardblanks. 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.
_readMagic(
resource $fp
)
:
string
Reads a four-character magic string from a stream
_setUsedSmush(
)
:
void
Set the used smush mode, according to smush override, user smsush and font smush.
_skipToEol(
resource $fp
)
:
void
Skip a stream to the end of line
_smushAmount(
)
:
integer
Returns the maximum amount that the current character can be smushed into the current line.
_smushem(
string $leftChar, string $rightChar
)
:
string
Given two characters, attempts to smush them into one, according to the current smushmode. 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
_splitLine(
)
:
void
Splits inCharLine at the last word break (bunch of consecutive blanks).
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
)
:
integer
Unicode compatible ord() method
render(
string $text, string $encoding
=
UTF-8
)
:
string
Render a FIGlet text
setConfig(
Zend_Config $config
)
:
Zend_Text_Figlet
Set options from config object
setFont(
string $font
)
:
Zend_Text_Figlet
Set a font to use
setHandleParagraphs(
boolean $handleParagraphs
)
:
Zend_Text_Figlet
Set handling of paragraphs
setJustification(
integer $justification
)
:
Zend_Text_Figlet
Set the justification. 0 stands for left aligned, 1 for centered and 2 for right aligned.
setOptions(
array $options
)
:
Zend_Text_Figlet
Set options from array
setOutputWidth(
integer $outputWidth
)
:
Zend_Text_Figlet
Set the output width
setRightToLeft(
integer $rightToLeft
)
:
Zend_Text_Figlet
Set right to left mode. 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.
setSmushMode(
integer $smushMode
)
:
Zend_Text_Figlet
Set the smush mode.
Use one of the constants of Zend_Text_Figlet::SM_*, you may combine them.