EncodeTxt

Encode TXT/C40 methods for Datamatrix Barcode type class

Namespace: Com\Tecnick\Barcode\Type\Square\Datamatrix

Extends: Steps

File: EncodeTxt.php line 36

Encode TXT/C40 methods for Datamatrix Barcode type class

Tags

Properties

$gsonemode

File: Modes.php line 74

public bool $gsonemode = false

$last_enc

File: Modes.php line 57

public int $last_enc = 0

$shape

File: Modes.php line 62

public string $shape

$size

File: Modes.php line 69

public string $size = ''

Methods

encodeTXT()

File: EncodeTxt.php line 297

public encodeTXT(array<int, int> &$cdw, int &$cdw_num, int &$pos, int &$data_length, string &$data, int &$enc) : void

Parameters

  • $cdw : array<int, int>: Codewords array
  • $cdw_num : int: Codewords number
  • $pos : int: Current position
  • $data_length : int: Data length
  • $data : string: Data string
  • $enc : int: Current encoding

Tags

  • throws: Exception in case of TXT/C40 encoding errors

encodeTXTC40()

File: EncodeTxt.php line 171

public encodeTXTC40(string &$data, int &$enc, array<int, int> &$temp_cw, int &$ptr, int &$epos, array<int|string, int> &$charset) : int|null

Parameters

  • $data : string: Data string
  • $enc : int: Current encoding
  • $temp_cw : array<int, int>: Temporary codewords array
  • $ptr : int: Pointer
  • $epos : int: End position
  • $charset : array<int|string, int>: Charset array

Tags

  • throws: Exception in case of TXT/C40 encoding errors

Return values

int|null —

Current character code, or null if it has no representation in $enc

encodeTXTC40last()

File: EncodeTxt.php line 227

public encodeTXTC40last(int|null $chr, array<int, int> &$cdw, int &$cdw_num, int &$enc, array<int, int> &$temp_cw, int &$ptr, int &$epos, int $cpos) : void

Parameters

  • $chr : int|null: Character code, or null if the pending values do not hold a whole character
  • $cdw : array<int, int>: Codewords array
  • $cdw_num : int: Codewords number
  • $enc : int: Current encoding
  • $temp_cw : array<int, int>: Temporary codewords array
  • $ptr : int: Pointer
  • $epos : int: End position
  • $cpos : int: Data index of the character that owns the first pending value

encodeTXTC40shift()

File: EncodeTxt.php line 111

public encodeTXTC40shift(int &$chr, int &$enc, array<int, int> &$temp_cw, int &$ptr) : bool

Parameters

  • $chr : int: Character code
  • $enc : int: Current encoding
  • $temp_cw : array<int, int>: Temporary codewords array
  • $ptr : int: Pointer

Tags

  • throws: Exception in case of shift encoding errors

Return values

bool —

false if the character has no representation in the current encoding

get253StateCodeword()

File: Modes.php line 93

public get253StateCodeword(int $cdwpad, int $cdwpos) : int

Parameters

  • $cdwpad : int: Pad codeword.
  • $cdwpos : int: Number of data codewords from the beginning of encoded data.

Return values

int

getPlacementMap()

File: Placement.php line 289

public getPlacementMap(int $nrow, int $ncol) : array<int, int>

(Annex F - ECC 200 symbol character placement)

Parameters

  • $nrow : int: Number of rows.
  • $ncol : int: Number of columns.

Return values

array<int, int>

getSwitchEncodingCodeword()

File: Modes.php line 263

public getSwitchEncodingCodeword(int $mode) : int

Parameters

  • $mode : int: New encoding mode.

Return values

int —

Switch codeword.

isGsOneChar()

File: Modes.php line 82

public isGsOneChar(int $chr) : bool

Only meaningful when the GS1 variant is selected.

Parameters

  • $chr : int: Character (byte) to check.

Return values

bool

lookAheadTest()

File: Steps.php line 45

public lookAheadTest(string $data, int $pos, int $mode) : int

Parameters

  • $data : string: Data to encode
  • $pos : int: Current position
  • $mode : int: Current encoding mode

Return values

int —

encoding mode