GithubHelp home page GithubHelp logo

mf's Introduction

This is a metafont for computer braille for 8-dot displays. Prerequisites:

  • install a LaTeX distribution, like latex-live
  • a Go compiler, which is templating the font file, to make it much much shorter and more consistent

The ASCII table is mapped to dots like this:

_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
0_
NUL

SOH

STX

ETX

EOT

ENQ

ACK

BEL

BS

TAB

LF

VT

FF

CR

SO

SI
1_
DLE

DC1

DC2

DC3

DC4

NAK

SYN

ETB

CAN

EM

SUB

ESC

FS

GS

RS

US
2_
SPC

!

"

#

$

%

&

'

(

)

*

+

,

-

.

/
3_
0

1

2

3

4

5

6

7

8

9

:

;

<

=

>

?
4_
@

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O
5_
P

Q

R

S

T

U

V

W

X

Y

Z

[

\

]

^

_
6_
`

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o
7_
p

q

r

s

t

u

v

w

x

y

z

{

|

}

~

DEL
8_
UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK
9_
UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK

UNK
A_
UNK

¡

¢

£

¤

¥

¦

§

¨

©

ª

«

¬

­

®

¯
B_
°

±

²

³

´

µ


·

¸

¹

º

»

¼

½

¾

¿
C_
À

Á

Â

Ã

Ä

Å

Æ

Ç

È

É

Ê

Ë

Ì

Í

Î

Ï
D_
Ð

Ñ

Ò

Ó

Ô

Õ

Ö

×

Ø

Ù

Ú

Û

Ü

Ý

Þ

ß
E_
à

á

â

ã

ä

å

æ

ç

è

é

ê

ë

ì

í

î

ï
F_
ð

ñ

ò

ó

ô

õ

ö

÷

ø

ù

ú

û

ü

ý

þ

ÿ

The basic idea is 0x20 through 0x5F is all of the old 6-dot standard. We capitalize all the letters by turning on dot 7. Then we copy the lower half of it down to 0x00 to 0x1F, which is mostly control sequences and unprintable obsolete codes, with dot 7 toggled. A similar thing is done with the top half. The top-half is copied into 0x60 to 0x7F, with dot7 toggled. And then DEL and underscore are swapped, so that everything in the old 6-dot standard is a visible character on a qwerty keyboard. After this is done, an exact copy is made into 0x80 and dot 8 is enabled. Roughly, this is 7-dot Braille over Printable ASCII. Codes with a dot 8 are more useful for helping with input than with output.

Build and run

./clean  # remove all of the build turds. some things do not work without a clean build
./build  # final build artifacts: test.pdf and c8brl.pdf

If it worked, then test.pdf will have a paragraph of Braille in it.

gilgameshprologue.png

TODO: I do not yet know how to convert this to web fonts, where you can make Javascript and HTML apps that show text in computer braille, yet copy/paste as normal ASCII. The Braille font is just plaintext that looks like Braille, which is completely different from Unicode Braille characters.

When working in 6-dot braille, dot 7 and dot 8 are masked off.

In computer Braille, this table is used to map a byte to Unicode Braille dots, like this:

The brascii tool comes from my repo: rfielding/brailleTools in the cmd/brascii directory. It is main.go compiled. Think of it as liblouis lou_translate command, but only for 8-dot Computer Braille.

echo Phone | brascii
⡏⠓⠕⠝⠑

But in UEB, the mapping is not one-to-one. A sequence of dots will coincidentally map to something in the 6-dot range.

(base) >echo 'Ph"O' | brascii -sixdot
⠏⠓⠐⠕

That is the word "Phone" written in contracted UEB, spelled like "Ph[One]", UEB is a shortcut language for a roughly 20% reduction in the number of characters typed. It is the standard for English Braille, but most Braille Displays boot up using Computer Braille, which is what the table at the top of this document describes. The main reason to use contracted braille is to stay within 6-dots. But because 6 dots cannot hold enough information to represent 7-bit ASCII, a stream of Braille characters will cause most punctuation to take multiple cells.

viaheyor.png

Note this bit from Genesis, how many words can be represented in one letter. This is not typical. Braille appears to have specifically used Genesis as a test of compressing down Braille. The word "Spirit" is one of the words deemed common enough to have an abbreviation.

mf's People

Contributors

rfielding avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.