# ISIRI-3342 translation tables
# By Pablo Saratxaga <pablo@mandrakesoft.com>

# As I didn't knew about any Farsi font for the console, I adapted
# a bit the Arabic font. I added the following glyphs:
# peh isolated/final on 0x8b
# peh initial/medial on 0x8c
# gaf isolated/final on 0x8d
# jeh isolated/final on 0x8e
# rial sign on 0x9c
# tcheh isolated/final on 0xa5 
# tcheh intiial/medial on 0xa7 
#
# and some more on the low 0x00-0x1f range; hoping no programe will use them:
# keheh isolated/final 0x13
# gaf initial/medial 0x16
# arabic opening double angle quotes ( >> ) 0x1a
# arabic closing double angle quotes ( << ) 0x1b
#
# There is also the problem of the two zero width chars.
# acon doesn't allow for zero width letters; so I mapped ZWNJ to espace
# and ZWJ to tatweel. Also ZWNJ is listed as "non connected" letter,
# and ZWJ as "connected with next", that gives the best output

#Code-page to font translation table
translation
  #punctuations  groub 1
    255 1
	  # ISIRI-3342 uses hard typed directional chars.
	  # so I don't define anything here; and the arabic (eg RTL) non-letter
	  # symbols will be defined the same as "non connected" letters.
	0x1f 0x1f
	
  #alphabetic
	#not connected with next  groub 3
	255 3
	0xc0 0xc2 # alef with madda above
	0xc1 0xc7 # alef
	0xcb 0xcf # dal
	0xcc 0xd0 # thal
	0xcd 0xd1 # reh
	0xce 0xd2 # zain
	0xcf 0x8e # jeh
	0xdf 0xe8 # waw
	0xf8 0xc3 # alef with hamza above
	0xf9 0xc4 # waw with hamza above
	0xfa 0xc5 # alef with hamza below
	0xfc 0xc9 # teh marbuta

	#not connected also with previous (Hamza)
	255 7
	0xc2 0xc1 # hamza

	# arabic punctuation (hard typed RTL)
	0xa0 0x20   # arabic space
	0xa1 0x20   # ZERO WIDTH NON-JOINER # FIXME: is it strong RTL ?
        0xa3 0x21   # arabic exclamation mark
        0xa4 0x9c   # Iranian monetary symbol
        0xa5 0x25   # arabic percent
        0xa6 0x2e   # arabic full stop
	0xa8 0x29   # arabic opening parenthesis	
	0xa9 0x28   # arabic closing parenthesis	
        0xaa 0x78   # arabic multiplication sign
        0xab 0x2b   # arabic plus sign
        0xac 0xba   # arabic comma
        0xad 0x2d   # arabic minus sign
        0xaf 0x2f   # arabic slash
        0xba 0x3a   # arabic colon
        0xbb 0xbb   # arabic semicolon
	0xbc 0x3c   # arabic opening angle quotation mark
        0xbd 0x3d   # arabic equal sign
	0xbe 0x3e   # arabic closing angle quotation mark
        0xbf 0xbf   # arabic question mark
	0xe2 0x5d   # arabic opening square bracket
	0xe3 0x5b   # arabic closing square bracket
	0xe4 0x7d   # arabic opening curly brace
	0xe5 0x7b   # arabic closing curly brace
	0xe6 0x1a   # arabic opening double angle quotation mark
	0xe7 0x1b   # arabic closing double angle quotation mark
	0xe8 0x2a   # arabic asterisk
	0xea 0x7c   # arabic bar
	0xeb 0x5c   # arabic backslash

	#connected with next  groub 4
	255 2
        0xa2 0xe0 # ZERO WIDTH JOINER # FIXME: is it strong RTL ?
	0xc3 0xc8 # beh
	0xc4 0x8b # peh
	0xc5 0xca # teh
	0xc6 0xcb # theh
	0xc7 0xcc # jeem
	0xc8 0xa5 # tcheh
	0xc9 0xcd # hah
	0xca 0xce # khah
	0xd0 0xd3 # seen
	0xd1 0xd4 # sheen
	0xd2 0xd5 # sad
	0xd3 0xd6 # dad
	0xd4 0xd7 # tah
	0xd5 0xd8 # zah
	0xd6 0xd9 # ain
	0xd7 0xda # ghain
	0xd8 0xe1 # feh
	0xd9 0xe2 # qaf
	0xda 0x13 # keheh # FIXME: needs better font
	0xdb 0x8d # gaf # FIXME: needs better font
	0xdc 0xe4 # lam
	0xdd 0xe5 # meem
	0xde 0xe6 # noon
	0xe0 0xe7 # heh
	0xe1 0xe9 # farsi yeh
	0xe9 0xe0 # tatweel
	0xfd 0xe3 # kaf 
	0xfb 0xc6 # yeh with hamza above
	0xfe 0xea # yeh

  #tashkil  groub 4
	255 4
	0xf0 0xab # fatha
	0xf1 0xad # kasra
	0xf2 0xac # damma
	0xf3 0xa8 # fathatan
	0xf4 0xaa # kasratan
	0xf5 0xa9 # dammatan
	0xf6 0xae # shadda
	0xf7 0xaf # sukun

  #numbers  groub 6
	255 6
	48 48 
	49 49
	50 50
	51 51
	52 52
	53 53
	54 54
	55 55
	56 56
	57 57
	58 58
        0xb0 0xb0
        0xb1 0xb1
        0xb2 0xb2
        0xb3 0xb3
        0xb4 0xb4
        0xb5 0xb5
        0xb6 0xb6
        0xb7 0xb7
        0xb8 0xb8
        0xb9 0xb9

