ZendTextFiglet is a PHP implementation of FIGlet
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.
Parameters: | array|Traversable – Options for the output |
---|
Set options from array
Parameters: | array – Configuration for Figlet |
---|---|
Return type: | Figlet |
Set a font to use
Parameters: | string – Path to the font |
---|---|
Return type: | Figlet |
Set handling of paragraphs
Parameters: | bool – Whether to handle paragraphs or not |
---|---|
Return type: | Figlet |
Set the justification. 0 stands for left aligned, 1 for centered and 2 for right aligned.
Parameters: | integer – Justification of the output text |
---|---|
Return type: | Figlet |
Set the output width
Parameters: | integer – Output with which should be used for word wrapping and justification |
---|---|
Return type: | Figlet |
Set right to left mode. For writing from left to right, use ZendTextFiglet::DIRECTION_LEFT_TO_RIGHT. For writing from right to left, use ZendTextFiglet::DIRECTION_RIGHT_TO_LEFT.
Parameters: | integer – Right-to-left mode |
---|---|
Return type: | Figlet |
Set the smush mode.
Use one of the constants of ZendTextFiglet::SM_*, you may combine them.
Parameters: | integer – Smush mode to use for generating text |
---|---|
Return type: | Figlet |
Render a FIGlet text
Parameters: |
|
---|---|
Throws ExceptionInvalidArgumentException: | |
When $text is not a string |
|
Throws ExceptionUnexpectedValueException: | |
When $text it not properly encoded |
|
Return type: | string |
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.
Parameters: | string – The string to add to the output |
---|---|
Return type: | 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.
Return type: | void |
---|
Attempts to add the given character onto the end of the current line. Returns true if this can be done, false otherwise.
Parameters: | string – Character which to add to the output |
---|---|
Return type: | bool |
Gets the requested character and sets current and previous char width.
Parameters: | string – The character from which to get the letter of |
---|---|
Return type: | void |
Returns the maximum amount that the current character can be smushed into the current line.
Return type: | integer |
---|
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):
16: / + -> X, > + < -> X (only in that order) 32: hardblank + hardblank -> hardblank
Parameters: |
|
---|---|
Return type: | string |
Load the specified font
Parameters: | string – Font file to load |
---|---|
Throws ExceptionRuntimeException: | |
When font file was not found | |
Throws ExceptionRuntimeException: | |
When GZIP library is required but not found | |
Throws ExceptionRuntimeException: | |
When font file is not readable | |
Throws ExceptionUnexpectedValueException: | |
When font file is not a FIGlet 2 font file | |
Return type: | void |
Set the used smush mode, according to smush override, user smush and font smush.
Return type: | void |
---|
Reads a four-character magic string from a stream
Parameters: | resource – File pointer to the font file |
---|---|
Return type: | string |
Skip a stream to the end of line
Parameters: | resource – File pointer to the font file |
---|---|
Return type: | void |
Smush2 layout modes
Smush mode override modes
Justifications
Write directions
Magic fontfile number