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, write to the
25 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 * Boston, MA 02111-1307, USA.
29 #ifndef __THAI_CHARPROP_H__
30 #define __THAI_CHARPROP_H__
34 #define isthai(wc) (0x0E00 <= (wc) && (wc) < 0x0E60)
35 #define islao(wc) (0x0E80 <= (wc) && (wc) < 0x0EE0)
37 * Lao: [0x0E80..0x0EDF] -> [0x20..0x7F]
38 * Thai: [0x0E00..0x0E5F] -> [0xA0..0xFF]
40 #define ucs2tis(wc) (((wc) - 0x0E00 + 0x20)^0x80)
42 /* Define TACTIS character classes */
76 #define NoTailCons _NC
77 #define UpTailCons _UC
78 #define BotTailCons _BC
79 #define SpltTailCons _SC
80 #define Cons (NoTailCons|UpTailCons|BotTailCons|SpltTailCons)
81 #define AboveVowel _AV
82 #define BelowVowel _BV
88 #define is_char_type(wc, mask) (thai_char_type[ucs2tis ((wc))] & (mask))
89 #define TAC_char_class(wc) \
90 (isthai(wc)||islao(wc) ? thai_TAC_char_class[ucs2tis (wc)] : NON)
91 #define TAC_compose_input(wc1,wc2) \
92 thai_TAC_compose_input[TAC_char_class(wc1)][TAC_char_class(wc2)]
94 extern const gshort thai_char_type[256];
95 extern const gshort thai_TAC_char_class[256];
96 extern const gchar thai_TAC_compose_input[20][20];
98 #endif /* __THAI_CHARPROP_H__ */