SetaPDF_Core_Canvas_GraphicState_Text A class representing a text graphic state.

File: /SetaPDF/Core/Canvas/GraphicState/Text.php

Class hierarchy

Summary

Constants

CHARACTER_SPACING

const string SetaPDF_Core_Canvas_GraphicState_Text::CHARACTER_SPACING = 'characterSpacing'

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

$_callbacks

protected callback[] SetaPDF_Core_Canvas_GraphicState_Text::$_callbacks = array()

Callbacks which should be executed when a specific value is set.

$_data

The data of the text graphic state.

$_graphicState

The main graphic state from which this text graphic state is inherited/created from.

$_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.

_getCurrent()

Get the current state of the stack.

_getFontBBoxVector()

Get a font bounding box vector.

Parameters
$index : $index
 
Exceptions

Throws SetaPDF_Core_Exception

_getValue()

protected mixed SetaPDF_Core_Canvas_GraphicState_Text::_getValue ( string $name, $default $default )

Get a value by walking through the graphic stack.

Parameters
$name : string
 
$default : $default
 

_setValue()

protected void SetaPDF_Core_Canvas_GraphicState_Text::_setValue ( string $name, mixed $value )

Sets a value in the current graphic stack.

Parameters
$name : string
 
$value : mixed
 

_showText()

protected $this SetaPDF_Core_Canvas_GraphicState_Text::_showText ( string $text )

Method that is invoked when a text should be shown.

Parameters
$text : string
 

begin()

Begins a text object in the graphic state.

cleanUp()

Release cycled references.

end()

Ends a text object in the graphic state.

getBottomUserSpace()

Get the bottom bearing line value in user space coordinate system.

Exceptions

Throws SetaPDF_Core_Exception

getCharacterSpacing()

Gets the current character spacing value.

getFont()

Gets the current font instance.

getFontSize()

public float|boolean SetaPDF_Core_Canvas_GraphicState_Text::getFontSize ( void )

Gets the current font size.

getLeading()

Gets the current leading value.

getLineMatrix()

Gets the current line transformation matrix.

Exceptions

Throws BadMethodCallException

getRenderingMode()

Get the current rendering mode value.

getRise()

public float|integer SetaPDF_Core_Canvas_GraphicState_Text::getRise ( void )

Gets the current text rise value.

getScaling()

Gets the current scaling value.

getTextMatrix()

Gets the current text transformation matrix.

Exceptions

Throws BadMethodCallException

getTopUserSpace()

Get the top bearing line value in user space coordinate system.

Exceptions

Throws SetaPDF_Core_Exception

getWordSpacing()

Gets the current word spacing value.

moveToNextLine()

public $this SetaPDF_Core_Canvas_GraphicState_Text::moveToNextLine ( float $x, float $y [, bool $setLeading = false ] )

Move to the next line.

The "'" operator.

Parameters
$x : float
 
$y : float
 
$setLeading : bool
 

moveToNextLineAndShowText()

public $this SetaPDF_Core_Canvas_GraphicState_Text::moveToNextLineAndShowText ( string $text [, float|null $wordSpacing = null [, float|null $charSpacing = null ]] )

Moves to the start of the next line and shows a text string.

Parameters
$text : string
 
$wordSpacing : float|null
 
$charSpacing : float|null
 

moveToStartOfNextLine()

Move to the start of the next line.

The "T*" operator.

registerCallback()

public void SetaPDF_Core_Canvas_GraphicState_Text::registerCallback ( string $valueName, callback $callback )

Registers a callback that should be executed if a specifc value is set.

Parameters
$valueName : string
 
$callback : callback
 

setCharacterSpacing()

public $this SetaPDF_Core_Canvas_GraphicState_Text::setCharacterSpacing ( float $characterSpacing )

Sets the current character spacing value.

Parameters
$characterSpacing : float
 

setFont()

Sets the current font and size.

Parameters
$font : SetaPDF_Core_Font
 
$size : float
 

setLeading()

public $this SetaPDF_Core_Canvas_GraphicState_Text::setLeading ( float $leading )

Sets the current leading value.

Parameters
$leading : float
 

setLineMatrix()

public $this SetaPDF_Core_Canvas_GraphicState_Text::setLineMatrix ( float|SetaPDF_Core_Geometry_Matrix $aOrMatrix [, float|null $b = null [, float|null $c = null [, float|null $d = null [, float|null $e = null [, float|null $f = null ]]]]] )

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
 

setRenderingMode()

public $this SetaPDF_Core_Canvas_GraphicState_Text::setRenderingMode ( integer $renderingMode )

Sets the current rendering mode.

Parameters
$renderingMode : integer
 

setRise()

public $this SetaPDF_Core_Canvas_GraphicState_Text::setRise ( float $rise )

Sets the text rise value.

Parameters
$rise : float
 

setScaling()

public $this SetaPDF_Core_Canvas_GraphicState_Text::setScaling ( float $scaleing )

Sets the current scaling value.

Parameters
$scaleing : float
 

setTextMatrix()

public $this SetaPDF_Core_Canvas_GraphicState_Text::setTextMatrix ( float|SetaPDF_Core_Geometry_Matrix $aOrMatrix [, float|null $b = null [, float|null $c = null [, float|null $d = null [, float|null $e = null [, float|null $f = null ]]]]] )

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
 

setWordSpacing()

public $this SetaPDF_Core_Canvas_GraphicState_Text::setWordSpacing ( float $wordSpacing )

Sets the current word spacing value.

Parameters
$wordSpacing : float
 

showText()

Shows a text string.

Parameters
$text : string
 

showTextStrings()

public void SetaPDF_Core_Canvas_GraphicState_Text::showTextStrings ( string|string[] $textStrings )

Shows text strings.

Parameters
$textStrings : string|string[]
 

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
 

unregisterCallback()

Un-registers a callback.

Parameters
$valueName : string
 
See