# Those two are not numbers, but while they appear on strong RTL section;
# they are number decimal/thousands separators, and as numbers
# are always LTR, they must be of LTR type, to avoid that 2,001.04
# be displayed as 04.001,2 in RTL main mode.

	0xa7 0x2c   # arabic thousands separator
	0xae 0x2e   # arabic decimal separator

# As isiri-3342 defines ASCII chars as strong-typed LTR; I put them
# as "numbers", as numbers are that, strong typed LTR

	0x20 0x20
	0x21 0x21
	0x22 0x22
	0x23 0x23
	0x24 0x24
	0x25 0x25
	0x26 0x26
	0x27 0x27
	0x28 0x28
	0x29 0x29
	0x2a 0x2a
	0x2b 0x2b
	0x2c 0x2c
	0x2d 0x2d
	0x2e 0x2e
	0x2f 0x2f
	0x3a 0x3a
	0x3b 0x3b
	0x3c 0x3c
	0x3d 0x3d
	0x3e 0x3e
	0x3f 0x3f
	0x40 0x40
	0x41 0x41
	0x42 0x42
	0x43 0x43
	0x44 0x44
	0x45 0x45
	0x46 0x46
	0x47 0x47
	0x48 0x48
	0x49 0x49
	0x4a 0x4a
	0x4b 0x4b
	0x4c 0x4c
	0x4d 0x4d
	0x4e 0x4e
	0x4f 0x4f
	0x50 0x50
	0x51 0x51
	0x52 0x52
	0x53 0x53
	0x54 0x54
	0x55 0x55
	0x56 0x56
	0x57 0x57
	0x58 0x58
	0x59 0x59
	0x5a 0x5a
	0x5b 0x5b
	0x5c 0x5c
	0x5d 0x5d
	0x5e 0x5e
	0x5f 0x5f
	0x60 0x60
	0x61 0x61
	0x62 0x62
	0x63 0x63
	0x64 0x64
	0x65 0x65
	0x66 0x66
	0x67 0x67
	0x68 0x68
	0x69 0x69
	0x6a 0x6a
	0x6b 0x6b
	0x6c 0x6c
	0x6d 0x6d
	0x6e 0x6e
	0x6f 0x6f
	0x70 0x70
	0x71 0x71
	0x72 0x72
	0x73 0x73
	0x74 0x74
	0x75 0x75
	0x76 0x76
	0x77 0x77
	0x78 0x78
	0x79 0x79
	0x7a 0x7a
	0x7b 0x7b
	0x7c 0x7c
	0x7d 0x7d
	0x7e 0x7e

