Zend Framework
1.12
|
Public Member Functions | |
__construct ($options=null) | |
Instantiate the FIGlet with a specific font. | |
setOptions (array $options) | |
Set options from array. | |
setConfig (Zend_Config $config) | |
Set options from config object. | |
setFont ($font) | |
Set a font to use. | |
setHandleParagraphs ($handleParagraphs) | |
Set handling of paragraphs. | |
setJustification ($justification) | |
Set the justification. | |
setOutputWidth ($outputWidth) | |
Set the output width. | |
setRightToLeft ($rightToLeft) | |
Set right to left mode. | |
setSmushMode ($smushMode) | |
Set the smush mode. | |
render ($text, $encoding= 'UTF-8') | |
Render a FIGlet text. | |
Public Attributes | |
const | SM_EQUAL = 0x01 |
Smush2 layout modes. | |
const | SM_LOWLINE = 0x02 |
const | SM_HIERARCHY = 0x04 |
const | SM_PAIR = 0x08 |
const | SM_BIGX = 0x10 |
const | SM_HARDBLANK = 0x20 |
const | SM_KERN = 0x40 |
const | SM_SMUSH = 0x80 |
const | SMO_NO = 0 |
Smush mode override modes. | |
const | SMO_YES = 1 |
const | SMO_FORCE = 2 |
const | JUSTIFICATION_LEFT = 0 |
Justifications. | |
const | JUSTIFICATION_CENTER = 1 |
const | JUSTIFICATION_RIGHT = 2 |
const | DIRECTION_LEFT_TO_RIGHT = 0 |
Write directions. | |
const | DIRECTION_RIGHT_TO_LEFT = 1 |
const | FONTFILE_MAGIC_NUMBER = 'flf2' |
Magic fontfile number. | |
Protected Member Functions | |
_putString ($string) | |
Puts the given string, substituting blanks for hardblanks. | |
_appendLine () | |
Appends the current line to the output. | |
_splitLine () | |
Splits inCharLine at the last word break (bunch of consecutive blanks). | |
_clearLine () | |
Clears the current line. | |
_addChar ($char) | |
Attempts to add the given character onto the end of the current line. | |
_getLetter ($char) | |
Gets the requested character and sets current and previous char width. | |
_smushAmount () | |
Returns the maximum amount that the current character can be smushed into the current line. | |
_smushem ($leftChar, $rightChar) | |
Given two characters, attempts to smush them into one, according to the current smushmode. | |
_loadFont ($fontFile) | |
Load the specified font. | |
_setUsedSmush () | |
Set the used smush mode, according to smush override, user smsush and font smush. | |
_readMagic ($fp) | |
Reads a four-character magic string from a stream. | |
_skipToEol ($fp) | |
Skip a stream to the end of line. | |
_loadChar ($fp) | |
Load a single character from the font file. | |
_uniOrd ($c) | |
Unicode compatible ord() method. | |
Protected Attributes | |
$_charList = array() | |
$_fontLoaded = false | |
$_germanChars = array(196, 214, 220, 228, 246, 252, 223) | |
$_outputWidth = 80 | |
$_hardBlank | |
$_charHeight | |
$_maxLength | |
$_smushMode = 0 | |
$_fontSmush = 0 | |
$_userSmush = 0 | |
$_handleParagraphs = false | |
$_justification = null | |
$_rightToLeft = null | |
$_smushOverride = 0 | |
$_fontOptions = array() | |
$_previousCharWidth = 0 | |
$_currentCharWidth = 0 | |
$_outlineLength = 0 | |
$_outlineLengthLimit = 0 | |
$_inCharLine | |
$_inCharLineLength = 0 | |
$_inCharLineLengthLimit = 0 | |
$_currentChar = null | |
$_outputLine | |
$_output | |
$_skipOptions | |
__construct | ( | $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.
array | Zend_Config | $options | Options for the output |
|
protected |
Attempts to add the given character onto the end of the current line.
Returns true if this can be done, false otherwise.
string | $char | Character which to add to the output |
|
protected |
Appends the current line to the output.
|
protected |
Clears the current line.
|
protected |
Gets the requested character and sets current and previous char width.
string | $char | The character from which to get the letter of |
|
protected |
Load a single character from the font file.
resource | $fp | File pointer to the font file |
|
protected |
Load the specified font.
string | $fontFile | Font file to load |
Zend_Text_Figlet_Exception | When font file was not found |
Zend_Text_Figlet_Exception | When GZIP library is required but not found |
Zend_Text_Figlet_Exception | When font file is not readable |
|
protected |
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.
string | $string | The string to add to the output |
|
protected |
Reads a four-character magic string from a stream.
resource | $fp | File pointer to the font file |
|
protected |
Set the used smush mode, according to smush override, user smsush and font smush.
|
protected |
Skip a stream to the end of line.
resource | $fp | File pointer to the font file |
|
protected |
Returns the maximum amount that the current character can be smushed into the current line.
|
protected |
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
string | $leftChar | Left character to smush |
string | $rightChar | Right character to smush |
|
protected |
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.
|
protected |
Unicode compatible ord() method.
string | $c | The char to get the value from |
render | ( | $text, | |
$encoding = 'UTF-8' |
|||
) |
Render a FIGlet text.
string | $text | Text to convert to a figlet text |
string | $encoding | Encoding of the input string |
InvalidArgumentException | When $text is not a string |
Zend_Text_Figlet_Exception | When $text it not properly encoded |
setConfig | ( | Zend_Config | $config | ) |
Set options from config object.
Zend_Config | $config | Configuration for Zend_Text_Figlet |
setFont | ( | $font | ) |
setHandleParagraphs | ( | $handleParagraphs | ) |
Set handling of paragraphs.
boolean | $handleParagraphs | Wether to handle paragraphs or not |
setJustification | ( | $justification | ) |
Set the justification.
0 stands for left aligned, 1 for centered and 2 for right aligned.
integer | $justification | Justification of the output text |
setOptions | ( | array | $options | ) |
Set options from array.
array | $options | Configuration for Zend_Text_Figlet |
setOutputWidth | ( | $outputWidth | ) |
Set the output width.
integer | $outputWidth | Output with which should be used for word wrapping and justification |
setRightToLeft | ( | $rightToLeft | ) |
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.
integer | $rightToLeft | Right-to-left mode |
setSmushMode | ( | $smushMode | ) |
Set the smush mode.
Use one of the constants of Zend_Text_Figlet::SM_*, you may combine them.
integer | $smushMode | Smush mode to use for generating text |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
const DIRECTION_LEFT_TO_RIGHT = 0 |
Write directions.
const DIRECTION_RIGHT_TO_LEFT = 1 |
const FONTFILE_MAGIC_NUMBER = 'flf2' |
Magic fontfile number.
const JUSTIFICATION_CENTER = 1 |
const JUSTIFICATION_LEFT = 0 |
Justifications.
const JUSTIFICATION_RIGHT = 2 |
const SM_BIGX = 0x10 |
const SM_EQUAL = 0x01 |
Smush2 layout modes.
const SM_HARDBLANK = 0x20 |
const SM_HIERARCHY = 0x04 |
const SM_KERN = 0x40 |
const SM_LOWLINE = 0x02 |
const SM_PAIR = 0x08 |
const SM_SMUSH = 0x80 |
const SMO_FORCE = 2 |
const SMO_NO = 0 |
Smush mode override modes.
const SMO_YES = 1 |