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()

public SetaPDF_Core_Canvas_GraphicState_Text::__construct ( SetaPDF_Core_Canvas_GraphicState $graphicState, array &$stack )

The constructor.

Parameters
$graphicState : SetaPDF_Core_Canvas_GraphicState
 
$stack : array

A reference to the graphic state stack array.

_getCurrent()

protected mixed SetaPDF_Core_Canvas_GraphicState_Text::_getCurrent ( void )

Get the current state of the stack.

_getFontBBoxVector()

private SetaPDF_Core_Geometry_Vector SetaPDF_Core_Canvas_GraphicState_Text::_getFontBBoxVector ( $name $name )

Get a font bounding box vector.

Parameters
$name : $name
 
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()

public $this SetaPDF_Core_Canvas_GraphicState_Text::begin ( void )

Begins a text object in the graphic state.

cleanUp()

public void SetaPDF_Core_Canvas_GraphicState_Text::cleanUp ( void )

Release cycled references.

end()

public $this SetaPDF_Core_Canvas_GraphicState_Text::end ( void )

Ends a text object in the graphic state.

getBottomUserSpace()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Canvas_GraphicState_Text::getBottomUserSpace ( void )

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

Exceptions

Throws SetaPDF_Core_Exception

getCharacterSpacing()

public integer|float SetaPDF_Core_Canvas_GraphicState_Text::getCharacterSpacing ( void )

Gets the current character spacing value.

getFont()

public SetaPDF_Core_Font|boolean SetaPDF_Core_Canvas_GraphicState_Text::getFont ( void )

Gets the current font instance.

getFontSize()

public float|boolean SetaPDF_Core_Canvas_GraphicState_Text::getFontSize ( void )

Gets the current font size.

getLeading()

public mixed SetaPDF_Core_Canvas_GraphicState_Text::getLeading ( void )

Gets the current leading value.

getLineMatrix()

public null|SetaPDF_Core_Geometry_Matrix SetaPDF_Core_Canvas_GraphicState_Text::getLineMatrix ( void )

Gets the current line transformation matrix.

Exceptions

Throws BadMethodCallException

getRenderingMode()

public integer SetaPDF_Core_Canvas_GraphicState_Text::getRenderingMode ( void )

Get the current rendering mode value.

getRise()

public float|integer SetaPDF_Core_Canvas_GraphicState_Text::getRise ( void )

Gets the current text rise value.

getScaling()

public mixed SetaPDF_Core_Canvas_GraphicState_Text::getScaling ( void )

Gets the current scaling value.

getTextMatrix()

public null|SetaPDF_Core_Geometry_Matrix SetaPDF_Core_Canvas_GraphicState_Text::getTextMatrix ( void )

Gets the current text transformation matrix.

Exceptions

Throws BadMethodCallException

getTopUserSpace()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Canvas_GraphicState_Text::getTopUserSpace ( void )

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

Exceptions

Throws SetaPDF_Core_Exception

getWordSpacing()

public integer|float SetaPDF_Core_Canvas_GraphicState_Text::getWordSpacing ( void )

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()

public SetaPDF_Core_Canvas_GraphicState_Text SetaPDF_Core_Canvas_GraphicState_Text::moveToStartOfNextLine ( void )

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()

public $this SetaPDF_Core_Canvas_GraphicState_Text::setFont ( SetaPDF_Core_Font $font, float $size )

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()

public SetaPDF_Core_Canvas_GraphicState_Text SetaPDF_Core_Canvas_GraphicState_Text::showText ( string $text )

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()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Canvas_GraphicState_Text::toTextSpace ( [ SetaPDF_Core_Geometry_Vector $vector = null ] )

Converts a vectors values to the text space coordinate system.

Parameters
$vector : SetaPDF_Core_Geometry_Vector
 

toUserSpace()

public SetaPDF_Core_Geometry_Vector SetaPDF_Core_Canvas_GraphicState_Text::toUserSpace ( [ SetaPDF_Core_Geometry_Vector $vector = null ] )

Converts a vectors values to the user space coordinate system.

Parameters
$vector : SetaPDF_Core_Geometry_Vector
 

unregisterCallback()

public void SetaPDF_Core_Canvas_GraphicState_Text::unregisterCallback ( string $valueName )

Un-registers a callback.

Parameters
$valueName : string
 
See