SetaPDF_Core_Canvas_GraphicState_Text A class representing a text graphic state.
File: /SetaPDF v2/Core/Canvas/GraphicState/Text.php
Class hierarchy
Summary
Methods
- __construct()
- _getCurrent()
- _getFontBBoxVector()
- _getValue()
- _setValue()
- _showText()
- begin()
- cleanUp()
- end()
- getBottomUserSpace()
- getCharacterSpacing()
- getFont()
- getFontSize()
- getLeading()
- getLineMatrix()
- getRenderingMode()
- getRise()
- getScaling()
- getTextMatrix()
- getTopUserSpace()
- getWordSpacing()
- moveToNextLine()
- moveToNextLineAndShowText()
- moveToStartOfNextLine()
- registerCallback()
- setCharacterSpacing()
- setFont()
- setLeading()
- setLineMatrix()
- setRenderingMode()
- setRise()
- setScaling()
- setTextMatrix()
- setWordSpacing()
- showText()
- showTextStrings()
- toTextSpace()
- toUserSpace()
- unregisterCallback()
Constants
CHARACTER_SPACING
Data name constant
FONT
Data name constant
FONT_SIZE
Data name constant
LEADING
Data name constant
LINE_MATRIX
Data name constant
RENDERING_MODE
Data name constant
RISE
Data name constant
SCALING
Data name constant
TEXT_MATRIX
Data name constant
WORD_SPACING
Data name constant
Properties
$_stack
The graphic state instance of this text state.
Methods
__construct()
The constructor.
Parameters
- $graphicState : SetaPDF_Core_Canvas_GraphicState
- $stack : array
A reference to the graphic state stack array.
_getFontBBoxVector()
Get a font bounding box vector.
Parameters
- $index : int
Exceptions
Throws SetaPDF_Core_Exception
_getValue()
Get a value by walking through the graphic stack.
Parameters
- $name : string
- $default : mixed
_showText()
Method that is invoked when a text should be shown.
Parameters
- $text : string
Exceptions
Throws SetaPDF_Core_Exception
getBottomUserSpace()
Get the bottom bearing line value in user space coordinate system.
Exceptions
Throws SetaPDF_Core_Exception
getFont()
Gets the current font instance.
getLineMatrix()
Gets the current line transformation matrix.
Exceptions
Throws BadMethodCallException
getTextMatrix()
getTopUserSpace()
Get the top bearing line value in user space coordinate system.
Exceptions
Throws SetaPDF_Core_Exception
moveToNextLine()
Move to the next line.
The "'" operator.
Parameters
- $x : float
- $y : float
- $setLeading : bool
moveToNextLineAndShowText()
Moves to the start of the next line and shows a text string.
Parameters
- $text : string
- $wordSpacing : float|null
- $charSpacing : float|null
Exceptions
Throws SetaPDF_Core_Exception
moveToStartOfNextLine()
Move to the start of the next line.
The "T*" operator.
registerCallback()
Registers a callback that should be executed if a specifc value is set.
Parameters
- $valueName : string
- $callback : callback
setCharacterSpacing()
Sets the current character spacing value.
Parameters
- $characterSpacing : float
setFont()
Sets the current font and size.
Parameters
- $font : SetaPDF_Core_Font_FontInterface
- $size : float
setLineMatrix()
Sets the current line matrix.
Parameters
- $aOrMatrix : float|SetaPDF_Core_Geometry_Matrix
- $b : float|null
- $c : float|null
- $d : float|null
- $e : float|null
- $f : float|null
setTextMatrix()
Sets the current text matrix.
Parameters
- $aOrMatrix : float|SetaPDF_Core_Geometry_Matrix
- $b : float|null
- $c : float|null
- $d : float|null
- $e : float|null
- $f : float|null
showText()
Shows a text string.
Parameters
- $text : string
Exceptions
Throws SetaPDF_Core_Exception
showTextStrings()
Shows text strings.
Parameters
- $textStrings : string|string[]
Exceptions
Throws SetaPDF_Core_Exception
toTextSpace()
Converts a vectors values to the text space coordinate system.
Parameters
- $vector : SetaPDF_Core_Geometry_Vector
toUserSpace()
Converts a vectors values to the user space coordinate system.
Parameters
- $vector : SetaPDF_Core_Geometry_Vector