# liblouis: Arabic Computer Braille table

# Based on the official Unified Arabic Braille Project website
# <https://mip.qa/braille>: a comprehensive resource containing all
# details about Arabic braille, including complete references,
# tutorials and awareness articles. It also provides a platform for
# suggestions and comments to improve Arabic braille further.

# Copyright (C) 2018, 2021 by Ikrami Ahmad <ikrami.ahmad@gmail.com>
# Copyright (C) 2020 Mada, Qatar Assistive Technology Center <Braille@mada.org.qa>

# This file is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.

# This file 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
# Lesser General Public License for more details.

# You should have received a copy of the GNU Lesser General Public
# License along with this file; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

#-index-name: Arabic, computer
#-display-name: Arabic computer braille
#-author: Ikrami Ahmad <ikrami.ahmad@gmail.com>
# with assistance from Hatoon Felemban <h.felemban@hotmail.com>

#+language: ar
#+type: computer
#+dots: 8
# Marked as "direction:both" by Bue Vester-Andersen
# as tests run both forward and backward
#+direction: both

include text_nabcc.dis All display opcodes
include braille-patterns.cti # unicode braille.

space \s 0 blank
space \t 0 tab
space \x000A 0
space \x000D 0

# Arabic characters
letter ء 3 # arabic individual hamza (\x0621)
letter آ 345 # arabic alef madd (\x0622)
letter أ 34 # arabic hamza above alef (\x0623)
letter ؤ 1256 # arabic hamza on waw (\x0624)
letter إ 46 # arabic hamza below alef (\x0625)
letter ئ 13456 # arabic hamza on iaa (\x0626)
letter ا 1 # arabic Alef (\x0626)
letter ب 12 # arabic baa (\x0628)
letter ة 16 # arabic taa marbuta (\x0629)
letter ث 1456 # arabic thaa (\x062B)
letter ت 2345 # arabic Taa (\x062A)
letter ج 245 # arabic jeem (\x062C)
letter ح 156 # arabic strong haa (\x062D)
letter خ 1346 # arabic Khaa (\x062E)
letter د 145 # arabic dal (\x062F)
letter ذ 2346 # arabic thal (\x0630)
letter ر 1235 # arabic raa (\x0631)
letter ز 1356 # arabic zaai (\x0632)
letter س 234 # arabic seen (\x0633)
letter ش 146 # arabic sheen (\x0634)
letter ص 12346 # arabic saad (\x0635)
letter ض 1246 # arabic dhaad (\x0636)
letter ط 23456 # arabic strong taa (\x0637)
letter ظ 123456 # arabic strong thaa (\x0638)
letter ع 12356 # arabic ayn (\x0639)
letter غ 126 # arabic ghayn (\x063A)
letter ف 124 # arabic faa (\x0641)
letter ق 12345 # arabic strong qaaf (\x0642)
letter ك 13 # arabic kaaf (\x0643)
letter ل 123 # arabic laam (\x0644)
letter م 134 # arabic meem (\x0645)
letter ن 1345 # arabic noon (\x0646)
letter ه 125 # arabic soft haa (\x0647)
letter و 2456 # arabic waaw (\x0648)
letter ى 135 # arabic alef maqsoora (\x0649)
letter ي 24 # arabic iaa (\x064A)
letter َ 2 # arabic diacritic symbol fathah (\x064E)
letter ِ 15 # arabic diacritic symbol kasrah (\x0650)
letter ً 23 # arabic diacritic symbol tanween fath (\x064B)
letter ٌ 26 # arabic diacritic symbol tanween dham (\x064C)
letter ٍ 35 # arabic diacritic symbol tanween kasr (\x064D)
letter ُ 136 # arabic diacritic symbol dhamma (\x064F)
letter ّ 6 # arabic diacritic symbol shadda (\x0651)
letter ْ 25  v# arabic diacritic symbol sukoon (\x0652)
sign ـ 5-25 # arabic tatweel (\x0640)
always \x0644\x0627 1236 # to join lam and alef together in one cell if they come in one word
midendword \x0651 6 # to indicate that Shadda can never come at the beginning of a word

#additional forms
noback letter \x067E 12 #Arabic letter Peh
noback letter \x0686 245 # arabic letter gtcheh چ
noback letter \x06a4 124 # arabic letter Veh ڤ
noback letter \x06af 13 # arabic letter gaf گ
noback letter \x0698 1356 # arabic letter zhi

#the following to correct Shadda symbol, which should be written before the character in Arabic braille code. this will consists of every arabic character followed by the Shadda diacritic symbol, and a dot pattern of the braille shadda followed by the character.
noback always ءّ 6-3
noback always آّ 6-345
noback always أّ 6-34
noback always ؤّ 6-1256
noback always إّ 6-46
noback always ئّ 6-13456
noback always اّ 6-1
noback always بّ 6-12
noback always ةّ 6-16
noback always ثّ 6-1456
noback always تّ 6-2345
noback always جّ 6-245
noback always حّ 6-156
noback always خّ 6-1346
noback always دّ 6-145
noback always ذّ 6-2346
noback always رّ 6-1235
noback always زّ 6-1356
noback always سّ 6-234
noback always شّ 6-146
noback always صّ 6-12346
noback always ضّ 6-1246
noback always طّ 6-23456
noback always ظّ 6-123456
noback always عّ 6-12356
noback always غّ 6-126
noback always فّ 6-124
noback always قّ 6-12345
noback always كّ 6-13
noback always لّ 6-123
noback always مّ 6-134
noback always نّ 6-1345
noback always هّ 6-125
noback always وّ 6-2456
noback always يّ 6-24
noback always لاّ 6-1236

