From a5a842dd6c3e07443222de7a430b5becdbb1267c Mon Sep 17 00:00:00 2001 From: "Roberto L. Machado" Date: Sun, 5 Jun 2016 09:28:29 -0300 Subject: [PATCH] [UPD] Removendo BUG linha 144 classe Daruma --- src/Connectors/Buffer.php | 1 + src/Printers/Daruma.php | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Connectors/Buffer.php b/src/Connectors/Buffer.php index b8931c4..cae4147 100755 --- a/src/Connectors/Buffer.php +++ b/src/Connectors/Buffer.php @@ -41,6 +41,7 @@ final class Buffer implements ConnectorInterface ' [DC2] ' => 18, //DC2 Cancela modo condensado ' [DC3] ' => 19, //DC3 Cancela modo enfatizado ' [DC4] ' => 20, //DC4 Controle de dispositivo 4 Inicia modo normal + ' [NAK] ' => 21, // NAK ' [SYN] ' => 22, //Sincronismo ' [CAN] ' => 24, //CAN Cancela linha enviada ' [EM] ' => 25, //Avança 4 linhas diff --git a/src/Printers/Daruma.php b/src/Printers/Daruma.php index ab3d474..e80e8e3 100644 --- a/src/Printers/Daruma.php +++ b/src/Printers/Daruma.php @@ -141,14 +141,10 @@ public function setFont($font = null) $font = $this->defaultFont($font); $fn = array_keys($this->aFont, $font, true); $mode = $fn[0]; - $b = ($this->boldMode) ? 1 : 0; - $d = ($this->doubleHeight) ? 1 : 0; - $e = ($this->expandedMode) ? 1 : 0; - $u = ($this->underlineMode) ? 1 : 0; - $mode += ((2**3) * $b); - $mode += ((2**4) * $d); - $mode += ((2**5) * $e); - $mode += ((2**7) * $u); + $mode += (8 * $this->boldMode); + $mode += (16 * $this->doubleHeight); + $mode += (32 * $this->expandedMode); + $mode += (128 * $this->underlineMode); $this->buffer->write(self::ESC.'!'.chr($mode)); }