[BRLTTY] Adding a dot display to tt driver

Samuel Thibault samuel.thibault at ens-lyon.org
Sat Sep 17 16:02:56 EDT 2016


Hello,

Thanks!

Christoph-Simon Senjak, on Sat 17 Sep 2016 21:54:21 +0200, wrote:
>      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];

Here you need to add row*brl->textColumns to col, to get the proper line
from brl->buffer. Apart from that, the patch looks good.  An option could
be useful, but it shouldn't be too bad to always print it, on most
systems nowadays it will be fine.

> +       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 at mielke.cc
> For general information, go to: http://mielke.cc/mailman/listinfo/brltty
> 

-- 
Samuel
<y> ça gaze ?
<l> prout
 -+- #ens-mim - ouvrez les fenêtres ! -+-


More information about the BRLTTY mailing list