# Latin numerals
digit 0 2458
digit 1 18
digit 2 128
digit 3 148
digit 4 1458
digit 5 158
digit 6 1248
digit 7 12458
digit 8 1258
digit 9 248

# Arabic numerals
digit \x0660 2458 # 0 (٠)
digit \x0661 18 # 1 (١)
digit \x0662 128 # 2 (٢)
digit \x0663 148 # 3 (٣)
digit \x0664 1458 # 4 (٤)
digit \x0665 158 # 5 (٥)
digit \x0666 1248 # 6 (٦)
digit \x0667 12458 # 7 (٧)
digit \x0668 1258 # 8 (٨)
digit \x0669 248 # 9 (٩)

# English letters backward translation only
nofor lowercase a 178
nofor lowercase b 1278
nofor lowercase c 1478
nofor lowercase d 14578
nofor lowercase e 1578
nofor lowercase f 12478
nofor lowercase g 124578
nofor lowercase h 12578
nofor lowercase i 2478
nofor lowercase j 24578
nofor lowercase k 1378
nofor lowercase l 12378
nofor lowercase m 13478
nofor lowercase n 134578
nofor lowercase o 13578
nofor lowercase p 123478
nofor lowercase q 1234578
nofor lowercase r 123578
nofor lowercase s 23478
nofor lowercase t 234578
nofor lowercase u 13678
nofor lowercase v 123678
nofor lowercase w 245678
nofor lowercase x 134678
nofor lowercase y 1345678
nofor lowercase z 135678
nofor uppercase A 17
nofor uppercase B 127
nofor uppercase C 147
nofor uppercase D 1457
nofor uppercase E 157
nofor uppercase F 1247
nofor uppercase G 12457
nofor uppercase H 1257
nofor uppercase I 247
nofor uppercase J 2457
nofor uppercase K 137
nofor uppercase L 1237
nofor uppercase M 1347
nofor uppercase N 13457
nofor uppercase O 1357
nofor uppercase P 12347
nofor uppercase Q 123457
nofor uppercase R 12357
nofor uppercase S 2347
nofor uppercase T 23457
nofor uppercase U 1367
nofor uppercase V 12367
nofor uppercase W 24567
nofor uppercase X 13467
nofor uppercase Y 134567
nofor uppercase Z 13567

#punctuation symbols
punctuation ، 57 # Arabic comma (\x060C)
punctuation \x061B 567 # Arabic semiColon
punctuation ; 567
punctuation : 257
punctuation \x061F 236 # arabic question mark ؟
punctuation ? 236
noback punctuation \x06D4 256 # Arabic Full stop
punctuation . 256
punctuation , 27
punctuation ! 235
punctuation " 2356
sign # 3456
punctuation % 1468
sign & 123467
noback punctuation ' 3 # apostrophe
nofor punctuation ' 37 # apostrophe
punctuation ) 3568
punctuation ( 2367
sign * 358
math + 2358
math \x2212 368 # − minus
math \x00D7 2368 # × multiplication sign
math \x00F7 2568 # ÷ division sign
math > 1358
math < 2468
math / 348
math = 235678
punctuation - 36
sign @ 47
punctuation ‘ 378
punctuation ’ 678
punctuation [ 123567
sign \\ 347
punctuation ] 234568
sign ^ 23468
sign _ 4567
sign ` 34578 # grave accent
punctuation { 23567
sign | 12568
punctuation } 23568
math ~ 3458
space \x00A0 0 # no-break space
punctuation \x00Ad 36 # soft hyphen
punctuation « 1234567 # left-pointing double angle quotation mark
punctuation » 1234568 # right-pointing double angle quotation mark
punctuation \x2018 2356 # smart single left quotation mark
punctuation \x2019 2356 # smart single right quotation mark
punctuation \x201C 2356 # smart opening double quote
punctuation \x201D 2356 # smart closing double quote
punctuation \x201E 2356 # smart double low quotation mark
punctuation \x201F 2356 # smart double high reverse quotation mark

sign \x00BF 236 # inverted question mark
sign \x200C 9 # ZERO WIDTH NON-JOINER
punctuation \x2010 36 # hyphen
punctuation \x2011 36 #  non-breaking hyphen
punctuation \x2013 5-36  # en dash
punctuation \x2026 25678 # smart ellipsis

# adding the standard 8-dot latin letters for proper forward translation
include latinLetterDef8Dots.uti

sign $ 12468
sign \x20AC 4-15 # Euro sign
sign \x00A2 12467 # ¢ cents sign
sign \x00A3 4-123 # £ pounds sign
sign \x00A5 4-13456 # ¥ yen sign
sign \x00A7 2348 # section sign §
sign \x00A9 123468 # © copyright sign
sign \x00AE 12358 # ® Registered mark
sign \x00B0 123458 # ° degrees sign
sign \x00B5 1348 # µ micro sign
sign \x00B6 12348 # ¶ pilcrow sign

include countries.cti
