4 * Copyright (C) 1999 Red Hat Software
5 * Author: Owen Taylor <otaylor@redhat.com>
7 * Software and Language Engineering Laboratory, NECTEC
8 * Author: Theppitak Karoonboonyanan <thep@links.nectec.or.th>
10 * Copyright (c) 1996-2000 by Sun Microsystems, Inc.
11 * Author: Chookij Vanatham <Chookij.Vanatham@Eng.Sun.COM>
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
27 #ifndef __THAI_CHARPROP_H__
28 #define __THAI_CHARPROP_H__
32 #define isthai(wc) (0x0E00 <= (wc) && (wc) < 0x0E60)
33 #define islao(wc) (0x0E80 <= (wc) && (wc) < 0x0EE0)
35 * Lao: [0x0E80..0x0EDF] -> [0x20..0x7F]
36 * Thai: [0x0E00..0x0E5F] -> [0xA0..0xFF]
38 #define ucs2tis(wc) (((wc) - 0x0E00 + 0x20)^0x80)
40 /* Define TACTIS character classes */
74 #define NoTailCons _NC
75 #define UpTailCons _UC
76 #define BotTailCons _BC
77 #define SpltTailCons _SC
78 #define Cons (NoTailCons|UpTailCons|BotTailCons|SpltTailCons)
79 #define AboveVowel _AV
80 #define BelowVowel _BV
86 #define is_char_type(wc, mask) (thai_char_type[ucs2tis ((wc))] & (mask))
87 #define TAC_char_class(wc) \
88 (isthai(wc)||islao(wc) ? thai_TAC_char_class[ucs2tis (wc)] : NON)
89 #define TAC_compose_input(wc1,wc2) \
90 thai_TAC_compose_input[TAC_char_class(wc1)][TAC_char_class(wc2)]
92 extern const gshort thai_char_type[256];
93 extern const gshort thai_TAC_char_class[256];
94 extern const gchar thai_TAC_compose_input[20][20];
96 #endif /* __THAI_CHARPROP_H__ */