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
Details SM_LOWLINE = '0x02'
Details SM_HIERARCHY = '0x04'
Details SM_PAIR = '0x08'
Details SM_BIGX = '0x10'
Details SM_HARDBLANK = '0x20'
Details SM_KERN = '0x40'
Details SM_SMUSH = '0x80'
Details SMO_NO = '0'
Smush mode override modes
Details SMO_YES = '1'
Details SMO_FORCE = '2'
Details JUSTIFICATION_LEFT = '0'
Justifications
Details JUSTIFICATION_CENTER = '1'
Details JUSTIFICATION_RIGHT = '2'
Details DIRECTION_LEFT_TO_RIGHT = '0'
Write directions
Details DIRECTION_RIGHT_TO_LEFT = '1'
Details FONTFILE_MAGIC_NUMBER = 'flf2'
Magic fontfile number
Detailsinteger $_charHeight = ''Height of the characters
Detailsarray $_charList = 'array'Array containing all characters of the current font
Detailsarray $_currentChar = 'null'Current char
Detailsinteger $_currentCharWidth = '0'Current character width
Detailsboolean $_fontLoaded = 'false'Indicates if a font was loaded yet
Detailsarray $_fontOptions = 'array'Options of the current font
Detailsinteger $_fontSmush = '0'Smush defined by the font
Detailsarray $_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
Detailsboolean $_handleParagraphs = 'false'Wether to handle paragraphs || not
Detailsstring $_hardBlank = ''Hard blank character
Detailsstring $_inCharLine = ''In character line
Detailsinteger $_inCharLineLength = '0'In character line length
Detailsinteger $_inCharLineLengthLimit = '0'Maximum in character line length
Detailsinteger $_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_*
Detailsinteger $_maxLength = ''Max length of any character
Detailsinteger $_outlineLength = '0'Current outline length
Detailsinteger $_outlineLengthLimit = '0'Maxmimum outline length
Detailsstring $_output = ''Current output
Detailsarray $_outputLine = ''Current output line
Detailsinteger $_outputWidth = '80'Output width, defaults to 80.
Detailsinteger $_previousCharWidth = '0'Previous character width
Detailsinteger $_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_*
Detailsarray $_skipOptions = 'array'Option keys to skip when calling setOptions()
Detailsinteger $_smushMode = '0'Smush mode
Detailsinteger $_smushOverride = '0'Override font file smush layout
Detailsinteger $_userSmush = '0'Smush defined by the user
Details__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.
Details_addChar(
string $char
)
:
booleanAttempts to add the given character onto the end of the current line.
Returns true if this can be done, false otherwise.
Details_appendLine(
)
:
voidAppends the current line to the output
Details_clearLine(
)
:
voidClears the current line
Details_getLetter(
string $char
)
:
voidGets the requested character and sets current and previous char width.
Details_loadChar(
resource $fp
)
:
arrayLoad a single character from the font file
Details_loadFont(
string $fontFile
)
:
voidLoad the specified font
Details_putString(
string $string
)
:
voidPuts 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.
Details_readMagic(
resource $fp
)
:
stringReads a four-character magic string from a stream
Details_setUsedSmush(
)
:
voidSet the used smush mode, according to smush override, user smsush and font smush.
Details_skipToEol(
resource $fp
)
:
voidSkip a stream to the end of line
Details_smushAmount(
)
:
integerReturns the maximum amount that the current character can be smushed into the current line.
Details_smushem(
string $leftChar, string $rightChar
)
:
stringGiven 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
Details_splitLine(
)
:
voidSplits 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.
Details_uniOrd(
string $c
)
:
integerUnicode compatible ord() method
Detailsrender(
string $text, string $encoding
=
UTF-8
)
:
stringRender a FIGlet text
DetailssetConfig(
Zend_Config $config
)
:
Zend_Text_FigletSet options from config object
DetailssetFont(
string $font
)
:
Zend_Text_FigletSet a font to use
DetailssetHandleParagraphs(
boolean $handleParagraphs
)
:
Zend_Text_FigletSet handling of paragraphs
DetailssetJustification(
integer $justification
)
:
Zend_Text_FigletSet the justification. 0 stands for left aligned, 1 for centered and 2 for right aligned.
DetailssetOptions(
array $options
)
:
Zend_Text_FigletSet options from array
DetailssetOutputWidth(
integer $outputWidth
)
:
Zend_Text_FigletSet the output width
DetailssetRightToLeft(
integer $rightToLeft
)
:
Zend_Text_FigletSet 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.
DetailssetSmushMode(
integer $smushMode
)
:
Zend_Text_FigletSet the smush mode.
Use one of the constants of Zend_Text_Figlet::SM_*, you may combine them.
Details