SetaPDF_Core_Canvas_GraphicState_Text A class representing a text graphic state.

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

Class hierarchy

Summary

Constants

CHARACTER_SPACING

public const string SetaPDF_Core_Canvas_GraphicState_Text::CHARACTER_SPACING = 'characterSpacing'

Data name constant

FONT

public const string SetaPDF_Core_Canvas_GraphicState_Text::FONT = 'font'

Data name constant

FONT_SIZE

public const string SetaPDF_Core_Canvas_GraphicState_Text::FONT_SIZE = 'fontSize'

Data name constant

LEADING

public const string SetaPDF_Core_Canvas_GraphicState_Text::LEADING = 'leading'

Data name constant

LINE_MATRIX

public const string SetaPDF_Core_Canvas_GraphicState_Text::LINE_MATRIX = 'lineMatrix'

Data name constant

RENDERING_MODE

public const string SetaPDF_Core_Canvas_GraphicState_Text::RENDERING_MODE = 'renderingMode'

Data name constant

RISE

public const string SetaPDF_Core_Canvas_GraphicState_Text::RISE = 'rise'

Data name constant

SCALING

public const string SetaPDF_Core_Canvas_GraphicState_Text::SCALING = 'scaling'

Data name constant

TEXT_MATRIX

public const string SetaPDF_Core_Canvas_GraphicState_Text::TEXT_MATRIX = 'textMatrix'

Data name constant

WORD_SPACING

public const string SetaPDF_Core_Canvas_GraphicState_Text::WORD_SPACING = 'wordSpacing'

Data name constant


Properties

$_graphicState

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


Methods

__construct()

_getFontBBoxVector()

Get a font bounding box vector.

Parameters
$index : int
 
Exceptions

Throws SetaPDF_Core_Exception

_getValue()

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

Get a value by walking through the graphic stack.

Parameters
$name : string
 
$default : mixed
 

_setValue()

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

Sets a value in the current graphic stack.

Parameters
$name : string
 
$value : mixed
 

begin()

Begins a text object in the graphic state.

cleanUp()

WARNING: This method is marked as deprecated!

Unused

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

Gets the current font size.

getLeading()

Gets the current leading value.

getLineMatrix()

Gets the current line transformation matrix.

getRenderingMode()

Get the current rendering mode value.

getRise()

Gets the current text rise value.

getScaling()

Gets the current scaling value.

getTextMatrix()

Gets the current text transformation matrix.

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 SetaPDF_Core_Canvas_GraphicState_Text::moveToNextLine (
float $x, float $y [, bool $setLeading = false ]
): $this

Move to the next line.

The "'" operator.

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

moveToNextLineAndShowText()

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

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.

setCharacterSpacing()

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

Sets the current character spacing value.

Parameters
$characterSpacing : float
 

setFont()

Sets the current font and size.

Parameters
$font : SetaPDF_Core_Font_FontInterface
 
$size : float
 

setLeading()

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

Sets the current leading value.

Parameters
$leading : float
 

setLineMatrix()

public 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 ]]]]]
): $this

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 SetaPDF_Core_Canvas_GraphicState_Text::setRenderingMode (
int $renderingMode
): $this

Sets the current rendering mode.

Parameters
$renderingMode : int
 

setRise()

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

Sets the text rise value.

Parameters
$rise : float
 

setScaling()

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

Sets the current scaling value.

Parameters
$scaling : float
 

setTextMatrix()

public 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 ]]]]]
): $this

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 SetaPDF_Core_Canvas_GraphicState_Text::setWordSpacing (
float $wordSpacing
): $this

Sets the current word spacing value.

Parameters
$wordSpacing : float
 

showText()

Shows a text string.

Parameters
$text : string
 
Exceptions

Throws SetaPDF_Core_Exception

showTextStrings()

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

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