# mds — A micro-display server
# Copyright © 2014, 2015 Mattias Andrée (maandree@member.fsf.org)
#
# 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 3 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 this program. If not, see .
# Based on the Unicode Character Database 7.0
# If we are compile this file as a stand-alone file we will pretend
# that the keyboard already have basic latin latters so can create a
# complete compose table from those symbols without getting a lot of
# warnings about those symbols not being available. We will also
# assume that we have the basic modifiers.
assumption
have_range "a" "z"
have_range "A" "Z"
have_range "0" "9"
have_chars " !\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"
have
have
have
have
have
end assumption
macro dead_ascii/1
[" " ] : "\1"
"\1" :
end macro
macro dead_ascii/2
[" " "\2" ] : "\1"
["\1" "\2"] :
end macro
macro composite/3
"\1" : "\3"
"\1" ["\2" ] : "\3"
end macro
macro composite/4
"\1" : "\4"
"\1" ["\2" "\3"] : "\4"
end macro
"-" :
"." :
dead_ascii("˙")
macro macron/2
composite("¯" "\1" "\2")
end macro
macro breve/2
composite("˘" "\1" "\2")
end macro
macro ogonek/2
composite("˛" "\1" "\2")
end macro
macro tilde/2
composite("~" "\1" "\2")
composite("˜" "\1" "\2")
end macro
macro grave/2
composite("`" "\1" "\2")
end macro
macro acute/2
composite("´" "'" "\1" "\2")
end macro
macro circumflex/2
composite("^" "\1" "\2")
end macro
macro dot_above/2
composite("˙" "." "\1" "\2")
end macro
macro caron/2
composite("ˇ" "\1" "\2")
end macro
macro stroke/2
composite("-" "\1" "\2")
end macro
macro cedilla/2
composite("¸" "," "\1" "\2")
end macro
macro middle_dot/2
dot_above("\1" "\2")
end macro
macro slash/2
composite("/" "\1" "\2")
end macro
macro double_acute/2
composite("˝" "\1" "\2")
end macro
macro ring_above/2
composite("°" "\1" "\2")
composite("˚" "\1" "\2")
end macro
macro diaeresis/2
composite("¨" "\"" "\1" "\2")
end macro
# TODO hook
# TODO topbar
# TODO double_grave
# TODO inverted_breve
"u" "+" :
"U" "+" :
# TODO C0 Controls
# Basic Latin:
dead_ascii("^")
dead_ascii("`")
dead_ascii("~")
# TODO C1 Controls
# Latin-1 Supplement:
"!" "!" : "¡"
("/" "c") : "¢"
("|" ["c" "L"]) : "¢"
("-" ["l" "L"]) : "£"
(["o" "O"] ["x" "X"]) : "¤"
(["-" "="] ["y" "Y"]) : "¥"
("!" "|") : "¦"
(["o" "O"] ["s" "S"]) : "§"
dead_ascii("¨" "\"")
(["o" "O"] ["c" "C"]) : "©"
( ) "_" "a" : "ª"
"<" "<" : "«"
("-" ",") : "¬"
"-" "-" : ""
(["o" "O"] ["r" "R"]) : "®"
"-" :
"o" :
dead_ascii("°")
"+" "-" : "±"
"2" : "²"
"3" : "³"
dead_ascii("´" "'")
"m" "u" : "µ"
["p" "P"] ["p" "P" "!"] : "¶"
"!" ["p" "P"] : "¶"
"." "-" : "·"
dead_ascii("," ",")
"1" : "¹"
( ) "_" "o" : "º"
">" ">" : "»"
"1" "4" : "¼"
"1" "2" : "½"
"3" "4" : "¾"
"?" "?" : "¿"
grave("A" "À")
acute("A" "Á")
tilde("A" "Ã")
diaeresis("A" "Ä")
ring_above("A" "Å")
"A" "E" : "Æ"
cedilla("C" "Ç")
grave("E" "È")
acute("E" "É")
circumflex("E" "Ê")
diaeresis("E" "Ë")
grave("I" "Ì")
acute("I" "Í")
circumflex("I" "Î")
diaeresis("I" "Ï")
"/" :
slash("D" "Đ")
tilde("N" "Ñ")
grave("O" "Ò")
acute("O" "Ó")
circumflex("O" "Ô")
tilde("O" "Õ")
diaeresis("O" "Ö")
"x" "x" : "×"
slash("O" "Ø")
grave("U" "Ù")
acute("U" "Ú")
circumflex("U" "Û")
diaeresis("U" "Ü")
acute("Y" "Ý")
"T" "H" : "Þ"
"s" "s" : "ß"
"ſ" "s" : "ß"
grave("a" "à")
acute("a" "á")
tilde("a" "ã")
diaeresis("a" "ä")
ring_above("a" "å")
"a" "e" : "æ"
cedilla("c" "ç")
grave("e" "è")
acute("e" "é")
circumflex("e" "ê")
diaeresis("e" "ë")
grave("i" "ì")
acute("i" "í")
circumflex("i" "î")
diaeresis("i" "ï")
slash("d" "ð")
tilde("n" "ñ")
grave("o" "ò")
acute("o" "ó")
circumflex("o" "ô")
tilde("o" "õ")
diaeresis("o" "ö")
":" "-" : "÷"
slash("o" "ø")
grave("u" "ù")
acute("u" "ú")
circumflex("u" "û")
diaeresis("u" "ü")
acute("y" "ý")
"t" "h" : "þ"
diaeresis("y" "ÿ")
# Latin Extended-A:
macron("A" "Ā")
macron("a" "ā")
breve("A" "Ă")
breve("a" "ă")
ogonek("A" "Ą")
ogonek("a" "ą")
acute("C" "Ć")
acute("c" "ć")
circumflex("C" "Ĉ")
circumflex("c" "ĉ")
dot_above("C" "Ċ")
dot_above("c" "ċ")
dot_above("D" "Ď")
dot_above("d" "ď")
stroke("D" "Đ")
stroke("d" "đ")
macron("E" "Ē")
macron("e" "ē")
breve("E" "Ĕ")
breve("e" "ĕ")
dot_above("E" "Ė")
dot_above("e" "ė")
ogonek("E" "Ę")
ogonek("e" "ę")
caron("E" "Ě")
caron("e" "ě")
circumflex("G" "Ĝ")
circumflex("g" "ĝ")
breve("G" "Ğ")
breve("g" "ğ")
dot_above("G" "Ġ")
dot_above("g" "ġ")
cedilla("G" "Ģ")
cedilla("g" "ģ")
circumflex("H" "Ĥ")
circumflex("h" "ĥ")
stroke("H" "Ħ")
stroke("h" "ħ")
tilde("I" "Ĩ")
tilde("i" "ĩ")
macron("I" "Ī")
macron("i" "ī")
breve("I" "Ĭ")
breve("i" "ĭ")
ogonek("I" "Į")
ogonek("i" "į")
dot_above("I" "İ")
dot_above("i" "ı")
"I" "J" : "IJ"
"i" "j" : "ij"
circumflex("J" "Ĵ")
circumflex("j" "ĵ")
cedilla("K" "Ķ")
cedilla("k" "ķ")
"k" "k" : "ĸ"
acute("L" "Ĺ")
acute("l" "ĺ")
cedilla("L" "Ļ")
cedilla("l" "ļ")
caron("L" "Ľ")
caron("l" "ľ")
middle_dot("L" "Ŀ")
middle_dot("l" "ŀ")
slash("L" "Ł")
slash("l" "ł")
acute("N" "Ń")
acute("n" "ń")
cedilla("N" "Ņ")
cedilla("n" "ņ")
caron("N" "Ň")
caron("n" "ň")
# ʼn has been deprecated
"N" ["G" "g"] : "Ŋ"
"n" "g" : "ŋ"
macron("O" "Ō")
macron("o" "ō")
breve("O" "Ŏ")
breve("o" "ŏ")
double_acute("O" "Ő")
double_acute("o" "ő")
"O" "E" : "Œ"
"o" "e" : "œ"
acute("R" "Ŕ")
acute("r" "ŕ")
cedilla("R" "Ŗ")
cedilla("r" "ŗ")
caron("R" "Ř")
caron("r" "ř")
acute("S" "Ś")
acute("s" "ś")
circumflex("S" "Ŝ")
circumflex("s" "ŝ")
cedilla("S" "Ş")
cedilla("s" "ş")
caron("S" "Š")
caron("s" "š")
cedilla("T" "Ţ")
cedilla("t" "ţ")
caron("T" "Ť")
caron("t" "ť")
stroke("T" "Ŧ")
stroke("t" "ŧ")
tilde("U" "Ũ")
tilde("u" "ũ")
macron("U" "Ū")
macron("u" "ū")
breve("U" "Ŭ")
breve("u" "ŭ")
ring_above("U" "Ů")
ring_above("u" "ů")
double_acute("U" "Ű")
double_acute("u" "ű")
ogonek("U" "Ų")
ogonek("u" "ų")
circumflex("W" "Ŵ")
circumflex("w" "ŵ")
circumflex("Y" "Ŷ")
circumflex("y" "ŷ")
diaeresis("Y" "Ÿ")
acute("Z" "Ź")
acute("z" "ź")
dot_above("Z" "Ż")
dot_above("z" "ż")
caron("Z" "Ž")
caron("z" "ž")
"s" "f" : "ſ"
# Latin Extended-B:
stroke("b" "ƀ")
hook("B" "Ɓ")
topbar("B" "Ƃ")
topbar("b" "ƃ")
# TODO (Ƅ) latin capital letter tone six
# TODO (ƅ) latin small letter tone six
# TODO (Ɔ) latin captial letter open o
hook("C" "Ƈ")
hook("c" "ƈ")
# TODO (Ɖ) latin captial letter african d
hook("D" "Ɗ")
topbar("D" "Ƌ")
topbar("d" "ƌ")
# TODO (ƍ) latin small letter turned delta
# TODO (Ǝ) latin capital letter reversed e
# TODO (Ə) latin capital letter schwa
# TODO (Ɛ) latin capital letter open e
hook("F" "Ƒ")
hook("f" "ƒ")
hook("G" "Ɠ")
# TODO (Ɣ) latin capital letter gamma
"h" "v" : "ƕ"
# TODO (Ɩ) latin capital letter iota
stroke("I" "Ɨ")
hook("K" "Ƙ")
hook("k" "ƙ")
# TODO (ƚ) latin small letter l with bar
# TODO (ƛ) latin small letter lambda with stroke
# TODO (Ɯ) latin capital letter turned m
# TODO (Ɲ) latin capital letter n with left hook
# TODO (ƞ) latin small letter n with long right leg
# TODO (Ɵ) latin capital letter o with middle tilde
# TODO (Ơ) latin capital letter o with horn
# TODO (ơ) latin small letter o with horn
"O" ["I" "i"] : "Ƣ"
"o" "i" : "ƣ"
hook("P" "Ƥ")
hook("p" "ƥ")
["Y" "y"] ["R" "r"] : "Ʀ"
# TODO (Ƨ) latin capital letter tone two
# TODO (ƨ) latin small letter tone two
# TODO (Ʃ) latin capital letter esh
# TODO (ƪ) latin letter reversed esh loop
# TODO (ƫ) latin small letter t with palatal hook
hook("T" "Ƭ")
hook("t" "ƭ")
# TODO (Ʈ) latin capital letter t with retroflex hook
hook("U" "Ư")
hook("u" "ư")
# TODO (Ʊ) latin capital letter upsilon
hook("V" "Ʋ")
hook("Y" "Ƴ")
hook("y" "ƴ")
stroke("Z" "Ƶ")
stroke("z" "ƶ")
# TODO (Ʒ) latin capital letter ezh
# TODO (Ƹ) latin capital letter ezh reversed
# TODO (ƹ) latin small letter ezh reversed
# TODO (ƺ) latin small letter ezh with tail
# TODO (ƻ) latin letter two with stroke
# TODO (Ƽ) latin capital letter tone five
# TODO (ƽ) latin small letter tone five
# TODO (ƾ) latin letter inverted glottal stop with stroke
# TODO (ƿ) latin letter wynn
# TODO (ǀ) latin letter dental click
# TODO (ǁ) latin letter lateral click
# TODO (ǂ) latin letter alveolar click
# TODO (ǃ) latin letter retroflex click
# TODO (DŽ) latin capital letter dz with caron (dŽ caron(DZ))
# TODO (Dž) latin capital letter d with small letter z with caron (Dž caron(Dz))
# TODO (dž) latin small letter dz with caron (dž caron(dz))
"L" "J" : "LJ"
"L" "j" : "Lj"
"l" "j" : "lj"
"N" "J" : "NJ"
"N" "j" : "Nj"
"n" "j" : "nj"
caron("A" "Ǎ")
caron("a" "ǎ")
caron("I" "Ǐ")
caron("i" "ǐ")
caron("O" "Ǒ")
caron("o" "ǒ")
caron("U" "Ǔ")
caron("u" "ǔ")
# TODO (Ǖǖ) Uu diaeresis+maron
# TODO (Ǘǘ) Uu diaeresis+acute
# TODO (Ǚǚ) Uu diaeresis+caron
# TODO (Ǜǜ) Uu diaeresis+grave
# TODO (ǝ) latin small letter turned e
# TODO (Ǟǟ) Aa diaeresis+maron
# TODO (Ǡǡ) Aa dot above+maron
# TODO (Ǣǣ) Ææ maron
maron("Æ" "Ǣ")
maron("æ" "ǣ")
stroke("G" "Ǥ")
stroke("g" "ǥ")
caron("G" "Ǧ")
caron("g" "ǧ")
caron("K" "Ǩ")
caron("k" "ǩ")
ogonek("O" "Ǫ")
ogonek("o" "ǫ")
# TODO (Ǭǭ) Oo ogonek+macron
# TODO (Ǯ) latin capital letter ezh with caron
# TODO (ǯ) latin small letter ezh with caron
caron("j" "ǰ")
"D" "Z" : "DZ"
"D" "z" : "Dz"
"d" "z" : "dz"
acute("G" "Ǵ")
acute("g" "ǵ")
"H" ["V" "v"] : "Ƕ"
# TODO (Ƿ) latin capital letter wynn
grave("N" "Ǹ")
grave("n" "ǹ")
acute("Å" "Ǻ") # TODO latin capital letter a with ring above and acute
acute("å" "ǻ") # TODO latin small letter a with ring above and acute
acute("Æ" "Ǽ") # TODO latin capital letter ae with acute
acute("æ" "ǽ") # TODO latin small letter ae with acute
acute("Ø" "Ǿ") # TODO latin capital letter o with stroke and acute
acute("ø" "ǿ") # TODO latin small letter o with stroke and acute
double_grave("A" "Ȁ")
double_grave("a" "ȁ")
inverted_breve("A" "Ȃ")
inverted_breve("a" "ȃ")
double_grave("E" "Ȅ")
double_grave("e" "ȅ")
inverted_breve("E" "Ȇ")
inverted_breve("e" "ȇ")
double_grave("I" "Ȉ")
double_grave("i" "ȉ")
inverted_breve("I" "Ȋ")
inverted_breve("i" "ȋ")
double_grave("O" "Ȍ")
double_grave("o" "ȍ")
inverted_breve("O" "Ȏ")
inverted_breve("o" "ȏ")
double_grave("R" "Ȑ")
double_grave("r" "ȑ")
inverted_breve("R" "Ȓ")
inverted_breve("r" "ȓ")
double_grave("U" "Ȕ")
double_grave("u" "ȕ")
inverted_breve("U" "Ȗ")
inverted_breve("u" "ȗ")
# TODO (Ș) latin capital letter s with comma below
# TODO (ș) latin small letter s with comma below
# TODO (Ț) latin capital letter t with comma below
# TODO (ț) latin small letter t with comma below
# TODO (Ȝ) latin capital letter yogh
# TODO (ȝ) latin small letter yogh
caron("H" "Ȟ")
caron("h" "ȟ")
# TODO (Ƞ) latin capital letter n with long right leg
# TODO (ȡ) latin small letter d with curl
"O" ["U" "u"] : "Ȣ"
"o" "u" : "ȣ"
hook("Z" "Ȥ")
hook("z" "ȥ")
dot_above("A" "Ȧ")
dot_above("a" "ȧ")
cedilla("E" "Ȩ")
cedilla("e" "ȩ")
# TODO (Ȫ) latin capital letter o with diaeresis and macron
# TODO (ȫ) latin small letter o with diaeresis and macron
# TODO (Ȭ) latin capital letter o with tilde and macron
# TODO (ȭ) latin small letter o with tilde and macron
dot_above("O" "Ȯ")
dot_above("o" "ȯ")
# TODO (Ȱ) latin capital letter o with dot above and macron
# TODO (ȱ) latin small letter o with dot above and macron
macron("Y" "Ȳ")
macron("y" "ȳ")
# TODO (ȴ) latin small letter l with curl
# TODO (ȵ) latin small letter n with curl
# TODO (ȶ) latin small letter t with curl
dot_above("j" "ȷ")
"d" "b" : "ȸ"
"q" "p" : "ȹ"
stroke("A" "Ⱥ")
stroke("C" "Ȼ")
stroke("c" "ȼ")
# TODO (Ƚ) latin capital letter l with bar
# TODO (Ⱦ) latin capital letter t with diagonal stroke
# TODO (ȿ) latin small letter s with swash tail
# TODO (ɀ) latin small letter z with swash tail
# TODO (Ɂ) latin capital letter glottal stop
# TODO (ɂ) latin small letter glottal stop
stroke("B" "Ƀ")
# TODO (Ʉ) latin capital letter u bar
# TODO (Ʌ) latin capital letter turned v
stroke("E" "Ɇ")
stroke("e" "ɇ")
stroke("J" "Ɉ")
stroke("j" "ɉ")
# TODO (Ɋ) latin capital letter small q with hook tail
# TODO (ɋ) latin small letter q with hook tail
stroke("R" "Ɍ")
stroke("r" "ɍ")
stroke("Y" "Ɏ")
stroke("y" "ɏ")
# TODO IPA Extensions
# TODO Spacing Modifier Letter
# TODO Combining Diacritical Marks
# TODO Greek and Coptic
# TODO Cyrillic
# TODO Cyrillic Supplement
# TODO Armenian
# TODO Hebrew
# TODO Arabic
# TODO Syriac
# TODO Arabic Supplement
# TODO Thaana
# TODO NKo
# TODO Samaritan
# TODO Mandaic
# TODO Arabic Extended-A
# TODO Devanagari
# TODO Bengali
# TODO Gurmukhi
# TODO Gujarati
# TODO Oriya
# TODO Tamil
# TODO Telugu
# TODO Kannada
# TODO Malayalam
# TODO Sinhala
# TODO Thai
# TODO Lao
# TODO Tibetan
# TODO Myanmar
# TODO Georgian
# TODO Hangul Jamo
# TODO Ethiopic
# TODO Ethiopic Supplement
# TODO Cherokee
# TODO Unified Canadian Aboriginal Syllabics
# TODO Ogham
# TODO Runic
# TODO Tagalog
# TODO Hanunoo
# TODO Buhid
# TODO Tagbanwa
# TODO Khmer
# TODO Mongolian
# TODO Unified Canadian Aboriginal Syllabics Extended
# TODO Limbu
# TODO Tai Le
# TODO New Tai Lue
# TODO Khmer Symbols
# TODO Buginese
# TODO Tai Tham
# TODO Combining Diacritical Marks Extended
# TODO Balinese
# TODO Sundanese
# TODO Batak
# TODO Lepcha
# TODO Ol Chiki
# TODO Sundanese Supplement
# TODO Vedic Extensions
# TODO Phonetic Extensions
# TODO Phonetic Extensions Supplement
# TODO Combining Diacritical Marks Supplement
# TODO Latin Extended Additional
# TODO Greek Extended
# General Punctuation:
"_" "." : "\u2000" # en quad
"_" "_" : "\u2001" # em quad
"-" "." : "\u2002" # en space
"-" "-" : "\u2003" # em space
"3" : "\u2004" # three-per-em space
"4" : "\u2005" # four-per-em space
"6" : "\u2006" # six-per-em space
"f" : "\u2007" # figure space
"." : "\u2008" # punctuation space
"t" : "\u2009" # thin space
"h" : "\u200A" # hairspace
"0" : "\u200B" # zero width space
"J" : "\u200C" # zero width non-joiner
"j" : "\u200D" # zero width joiner
"l" : "\u200E" # left-to-right mark
"r" : "\u200F" # right-to-left mark
"-" : "\u2010" # hyphen
"-" " " : "\u2011" # non-breaking hyphen
"-" "-" "f" : "\u2012" # figure dash
"-" "-" "." : "\u2013" # en dash
"-" "-" "-" : "\u2014" # em dash
"-" "-" "_" : "\u2015" # horizontal bar
"|" "|" : "\u2016" # double verical line
"-" "_" : "\u2017" # double low line
("(" "'") : "‘"
(")" "'") : "’"
("(" ",") : "‚"
(")" ",") : "‛"
("(" "\"") : "“"
(")" "\"") : "”"
("(" ";") : "„"
(")" ";") : "‟"
"+" "T" : "†"
"+" "+" "T" : "‡"
"." "." : "•"
"|" ">" : "‣"
"." "," : "\u2024" # one dot leader
"." ";" : "\u2025" # two dot leader
"." "." : "…"
"-" "." : "\u2027" # hyphenation point
"l" : "\u2028" # line separator
"p" : "\u2029" # paragraph separator
"e" "l" : "\u202A" # left-to-right embedding
"e" "r" : "\u202B" # right-to-left embedding
"e" "p" : "\u202C" # pop directional formatting
"o" "l" : "\u202D" # left-to-right override
"o" "r" : "\u202E" # right-to-left override
"m" " " : "\u202F" # narrow no-break space
"%" ["o" "."] : "‰"
"%" ["O" ":"] : "‱"
("1" ["'" "´"]) : "′"
("2" ["'" "´"]) : "″"
("3" ["'" "´"]) : "‴"
("1" "`") : "‵"
("2" "`") : "‶"
("3" "`") : "‷"
("." "^") : "‸"
("." "<") : "‹"
("." ">") : "›"
("x" "+") : "※"
"!" "!" : "‼"
"!" "?" : "‽"
"^" "_" : "‾"
("_" "u") : "‿"
("^" "u") : "⁀"
"/" "/" "." : "⁁"
"*" "*" : "⁂"
"-" "-" : "⁃"
"/" "/" : "⁄"
("[" "-") : "⁅"
("]" "-") : "⁆"
"?" "?" : "⁇"
"?" "!" : "⁈"
"!" "?" : "⁉"
("/" "7"): "⁊"
"¶" "¶" : "⁋"
("?" ["p" "P"]) : "⁋"
"(" "|" : "⁌"
"|" ")" : "⁍"
("*" ".") : "⁎"
"|" ";" : "⁏"
"(" ")" : "⁐"
("*" ":") : "⁑"
"%" "%" : "⁒"
"~" ["-" "~"] : "⁓"
"-" "~" : "⁓"
("_" "U") : "⁔"
("x" "*") : "⁕"
"." ":" : "⁖"
("4" ["'" "´"]) : "⁗"
"." ":" "." : "⁘"
":" "." ":" : "⁙"
"|" "." "." : "⁚"
"." ":" "." : "⁛"
("x" ":") : "⁜"
"|" ":" "." : "⁝"
"|" ":" ":" : "⁞"
"m" : "\u205F" # medium mathematical space
"w" : "\u2060" # word joiner
("f" " ") : "\u2061" # function application
(["x" "×" "*"] " ") : "\u2062" # invisible times
(["," "."] " ") : "\u2063" # invisible separator
("+" " ") : "\u2064" # invisible plus
"i" "l" : "\u2066" # left-to-right isolate
"i" "r" : "\u2067" # right-to-left isolate
"i" "s" : "\u2068" # first strong isolate
"i" "p" : "\u2069" # pop directional isolate
# U+206A through U+206C are deprecated
# Superscripts and Subscripts:
"0" : "⁰"
["^" ] "i" : "ⁱ"
"4" : "⁴"
"5" : "⁵"
"6" : "⁶"
"7" : "⁷"
"8" : "⁸"
"9" : "⁹"
"+" : "⁺"
"-" : "⁻"
"=" : "⁼"
"(" : "⁽"
")" : "⁾"
["^" ] "n" : "ⁿ"
dead_ascii("ˇ")
"0" : "₀"
"1" : "₁"
"2" : "₂"