Text/Figlet.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Text_Figlet
- Version
- $Id$
\Zend_Text_Figlet
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

array $_charList = array()array()Details- Type
- array

array $_germanChars = array(196, 214, 220, 228, 246, 252, 223)array(196, 214, 220, 228, 246, 252, 223)Details- Type
- array

boolean $_handleParagraphs = falsefalseDetails- Type
- boolean

integer $_justification = nullnullDetails- Type
- integer

integer $_rightToLeft = nullnullDetails- Type
- integer

array $_skipOptions = array('options', 'config')array('options', 'config')Details- Type
- array
Methods

__construct(array | \Zend_Config $options = null) : voidInstantiate 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.
| Name | Type | Description |
|---|---|---|
| $options | array | \Zend_Config | Options for the output |

_addChar(string $char) : booleanAttempts to add the given character onto the end of the current line.
| Name | Type | Description |
|---|---|---|
| $char | string | Character which to add to the output |
| Type | Description |
|---|---|
| boolean |

_getLetter(string $char) : voidGets the requested character and sets current and previous char width.
| Name | Type | Description |
|---|---|---|
| $char | string | The character from which to get the letter of |

_loadChar(resource $fp) : arrayLoad a single character from the font file
| Name | Type | Description |
|---|---|---|
| $fp | resource | File pointer to the font file |
| Type | Description |
|---|---|
| array |

_loadFont(string $fontFile) : voidLoad the specified font
| Name | Type | Description |
|---|---|---|
| $fontFile | string | Font file to load |
| Exception | Description |
|---|---|
| \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 |

_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.
| Name | Type | Description |
|---|---|---|
| $string | string | The string to add to the output |

_readMagic(resource $fp) : stringReads a four-character magic string from a stream
| Name | Type | Description |
|---|---|---|
| $fp | resource | File pointer to the font file |
| Type | Description |
|---|---|
| string |

_setUsedSmush() : voidSet the used smush mode, according to smush override, user smsush and font smush.

_skipToEol(resource $fp) : voidSkip a stream to the end of line
| Name | Type | Description |
|---|---|---|
| $fp | resource | File pointer to the font file |

_smushAmount() : integerReturns the maximum amount that the current character can be smushed into the current line.
| Type | Description |
|---|---|
| integer |

_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.
| Name | Type | Description |
|---|---|---|
| $leftChar | string | Left character to smush |
| $rightChar | string | Right character to smush |
| Type | Description |
|---|---|
| string |

_splitLine() : voidSplits inCharLine at the last word break (bunch of consecutive blanks).

_uniOrd(string $c) : integerUnicode compatible ord() method
| Name | Type | Description |
|---|---|---|
| $c | string | The char to get the value from |
| Type | Description |
|---|---|
| integer |

render(string $text, string $encoding = 'UTF-8') : stringRender a FIGlet text
| Name | Type | Description |
|---|---|---|
| $text | string | Text to convert to a figlet text |
| $encoding | string | Encoding of the input string |
| Type | Description |
|---|---|
| string |
| Exception | Description |
|---|---|
| \InvalidArgumentException | When $text is not a string |
| \Zend_Text_Figlet_Exception | When $text it not properly encoded |

setConfig(\Zend_Config $config) : \Zend_Text_FigletSet options from config object
| Name | Type | Description |
|---|---|---|
| $config | \Zend_Config | Configuration for Zend_Text_Figlet |
| Type | Description |
|---|---|
| \Zend_Text_Figlet |

setFont(string $font) : \Zend_Text_FigletSet a font to use
| Name | Type | Description |
|---|---|---|
| $font | string | Path to the font |
| Type | Description |
|---|---|
| \Zend_Text_Figlet |

setHandleParagraphs(boolean $handleParagraphs) : \Zend_Text_FigletSet handling of paragraphs
| Name | Type | Description |
|---|---|---|
| $handleParagraphs | boolean | Wether to handle paragraphs or not |
| Type | Description |
|---|---|
| \Zend_Text_Figlet |

setJustification(integer $justification) : \Zend_Text_FigletSet the justification. 0 stands for left aligned, 1 for centered and 2 for right aligned.
| Name | Type | Description |
|---|---|---|
| $justification | integer | Justification of the output text |
| Type | Description |
|---|---|
| \Zend_Text_Figlet |

setOptions(array $options) : \Zend_Text_FigletSet options from array
| Name | Type | Description |
|---|---|---|
| $options | array | Configuration for Zend_Text_Figlet |
| Type | Description |
|---|---|
| \Zend_Text_Figlet |

setOutputWidth(integer $outputWidth) : \Zend_Text_FigletSet the output width
| Name | Type | Description |
|---|---|---|
| $outputWidth | integer | Output with which should be used for word wrapping and justification |
| Type | Description |
|---|---|
| \Zend_Text_Figlet |

setRightToLeft(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.
| Name | Type | Description |
|---|---|---|
| $rightToLeft | integer | Right-to-left mode |
| Type | Description |
|---|---|
| \Zend_Text_Figlet |

setSmushMode(integer $smushMode) : \Zend_Text_FigletSet the smush mode.
| Name | Type | Description |
|---|---|---|
| $smushMode | integer | Smush mode to use for generating text |
| Type | Description |
|---|---|
| \Zend_Text_Figlet |