// Lookup tables for Text Compaction (ISO/IEC 15438 4.4.2).
//
// Text Compaction encodes characters into values 0..29 and packs two values
// into one codeword (`value * 30 + value`). Alpha and Lower sub-modes are
// computed arithmetically; Mixed and Punctuation need the literal tables
// below. Both tables are given as the *value assigned to each character*,
// indexed by character code 0..255, with -1 for characters that the sub-mode
// cannot represent.
///|
/// Text Compaction Mixed sub-mode: value of each character, -1 if absent.
pub let mixed_value : Array[Int] = [
-1, -1, -1, -1, -1, -1, -1, -1, -1, 12, -1, -1, -1, 11, -1, -1, // 0..15
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 16..31
26, -1, -1, 15, 18, 21, 10, -1, -1, -1, 22, 20, 13, 16, 17, 19, // 32..47
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14, -1, -1, 23, -1, -1, // 48..63
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 64..79
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 24, -1, // 80..95
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 96..111
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 112..127
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 128..143
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 144..159
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 160..175
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 176..191
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 192..207
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 208..223
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 224..239
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 240..255
]
///|
/// Text Compaction Punctuation sub-mode: value of each character, -1 if
/// absent.
pub let punctuation_value : Array[Int] = [
-1, -1, -1, -1, -1, -1, -1, -1, -1, 12, 15, -1, -1, 11, -1, -1, // 0..15
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 16..31
-1, 10, 20, -1, 18, -1, -1, 28, 23, 24, 22, -1, 13, 16, 17, 19, // 32..47
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, 0, 1, -1, 2, 25, // 48..63
3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 64..79
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, 7, // 80..95
8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 96..111
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 21, 27, 9, -1, // 112..127
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 128..143
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 144..159
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 160..175
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 176..191
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 192..207
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 208..223
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 224..239
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 240..255
]
///|
/// Inverse of `mixed_value`: value 0..29 -> character code, -1 if unused.
pub let mixed_char : Array[Int] = [
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 38, 13, 9, 44, 58, 35, // 0..15
45, 46, 36, 47, 43, 37, 42, 61, 94, -1, 32, -1, -1, -1, -1, -1, // 16..31
]
///|
/// Inverse of `punctuation_value`: value 0..29 -> character code, -1 if
/// unused.
pub let punctuation_char : Array[Int] = [
59, 60, 62, 64, 91, 92, 93, 95, 96, 126, 33, 13, 9, 44, 58, 10, // 0..15
45, 46, 36, 47, 34, 124, 42, 40, 41, 63, 123, 125, 39, -1, -1, -1, // 16..31
]
///|
/// Text Compaction shift/latch codes.
pub let tc_alpha_to_lower : Int = 27
///|
pub let tc_alpha_to_mixed : Int = 28
///|
pub let tc_alpha_to_punct : Int = 29
///|
pub let tc_lower_to_alpha : Int = 27
///|
pub let tc_lower_to_mixed : Int = 28
///|
pub let tc_lower_to_punct : Int = 29
///|
pub let tc_mixed_to_alpha : Int = 28
///|
pub let tc_mixed_to_lower : Int = 27
///|
pub let tc_mixed_to_punct_latch : Int = 25
///|
pub let tc_mixed_to_punct_shift : Int = 29
///|
pub let tc_punct_to_alpha : Int = 29
///|
/// Value substituted for a trailing space in Text Compaction.
pub let tc_text_pad : Int = 29