#special characters which follow the direction of writing  groub 5
	255 5

# ISIRI-3342 has all chars otherwise "neutral" doubled in two
# blocks: LTR and RTL; so this section must be empty. 

	0x1f 0x1f

  #none movable characters (graph)
	255 10
	179 0x80
	180 0x87
	0x80 0x80
	0x81 0x81
	0x82 0x82
	0x83 0x83
	0x84 0x84
	0x85 0x85
	0x86 0x86
	0x87 0x87
	0x88 0x88
	0x89 0x89
	0x8a 0x8a
end

#The four possible forms of a character
# alone first middle last [iso char num]
lforms
	0xc8 0xeb 0xeb 0xc8 # beh
	0x8b 0x8c 0x8c 0x8b # peh
	0xca 0xec 0xec 0xca
	0xcb 0xed 0xed 0xcb
	0xcc 0xee 0xee 0xcc
	0xa5 0xa7 0xa7 0xa5 # tcheh
	0xcd 0xef 0xef 0xcd
	0xce 0xf0 0xf0 0xce
	0xd3 0xf1 0xf1 0xd3
	0xd4 0xf2 0xf2 0xd4
	0xd5 0xf3 0xf3 0xd5
	0xd6 0xf4 0xf4 0xd6
# 0xd7
# 0xd8
	0xd9 0xf5 0x97 0x99
	0xda 0xf6 0x98 0x9a
	0xe1 0xf7 0xf7 0xe1
	0xe2 0xf8 0xf8 0xe2
	0x13 0xf9 0xf9 0x13 # keheh
	0x8d 0x16 0x16 0x8d # gaf
	0xe4 0xfa 0xfa 0xe4
	0xe5 0xfb 0xfb 0xe5
	0xe6 0xfc 0xfc 0xe6
	0xe7 0xfd 0x9b 0xe7
	0xe9 0xfe 0xfe 0x8f
# 0xe0 # tatweel
	0xe3 0xf9 0xf9 0xe3 # kaf
	0xc6 0xc0 0xc0 0xc6
	0xea 0xfe 0xfe 0x90
	0xab 0xab 0xdb 0xab
	0xad 0xad 0xdd 0xad
	0xac 0xac 0xdc 0xac
	0xa8 0xa8 0xbc 0xa8
	0xaa 0xaa 0xbe 0xaa
	0xa9 0xa9 0xbd 0xa9
	0xae 0xae 0xde 0xae
	0xaf 0xaf 0xdf 0xaf
	0xc2 0xc2 0x96 0x96
	0xc7 0xc7 0x9f 0x9f
	0xc3 0xc3 0x9d 0x9d
	0xc5 0xc5 0x9e 0x9e

#

end

#Braces pairs
braces
	# isiri-3342 has all brace-like chars strong typed either
	# LTR or RTL; so the pairs are identique
	# note that the values here are of glyph font, not of the charset
#	0x7b 0x7d
#	0x7d 0x7b
#	0x5b 0x5d
#	0x5d 0x5b
#	0x28 0x29
#	0x29 0x28
#	0x3c 0x3e
#	0x3e 0x3c
end

#Change characters old1,old2 if found to the pair new1,new2
#   old1 old2 new1 new2
pairs
	0xfa 0x96 0xfa 0xa2
	0xfa 0x9d 0xfa 0xa3
	0xfa 0x9e 0xfa 0xa4
	0xfa 0x9f 0xfa 0xa1
	0xd3 0x20 0x91 0x95
	0xd4 0x20 0x92 0x95
	0xd5 0x20 0x93 0x95
	0xd6 0x20 0x94 0x95
	0xd3 0xa0 0x91 0x95
	0xd4 0xa0 0x92 0x95
	0xd5 0xa0 0x93 0x95
	0xd6 0xa0 0x94 0x95
end

#hendi numbers 0-9
hendinums
	0xb0
	0xb1
	0xb2
	0xb3
	0xb4
	0xb5
	0xb6
	0xb7
	0xb8
	0xb9
end

		
