diff -Nru console-braille-1.6/debian/changelog console-braille-1.7/debian/changelog --- console-braille-1.6/debian/changelog 2017-12-03 16:23:01.000000000 +0000 +++ console-braille-1.7/debian/changelog 2018-02-18 01:34:43.000000000 +0000 @@ -1,3 +1,9 @@ +console-braille (1.7) unstable; urgency=medium + + * Add gen-psf-block tool to generate arbitrary dumb fonts. + + -- Samuel Thibault Sun, 18 Feb 2018 02:34:43 +0100 + console-braille (1.6) unstable; urgency=medium * Add 10x7, 11x8, 12x7, 13x10, 13x7, 13x9, 14x10, 16x10, 16x11, 16x12, 17x10, diff -Nru console-braille-1.6/debian/console-braille.install console-braille-1.7/debian/console-braille.install --- console-braille-1.6/debian/console-braille.install 2009-06-28 19:13:39.000000000 +0000 +++ console-braille-1.7/debian/console-braille.install 2018-02-18 01:22:59.000000000 +0000 @@ -1,2 +1,3 @@ *.psf /usr/share/consolefonts setbrlkeys /usr/bin +gen-psf-block /usr/bin diff -Nru console-braille-1.6/debian/console-braille.install.hurd-i386 console-braille-1.7/debian/console-braille.install.hurd-i386 --- console-braille-1.6/debian/console-braille.install.hurd-i386 2010-04-15 00:22:12.000000000 +0000 +++ console-braille-1.7/debian/console-braille.install.hurd-i386 2018-02-18 01:23:01.000000000 +0000 @@ -1 +1,2 @@ *.psf /usr/share/consolefonts +gen-psf-block /usr/bin diff -Nru console-braille-1.6/debian/console-braille.install.kfreebsd-amd64 console-braille-1.7/debian/console-braille.install.kfreebsd-amd64 --- console-braille-1.6/debian/console-braille.install.kfreebsd-amd64 2010-04-15 00:22:20.000000000 +0000 +++ console-braille-1.7/debian/console-braille.install.kfreebsd-amd64 2018-02-18 01:23:02.000000000 +0000 @@ -1 +1,2 @@ *.psf /usr/share/consolefonts +gen-psf-block /usr/bin diff -Nru console-braille-1.6/debian/console-braille.install.kfreebsd-i386 console-braille-1.7/debian/console-braille.install.kfreebsd-i386 --- console-braille-1.6/debian/console-braille.install.kfreebsd-i386 2010-04-15 00:22:19.000000000 +0000 +++ console-braille-1.7/debian/console-braille.install.kfreebsd-i386 2018-02-18 01:23:07.000000000 +0000 @@ -1 +1,2 @@ *.psf /usr/share/consolefonts +gen-psf-block /usr/bin diff -Nru console-braille-1.6/gen-psf-block.c console-braille-1.7/gen-psf-block.c --- console-braille-1.6/gen-psf-block.c 1970-01-01 00:00:00.000000000 +0000 +++ console-braille-1.7/gen-psf-block.c 2018-02-18 01:10:14.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * Copyright (C) Samuel Thibault + * + * This program is free software ; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation ; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY ; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the program ; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include "psf.h" +int main(int argc, char *argv[]) { + unsigned base; + unsigned width, height, mask; + char *end; + + if (argc != 4) { + printf("Usage: %s [height] [width] xyz00\n", argv[0]); + printf("where xyz00 is the hex value for the desired unicode block\n"); + exit(EXIT_FAILURE); + } + + height = strtol(argv[1], &end, 10); + if (end == argv[1] || *end != '\0') { + fprintf(stderr,"Invalid height '%s'\n", argv[1]); + exit(EXIT_FAILURE); + } + + width = strtol(argv[2], &end, 10); + if (end == argv[2] || *end != '\0') { + fprintf(stderr,"Invalid width '%s'\n", argv[2]); + exit(EXIT_FAILURE); + } + + base = strtol(argv[3], &end, 16); + if (end == argv[3] || *end != '\0') { + fprintf(stderr,"Invalid block value '%s'\n", argv[3]); + exit(EXIT_FAILURE); + } + + int i, j; + header(width, height, 256, 1); + mask = ((1U << (width/2)) - 1) << (width/4); + + for (i=0;i<256;i++) { + for (j=0;j= height/4 && j < 3*height/4) + if (width <= 8) + printf("%c", mask); + else + printf("%c%c", mask >> 8, mask & 0xff); + else + if (width <= 8) + printf("%c", 0); + else + printf("%c%c", 0, 0); + } + } + + for (i=0;i<256;i++) + sfm(base+i); + return 0; +} diff -Nru console-braille-1.6/Makefile console-braille-1.7/Makefile --- console-braille-1.6/Makefile 2017-12-03 16:03:13.000000000 +0000 +++ console-braille-1.7/Makefile 2018-02-18 01:22:13.000000000 +0000 @@ -6,7 +6,7 @@ UNAME=$(shell uname) -all: $(TARGETS) brl.uni +all: $(TARGETS) brl.uni gen-psf-block test: $(TESTS) @@ -17,6 +17,8 @@ brl-%: brl-%.o psf.o $(CC) -o $@ $(LDFLAGS) $^ $(LDLIBS) +gen-psf-block: gen-psf-block.o psf.o + %.test.o: %.c do.h $(CC) $(CFLAGS) $(CPPFLAGS) -DTEST -c -o $@ $< @@ -32,4 +34,4 @@ ./$< 0 > $@ clean: - rm -f $(PROGS) $(TESTPROGS) psf.o $(BRLS:.c=.o) $(TARGETS) $(TESTS) brl.uni uni setbrlkeys + rm -f $(PROGS) $(TESTPROGS) psf.o $(BRLS:.c=.o) gen-psf-block.o $(TARGETS) $(TESTS) brl.uni uni setbrlkeys gen-psf-block diff -Nru console-braille-1.6/README console-braille-1.7/README --- console-braille-1.6/README 2008-12-16 00:09:00.000000000 +0000 +++ console-braille-1.7/README 2018-02-18 00:51:09.000000000 +0000 @@ -1,15 +1,26 @@ -Fonts and keymaps for the linux console -======================================= +Braille fonts and keymaps for the linux console +=============================================== -Starting from linux 2.6.17, one can type braille patterns directly on the -text console. +This package contains support for two things: -This permits to type raw braille patterns: they will show up as braille dots on -the screen, and if you send them within files or mails to people, they will read -exactly the same pattern as you typed. No interpretation ("this is an 'A'" for -instance) will be done. +- being able to type unicode braille patterns directly on the text console. -But for this, unicode environment, fonts and keymaps are needed. + This permits to type raw braille patterns: they will show up as braille dots + on the screen, and if you send them within files or mails to people, they will + read exactly the same pattern as you typed. No interpretation ("this is an + 'A'" for instance) will be done. + +- being able to read any non-ascii script with screen readers such as brltty. + + One actually just need to load the corresponding PSF font for the system to be + able to display them, and thus for brltty and such to be able to read them. + There are however not so many PSF fonts, and certainly not for all unicode + blocks. But if the only goal is to be able to read the text with brltty, + without caring about what actually shows up on the screen, we can easily + generate a dumb font which will just display dumb letters, while brltty will + be able to read the text. + +But for all of this, unicode environment, fonts and keymaps are needed. Unicode environment ------------------- @@ -34,21 +45,32 @@ Fonts ----- -Run +Running - setfont lat9-16 brl-16 + setfont lat9-16 brl-16x8 This will load 16-pixel height latin9 and braille pattern fonts into the text console. +If you want to read e.g. Devanagari text, according to Unicode this is block +U+0900, thus run + + gen-psf-block-16x8 0900 > devanagari-16x8.psf + +and then + + setfont lat9-16 devanagari-16x8 + +will allow to read both Latin-9 and Devanagari texts with e.g brltty. + Keymaps ------- -Keymaps for various machine types are given in keymaps/. They will hopefully be -included in distributions. With them, you need to hold left and right alt keys -(AKA alt and altgr keys) pressed, and then use asdfjkl; keys (or qsdfjkml keys -on an azerty keyboard, etc.) for typing braille patterns just like you would use -a usual braille device. +Keymaps for typing braille various machine types are given in keymaps/. They +will hopefully be included in distributions. With them, you need to hold left +and right alt keys (AKA alt and altgr keys) pressed, and then use asdfjkl; keys +(or qsdfjkml keys on an azerty keyboard, etc.) for typing braille patterns just +like you would use a usual braille device. But for more advanced keymaps, run @@ -81,7 +103,7 @@ A- Your distribution forgot to notify the kernel that it is using unicode. For loading the font, instead of using setfont, use: -unicode_start lat9wbrl-16.psf lat9wbrl.uni +unicode_start lat9wbrl-16x8.psf lat9wbrl.uni Q- The patterns are incomplete, some dots are missing A- Maybe your keyboard is just bad. Laptop for instance often have keyboards