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");
     }
_______________________________________________
This message was sent via the BRLTTY mailing list.
To post a message, send an e-mail to: BRLTTY@mielke.cc
For general information, go to: http://mielke.cc/mailman/listinfo/brltty

Reply via email to