chrys87 / fenrir

An TTY screenreader for Linux.
GNU Lesser General Public License v3.0
47 stars 13 forks source link

Unicode /dev/vcsu* support for linux screen driver #52

Closed pvagner closed 5 years ago

pvagner commented 5 years ago

Linux screen driver makes some use of /dev/vcs pseudo devices to obtain screen text. The down side of this is that /dev/vcs devices only contain ansi representation of the screen content, user has to configure correct code page for the screen driver in order to read non-ascii characters. Even if this is configured correctly fenrir can only read limited number of characters from the screen. Since linux 4.19, there are /dev/vcsu devices complementing /dev/vcs devices allowing reading of unicode data from the screen. This is something brltty is making use out of in its upcoming 6.0 release. Would it be possible to implement this into fenrir as well? Patches related to the kernel implementation are at: https://lore.kernel.org/patchwork/patch/956334/

Greetings

Peter

chrys87 commented 5 years ago

Sure, should not be a big deal to prefer vcsu over vcs if exist. after reading the patch, this also has a downside:

Unicode with attributes (similarly to /dev/vcsa*) is not supported at the moment.

but ill take a look at this if you need this

chrys87 commented 5 years ago

i added support for /dev/vcsu to fenrir (its used automatical if available). it takes the attributes still from VCSA for now. i leave it open as i need to do some testing first before i define it as stable. Tanks for reporting

chrys87 commented 5 years ago

Ok, landed in master and works like a charm. speaks now "skull with crossbow" instead of "unknown blabla" for this: printf '\xE2\x98\xA0'