Text/Figlet.php

Show: PublicProtectedPrivateinherited
Table of Contents
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.
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

Package: Zend_Text_Figlet
Zend_Text_Figlet is a PHP implementation of FIGlet
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  SM_EQUAL = 1
Smush2 layout modes
>VConstant  SM_LOWLINE = 2
>VConstant  SM_HIERARCHY = 4
>VConstant  SM_PAIR = 8
>VConstant  SM_BIGX = 16
>VConstant  SM_HARDBLANK = 32
>VConstant  SM_KERN = 64
>VConstant  SM_SMUSH = 128
>VConstant  SMO_NO = 0
Smush mode override modes
>VConstant  SMO_YES = 1
>VConstant  SMO_FORCE = 2
>VConstant  JUSTIFICATION_LEFT = 0
Justifications
>VConstant  JUSTIFICATION_CENTER = 1
>VConstant  JUSTIFICATION_RIGHT = 2
>VConstant  DIRECTION_LEFT_TO_RIGHT = 0
Write directions
>VConstant  DIRECTION_RIGHT_TO_LEFT = 1
>VConstant  FONTFILE_MAGIC_NUMBER = 'flf2'
Magic fontfile number

Properties

Methods

methodpublic__construct(array | \Zend_Config $options = null) : void

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
NameTypeDescription
$optionsarray | \Zend_Config

Options for the output

methodpublicrender(string $text, string $encoding = 'UTF-8') : string

Render a FIGlet text

Parameters
NameTypeDescription
$textstring

Text to convert to a figlet text

$encodingstring

Encoding of the input string

Returns
TypeDescription
string
Throws
ExceptionDescription
\InvalidArgumentExceptionWhen $text is not a string
\Zend_Text_Figlet_ExceptionWhen $text it not properly encoded
methodpublicsetConfig(\Zend_Config $config) : \Zend_Text_Figlet

Set options from config object

Parameters
NameTypeDescription
$config\Zend_Config

Configuration for Zend_Text_Figlet

Returns
TypeDescription
\Zend_Text_Figlet
methodpublicsetFont(string $font) : \Zend_Text_Figlet

Set a font to use

Parameters
NameTypeDescription
$fontstring

Path to the font

Returns
TypeDescription
\Zend_Text_Figlet
methodpublicsetHandleParagraphs(boolean $handleParagraphs) : \Zend_Text_Figlet

Set handling of paragraphs

Parameters
NameTypeDescription
$handleParagraphsboolean

Wether to handle paragraphs or not

Returns
TypeDescription
\Zend_Text_Figlet
methodpublicsetJustification(integer $justification) : \Zend_Text_Figlet

Set the justification. 0 stands for left aligned, 1 for centered and 2 for right aligned.

Parameters
NameTypeDescription
$justificationinteger

Justification of the output text

Returns
TypeDescription
\Zend_Text_Figlet
methodpublicsetOptions(array $options) : \Zend_Text_Figlet

Set options from array

Parameters
NameTypeDescription
$optionsarray

Configuration for Zend_Text_Figlet

Returns
TypeDescription
\Zend_Text_Figlet
methodpublicsetOutputWidth(integer $outputWidth) : \Zend_Text_Figlet

Set the output width

Parameters
NameTypeDescription
$outputWidthinteger

Output with which should be used for word wrapping and justification

Returns
TypeDescription
\Zend_Text_Figlet
methodpublicsetRightToLeft(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.

Parameters
NameTypeDescription
$rightToLeftinteger

Right-to-left mode

Returns
TypeDescription
\Zend_Text_Figlet
methodpublicsetSmushMode(integer $smushMode) : \Zend_Text_Figlet

Set the smush mode.

Use one of the constants of Zend_Text_Figlet::SM_*, you may combine them.
Parameters
NameTypeDescription
$smushModeinteger

Smush mode to use for generating text

Returns
TypeDescription
\Zend_Text_Figlet
Documentation was generated by phpDocumentor 2.2.0 .