/**
* Switch character table (code page) manually. Used in conjunction with textRaw() to
* print special characters which can't be encoded automatically.
*
* @param int $table The table to select. Available code tables are model-specific.
*/
public function selectCharacterTable($table = 0)
{
self::validateInteger($table, 0, 255, __FUNCTION__);
$supported = $this->profile->getCodePages();
if (!isset($supported[$table])) {
throw new InvalidArgumentException("There is no code table {$table} allowed by this printer's capability profile.");
}
$this->characterTable = $table;
if ($this->profile->getSupportsStarCommands()) {
/* Not an ESC/POS command: STAR printers stash all the extra code pages under a different command. */
$this->connector->write(self::ESC . self::GS . "t" . chr($table));
return;
}
$this->connector->write(self::ESC . "t" . chr($table));
}