SetaPDF_Core_Canvas_Text A canvas helper class for text operators
File: /SetaPDF v2/Core/Canvas/Text.php
Class hierarchy
Summary
Methods
- __construct()
- addCurrentTransformationMatrix()
- begin()
- beginText()
- cleanUp()
- draw()
- end()
- endText()
- moveToNextLine()
- moveToNextLineAndShowText()
- moveToStartOfNextLine()
- path()
- restoreGraphicState()
- rotate()
- saveGraphicState()
- scale()
- setCharSpacing()
- setCharacterSpacing()
- setColor()
- setFont()
- setGraphicState()
- setLeading()
- setNonStrokingColor()
- setRenderingMode()
- setRise()
- setScaling()
- setStrokingColor()
- setTextMatrix()
- setTextRise()
- setWordSpacing()
- showText()
- showTextStrings()
- skew()
- text()
- translate()
Constants
RENDERING_MODE_CLIP
Rendering mode
RENDERING_MODE_FILL
Rendering mode
RENDERING_MODE_FILL_AND_CLIP
Rendering mode
RENDERING_MODE_FILL_AND_STROKE
Rendering mode
RENDERING_MODE_FILL_STROKE_AND_CLIP
Rendering mode
RENDERING_MODE_INVISIBLE
Rendering mode
RENDERING_MODE_STROKE
Rendering mode
RENDERING_MODE_STROKE_AND_CLIP
Rendering mode
Properties
Methods
__construct()
addCurrentTransformationMatrix()
Proxy method for adding a transformation matrix on the canvas.
Parameters
- $a : float|int
- $b : float|int
- $c : float|int
- $d : float|int
- $e : float|int
- $f : float|int
See
cleanUp()
Release objects to free memory and cycled references.
After calling this method the instance of this object is unusable!
moveToNextLine()
Move to the next line.
Parameters
- $x : float
- $y : float
- $setLeading : boolean
moveToNextLineAndShowText()
Move to the next line and show text.
Parameters
- $text : string|string[]
- $wordSpacing : float
- $charSpacing : float
Exceptions
Throws SetaPDF_Core_Exception
rotate()
Proxy method for rotating the transformation matrix on the canvas.
Parameters
- $x : int|float
X-coordinate of rotation point
- $y : int|float
Y-coordinate of rotation point
- $angle : int|float
Angle to rotate in degrees
See
scale()
Proxy method for scaling the transformation matrix on the canvas.
Parameters
- $scaleX : int|float
Scale factor on X
- $scaleY : int|float
Scale factor on Y
See
setCharSpacing()
WARNING: This method is marked as deprecated!
Alias for setCharacterSpacing()
Parameters
- $charSpacing : float
See
setCharacterSpacing()
Set the char spacing.
Parameters
- $charSpacing : float
setColor()
Proxy method for setting the color on the canvas.
Parameters
- $color : SetaPDF_Core_DataStructure_Color|int[]|int|string
- $stroking : boolean
See
setFont()
Set the font.
Parameters
- $name : string|SetaPDF_Core_Font_FontInterface
- $size : float
Exceptions
Throws SetaPDF_Core_Font_Exception
Throws SetaPDF_Core_Type_IndirectReference_Exception
Throws SetaPDF_Exception_NotImplemented
Throws SetaPDF_Core_Type_Exception
setGraphicState()
Proxy method for setting a graphic state on the canvas.
Parameters
- $graphicState : SetaPDF_Core_Resource_ExtGState
See
setNonStrokingColor()
Proxy method for setting the non-stroking color on the canvas.
Parameters
- $color : SetaPDF_Core_DataStructure_Color|int[]|int|string
See
setRenderingMode()
Set the rendering mode.
The available rendering modes are also available through class constants such as
SetaPDF_Core_Canvas_Text::RENDERING_MODE_CLIP
.
Parameters
- $renderingMode : integer
See
- PDF reference 32000-1:2008 9.3.6 Text Rendering Mode
setScaling()
Set the horizontal scaling.
Parameters
- $scaling : float
setStrokingColor()
Proxy method for setting the stroking color on the canvas.
Parameters
- $color : SetaPDF_Core_DataStructure_Color|int[]|int|string
See
setTextMatrix()
Set the text matrix.
Parameters
- $a : float
- $b : float
- $c : float
- $d : float
- $e : float
- $f : float
setTextRise()
WARNING: This method is marked as deprecated!
Alias for setRise()
Parameters
- $textRise : float
See
setWordSpacing()
Set the word spacing.
You shall notice that this word spacing property affects the character which is assigned to "\x20" of a font which uses a single byte encoding. When e.g. using subset fonts this setting will end in unwanted results.
Parameters
- $wordSpacing : float
showText()
showTextStrings()
Shows text strings.
Parameters
- $textStrings : array|string
Exceptions
Throws SetaPDF_Core_Exception
skew()
Proxy method for skewing the transformation matrix on the canvas.
Parameters
- $angleX : int|float
Angle to x-axis in degrees
- $angleY : int|float
Angle to y-axis in degrees
- $x : int|float
Points to stretch on x-axis
- $y : int|float
Point to stretch on y-axis
See
translate()
Proxy method for moving the transformation matrix on the canvas.
Parameters
- $shiftX : int|float
Points to move on x-axis
- $shiftY : int|float
Points to move on y-axis