Constants

POSITION_TOP

POSITION_TOP = 0

POSITION_RIGHT

POSITION_RIGHT = 1

POSITION_BOTTOM

POSITION_BOTTOM = 2

POSITION_LEFT

POSITION_LEFT = 3

ALIGN_LEFT

ALIGN_LEFT = 0

ALIGN_TOP

ALIGN_TOP = 0

ALIGN_CENTER

ALIGN_CENTER = 1

ALIGN_RIGHT

ALIGN_RIGHT = 2

ALIGN_BOTTOM

ALIGN_BOTTOM = 2

Properties

$font

$font

$text

$text

$position

$position

$alignment

$alignment

$offset

$offset

$spacing

$spacing

$rotationAngle

$rotationAngle

$backgroundColor

$backgroundColor

$foregroundColor

$foregroundColor

Methods

__construct()

__construct(string  $text = '', \BarcodeBakery\Common\BCGFont  $font = null, int  $position = self::POSITION_BOTTOM, int  $alignment = self::ALIGN_CENTER) : mixed

Constructor.

Parameters

string $text
\BarcodeBakery\Common\BCGFont $font
int $position
int $alignment

Returns

mixed —

getText()

getText() : string

Gets the text.

Returns

string —

setText()

setText(string  $text) : mixed

Sets the text.

Parameters

string $text

Returns

mixed —

getFont()

getFont() : \BarcodeBakery\Common\BCGFont

Gets the font.

Returns

\BarcodeBakery\Common\BCGFont —

setFont()

setFont(\BarcodeBakery\Common\BCGFont  $font) : mixed

Sets the font.

Parameters

\BarcodeBakery\Common\BCGFont $font

Returns

mixed —

getPosition()

getPosition() : int

Gets the text position for drawing.

Returns

int —

setPosition()

setPosition(int  $position) : mixed

Sets the text position for drawing.

Parameters

int $position

Returns

mixed —

getAlignment()

getAlignment() : int

Gets the text alignment for drawing.

Returns

int —

setAlignment()

setAlignment(int  $alignment) : mixed

Sets the text alignment for drawing.

Parameters

int $alignment

Returns

mixed —

getOffset()

getOffset() : int

Gets the offset.

Returns

int —

setOffset()

setOffset(int  $offset) : mixed

Sets the offset.

Parameters

int $offset

Returns

mixed —

getSpacing()

getSpacing() : int

Gets the spacing.

Returns

int —

setSpacing()

setSpacing(int  $spacing) : mixed

Sets the spacing.

Parameters

int $spacing

Returns

mixed —

getRotationAngle()

getRotationAngle() : int

Gets the rotation angle in degree.

Returns

int —

setRotationAngle()

setRotationAngle(int  $rotationAngle) : mixed

Sets the rotation angle in degree.

Parameters

int $rotationAngle

Returns

mixed —

getBackgroundColor()

getBackgroundColor() : \BarcodeBakery\Common\BCGColor

Gets the background color in case of rotation.

Returns

\BarcodeBakery\Common\BCGColor —

setBackgroundColor()

setBackgroundColor(\BarcodeBakery\Common\BCGColor  $backgroundColor) : mixed

Sets the background color in case of rotation.

Parameters

\BarcodeBakery\Common\BCGColor $backgroundColor

Returns

mixed —

getForegroundColor()

getForegroundColor() : \BarcodeBakery\Common\BCGColor

Gets the foreground color.

Returns

\BarcodeBakery\Common\BCGColor —

setForegroundColor()

setForegroundColor(\BarcodeBakery\Common\BCGColor  $foregroundColor) : mixed

Sets the foreground color.

Parameters

\BarcodeBakery\Common\BCGColor $foregroundColor

Returns

mixed —

getDimension()

getDimension() : int[]

Gets the dimension taken by the label, including the spacing and offset.

Returns

int[] —

draw()

draw(resource  $im, int  $x1, int  $y1, int  $x2, int  $y2) : mixed

Draws the text.

The coordinate passed are the positions of the barcode. $x1 and $y1 represent the top left corner. $x2 and $y2 represent the bottom right corner.

Parameters

resource $im
int $x1
int $y1
int $x2
int $y2

Returns

mixed —