[BRLTTY] Adding a dot display to tt driver

Christoph-Simon Senjak christoph.senjak at googlemail.com
Sat Sep 17 15:54:21 EDT 2016


Hi.

I was wondering whether it was possible to add a dot display to the tt 
driver. I am aware of the XW driver, but it has more library 
dependencies, and in many distributions, you have to configure it to use 
an utf8-aware font. However, most terminal emulators have support for utf-8.

I wrote the following proof-of-concept patch for the driver. It just 
adds an additional line with braille characters. However, it would 
probably be better to make this configurable, and I am not quite sure 
how the configuration system works.

Regards, Christoph

diff --git a/Drivers/Braille/TTY/braille.c b/Drivers/Braille/TTY/braille.c
index cdb2242..dc8537e 100644
--- a/Drivers/Braille/TTY/braille.c
+++ b/Drivers/Braille/TTY/braille.c
@@ -282,6 +282,27 @@ brl_writeWindow (BrailleDisplay *brl, const wchar_t 
*text) {
      int row;
      for (row=0; row<brl->textRows; row++) {
        writeText(&text[row*brl->textColumns], brl->textColumns);
+      addstr("\r\n");
+
+      wchar_t converted[brl->textColumns];
+      int col;
+      for (col = 0; col < brl->textColumns; ++col) {
+       /* from the XW driver */
+       unsigned char c = brl->buffer[col];
+       c =
+         (!!(c&BRL_DOT1))<<0
+         |(!!(c&BRL_DOT2))<<1
+         |(!!(c&BRL_DOT3))<<2
+         |(!!(c&BRL_DOT4))<<3
+         |(!!(c&BRL_DOT5))<<4
+         |(!!(c&BRL_DOT6))<<5
+         |(!!(c&BRL_DOT7))<<6
+         |(!!(c&BRL_DOT8))<<7;
+       converted[col] = 0x2800 | c;
+      }
+      writeText(converted, brl->textColumns);
+
+      //      writeText(&text[row*brl->textColumns], brl->textColumns);
        if (row < brl->textRows-1)
          addstr("\r\n");
      }


More information about the BRLTTY mailing list