Mike42\Escpos\PrintBuffers\EscposPrintBuffer::writeTextRaw PHP Method

writeTextRaw() public method

public writeTextRaw ( $text )
    public function writeTextRaw($text)
    {
        if ($this->printer == null) {
            throw new LogicException("Not attached to a printer.");
        }
        if (strlen($text) == 0) {
            return;
        }
        // Pass only printable characters
        $j = 0;
        $l = strlen($text);
        $outp = str_repeat(self::REPLACEMENT_CHAR, $l);
        for ($i = 0; $i < $l; $i++) {
            $c = substr($text, $i, 1);
            if ($c == "\r") {
                /* Skip past Windows line endings (raw usage). */
                continue;
            } else {
                if (self::asciiCheck($c, true)) {
                    $outp[$j] = $c;
                }
            }
            $j++;
        }
        $this->write(substr($outp, 0, $j));
    }