295 lines
11 KiB
C++
295 lines
11 KiB
C++
|
|
/* == Start of generated table == */
|
||
|
|
/*
|
||
|
|
* The following table is generated by running:
|
||
|
|
*
|
||
|
|
* ./gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt
|
||
|
|
*
|
||
|
|
* on files with these headers:
|
||
|
|
*
|
||
|
|
* # IndicSyllabicCategory-18.0.0.txt
|
||
|
|
* # Date: 2026-07-02, 18:58:37 GMT
|
||
|
|
* # IndicPositionalCategory-18.0.0.txt
|
||
|
|
* # Date: 2026-06-24, 13:39:21 GMT
|
||
|
|
* # Blocks-18.0.0.txt
|
||
|
|
* # Date: 2026-07-08
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include "hb.hh"
|
||
|
|
|
||
|
|
#ifndef HB_NO_OT_SHAPE
|
||
|
|
|
||
|
|
#include "hb-ot-shaper-indic.hh"
|
||
|
|
|
||
|
|
#pragma GCC diagnostic push
|
||
|
|
#pragma GCC diagnostic ignored "-Wunused-macros"
|
||
|
|
|
||
|
|
#include "hb-ot-shaper-indic-machine.hh"
|
||
|
|
#include "hb-ot-shaper-khmer-machine.hh"
|
||
|
|
#include "hb-ot-shaper-myanmar-machine.hh"
|
||
|
|
|
||
|
|
/* indic */
|
||
|
|
#define OT_X I_Cat(X)
|
||
|
|
#define OT_C I_Cat(C)
|
||
|
|
#define OT_V I_Cat(V)
|
||
|
|
#define OT_N I_Cat(N)
|
||
|
|
#define OT_H I_Cat(H)
|
||
|
|
#define OT_ZWNJ I_Cat(ZWNJ)
|
||
|
|
#define OT_ZWJ I_Cat(ZWJ)
|
||
|
|
#define OT_M I_Cat(M)
|
||
|
|
#define OT_SM I_Cat(SM)
|
||
|
|
#define OT_A I_Cat(A)
|
||
|
|
#define OT_VD I_Cat(VD)
|
||
|
|
#define OT_PLACEHOLDER I_Cat(PLACEHOLDER)
|
||
|
|
#define OT_DOTTEDCIRCLE I_Cat(DOTTEDCIRCLE)
|
||
|
|
#define OT_RS I_Cat(RS)
|
||
|
|
#define OT_MPst I_Cat(MPst)
|
||
|
|
#define OT_Repha I_Cat(Repha)
|
||
|
|
#define OT_Ra I_Cat(Ra)
|
||
|
|
#define OT_CM I_Cat(CM)
|
||
|
|
#define OT_Symbol I_Cat(Symbol)
|
||
|
|
#define OT_CS I_Cat(CS)
|
||
|
|
#define OT_SMPst I_Cat(SMPst)
|
||
|
|
/* khmer */
|
||
|
|
#define OT_VAbv K_Cat(VAbv)
|
||
|
|
#define OT_VBlw K_Cat(VBlw)
|
||
|
|
#define OT_VPre K_Cat(VPre)
|
||
|
|
#define OT_VPst K_Cat(VPst)
|
||
|
|
#define OT_Robatic K_Cat(Robatic)
|
||
|
|
#define OT_Xgroup K_Cat(Xgroup)
|
||
|
|
#define OT_Ygroup K_Cat(Ygroup)
|
||
|
|
/* myanmar */
|
||
|
|
static_assert (OT_VAbv == M_Cat(VAbv), "");
|
||
|
|
static_assert (OT_VBlw == M_Cat(VBlw), "");
|
||
|
|
static_assert (OT_VPre == M_Cat(VPre), "");
|
||
|
|
static_assert (OT_VPst == M_Cat(VPst), "");
|
||
|
|
#define OT_IV M_Cat(IV)
|
||
|
|
#define OT_As M_Cat(As)
|
||
|
|
#define OT_DB M_Cat(DB)
|
||
|
|
#define OT_GB M_Cat(GB)
|
||
|
|
#define OT_MH M_Cat(MH)
|
||
|
|
#define OT_MR M_Cat(MR)
|
||
|
|
#define OT_MW M_Cat(MW)
|
||
|
|
#define OT_MY M_Cat(MY)
|
||
|
|
#define OT_PT M_Cat(PT)
|
||
|
|
#define OT_VS M_Cat(VS)
|
||
|
|
#define OT_ML M_Cat(ML)
|
||
|
|
|
||
|
|
|
||
|
|
#define _OT_A OT_A /* 53 chars; A */
|
||
|
|
#define _OT_As OT_As /* 1 chars; As */
|
||
|
|
#define _OT_C OT_C /* 476 chars; C */
|
||
|
|
#define _OT_CM OT_CM /* 1 chars; CM */
|
||
|
|
#define _OT_CS OT_CS /* 4 chars; CS */
|
||
|
|
#define _OT_DC OT_DOTTEDCIRCLE /* 1 chars; DOTTEDCIRCLE */
|
||
|
|
#define _OT_H OT_H /* 11 chars; H */
|
||
|
|
#define _OT_M OT_M /* 144 chars; M */
|
||
|
|
#define _OT_MH OT_MH /* 1 chars; MH */
|
||
|
|
#define _OT_ML OT_ML /* 1 chars; ML */
|
||
|
|
#define _OT_MP OT_MPst /* 1 chars; MPst */
|
||
|
|
#define _OT_MR OT_MR /* 1 chars; MR */
|
||
|
|
#define _OT_MW OT_MW /* 2 chars; MW */
|
||
|
|
#define _OT_MY OT_MY /* 3 chars; MY */
|
||
|
|
#define _OT_N OT_N /* 17 chars; N */
|
||
|
|
#define _OT_GB OT_PLACEHOLDER /* 185 chars; PLACEHOLDER */
|
||
|
|
#define _OT_PT OT_PT /* 8 chars; PT */
|
||
|
|
#define _OT_R OT_Ra /* 14 chars; Ra */
|
||
|
|
#define _OT_Rf OT_Repha /* 1 chars; Repha */
|
||
|
|
#define _OT_Rt OT_Robatic /* 3 chars; Robatic */
|
||
|
|
#define _OT_SM OT_SM /* 50 chars; SM */
|
||
|
|
#define _OT_SP OT_SMPst /* 6 chars; SMPst */
|
||
|
|
#define _OT_S OT_Symbol /* 22 chars; Symbol */
|
||
|
|
#define _OT_V OT_V /* 172 chars; V */
|
||
|
|
#define _OT_VA OT_VAbv /* 18 chars; VAbv */
|
||
|
|
#define _OT_VB OT_VBlw /* 7 chars; VBlw */
|
||
|
|
#define _OT_VL OT_VPre /* 5 chars; VPre */
|
||
|
|
#define _OT_VR OT_VPst /* 13 chars; VPst */
|
||
|
|
#define _OT_VS OT_VS /* 16 chars; VS */
|
||
|
|
#define _OT_X OT_X /* 2 chars; X */
|
||
|
|
#define _OT_Xg OT_Xgroup /* 7 chars; Xgroup */
|
||
|
|
#define _OT_Yg OT_Ygroup /* 4 chars; Ygroup */
|
||
|
|
#define _OT_ZWJ OT_ZWJ /* 1 chars; ZWJ */
|
||
|
|
#define _OT_ZWNJ OT_ZWNJ /* 1 chars; ZWNJ */
|
||
|
|
|
||
|
|
#define _POS_T POS_ABOVE_C /* 22 chars; ABOVE_C */
|
||
|
|
#define _POS_A POS_AFTER_MAIN /* 5 chars; AFTER_MAIN */
|
||
|
|
#define _POS_AP POS_AFTER_POST /* 50 chars; AFTER_POST */
|
||
|
|
#define _POS_AS POS_AFTER_SUB /* 51 chars; AFTER_SUB */
|
||
|
|
#define _POS_C POS_BASE_C /* 853 chars; BASE_C */
|
||
|
|
#define _POS_BS POS_BEFORE_SUB /* 25 chars; BEFORE_SUB */
|
||
|
|
#define _POS_B POS_BELOW_C /* 13 chars; BELOW_C */
|
||
|
|
#define _POS_X POS_END /* 71 chars; END */
|
||
|
|
#define _POS_R POS_POST_C /* 13 chars; POST_C */
|
||
|
|
#define _POS_L POS_PRE_C /* 5 chars; PRE_C */
|
||
|
|
#define _POS_LM POS_PRE_M /* 14 chars; PRE_M */
|
||
|
|
#define _POS_SM POS_SMVD /* 130 chars; SMVD */
|
||
|
|
|
||
|
|
#pragma GCC diagnostic pop
|
||
|
|
|
||
|
|
#define INDIC_COMBINE_CATEGORIES(S,M) ((S) | ((M) << 8))
|
||
|
|
|
||
|
|
#define _(S,M) INDIC_COMBINE_CATEGORIES (_OT_##S, _POS_##M)
|
||
|
|
|
||
|
|
|
||
|
|
#include <stdint.h>
|
||
|
|
|
||
|
|
static const uint16_t _hb_indic_values[42]=
|
||
|
|
{
|
||
|
|
_(A,SM), _(As,X), _(C,C), _(CM,C), _(CS,C), _(DC,C), _(GB,C), _(H,B),
|
||
|
|
_(H,T), _(H,X), _(M,A), _(M,AP), _(M,AS), _(M,B), _(M,BS), _(M,LM),
|
||
|
|
_(MH,X), _(ML,X), _(MP,AP), _(MR,X), _(MW,X), _(MY,X), _(N,X), _(PT,X),
|
||
|
|
_(R,C), _(Rf,X), _(Rt,X), _(S,SM), _(SM,BS), _(SM,SM), _(SP,SM), _(V,C),
|
||
|
|
_(VA,T), _(VB,B), _(VL,L), _(VR,R), _(VS,X), _(X,X), _(Xg,X), _(Yg,X),
|
||
|
|
_(ZWJ,X),_(ZWNJ,X),
|
||
|
|
};
|
||
|
|
static const uint8_t _hb_indic_u8[1224]=
|
||
|
|
{
|
||
|
|
1, 0, 50, 4, 5, 96, 0, 7, 8, 9, 0, 0, 0, 0, 0, 0,
|
||
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,186, 0, 0, 0, 0, 0,
|
||
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192,
|
||
|
|
0, 0, 0, 0,208,224, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
|
||
|
|
2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, 8, 9,
|
||
|
|
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 0, 0, 22, 23,
|
||
|
|
24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 0, 0,
|
||
|
|
0, 27, 0, 0, 0, 0, 28, 29, 30, 0, 0, 0, 0, 0, 0, 0,
|
||
|
|
0, 0, 0, 0, 0, 31, 0, 0, 0, 32, 0, 0, 0, 33, 0, 34,
|
||
|
|
0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||
|
|
0, 0, 36, 0, 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, 0, 0,
|
||
|
|
0, 0, 0, 0, 0, 0, 0, 25, 2, 10, 0, 0, 0, 0, 26, 0,
|
||
|
|
27, 0, 0, 0, 28, 0, 0, 0, 0, 0, 29, 11, 30, 1, 1, 1,
|
||
|
|
4, 31, 32, 33, 34, 1, 6, 2, 35, 1, 12, 13, 7, 1, 1, 3,
|
||
|
|
36, 14, 15, 37, 16, 17, 6, 2, 38, 39, 18, 40, 7, 1, 1, 3,
|
||
|
|
41, 42, 43, 44, 45, 46, 19, 2, 47, 0, 18, 48, 49, 1, 1, 3,
|
||
|
|
20, 14, 50, 51, 0, 0, 21, 2, 0, 52, 53, 13, 7, 1, 1, 3,
|
||
|
|
20, 54, 15, 55, 56, 17, 6, 2, 57, 0, 58, 59, 60, 61, 62, 63,
|
||
|
|
4, 64, 65, 66, 16, 0, 19, 2, 0, 0, 67, 8, 9, 1, 1, 3,
|
||
|
|
4, 22, 68, 69, 70, 71, 23, 2, 0, 0, 12, 8, 9, 1, 1, 3,
|
||
|
|
72, 22, 73, 74, 75, 76, 23, 2, 77, 0, 78, 8, 9, 1, 1, 1,
|
||
|
|
4, 79, 80, 81, 82, 83, 21, 2, 0, 84, 85, 1, 1, 86, 87, 88,
|
||
|
|
89, 90, 2, 91, 92, 93, 94, 95, 96, 1, 97, 98, 2, 99, 0, 0,
|
||
|
|
0, 0, 1, 1, 1,100,101, 11,102,103,104,105,106,107, 2, 10,
|
||
|
|
0, 0, 0, 0,108, 5, 5,109,110,111, 0,112,113, 0,114, 0,
|
||
|
|
0, 0, 0, 0, 0, 0, 0, 0,115, 0,116, 0, 0, 0, 0, 0,
|
||
|
|
0, 0, 0,117, 0, 0, 0, 0, 0,118, 0, 0, 0, 0, 5, 5,
|
||
|
|
119,120, 0, 0, 0, 0,121, 1, 2,122, 0, 0, 0, 0, 1, 1,
|
||
|
|
123,124, 24, 24, 0, 0, 0, 0, 0, 0,125, 0, 0, 0, 0, 0,
|
||
|
|
0,126, 0, 0, 2, 2, 2, 10, 0, 0, 0, 0, 2, 2, 2, 2,
|
||
|
|
4, 4, 4, 4, 10, 2, 2, 2, 26, 2, 2, 2, 8, 8, 8, 8,
|
||
|
|
6, 18, 0, 4, 20, 14, 24, 2, 6, 6, 20, 6, 20, 6, 24, 2,
|
||
|
|
4, 0, 0, 0, 6, 6, 6, 6, 66, 12, 14, 6, 6, 6, 20, 14,
|
||
|
|
2, 0, 36, 50, 52, 18, 38, 68, 0, 0, 0, 32, 0, 0, 2, 16,
|
||
|
|
56, 12, 14, 6, 0, 0, 0, 4, 44, 2, 16, 2, 6, 22, 0, 4,
|
||
|
|
2, 0, 36, 28, 6, 28, 0, 4, 30, 30, 30, 30, 0, 0, 42, 0,
|
||
|
|
34, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 42, 12, 12, 6, 6,
|
||
|
|
6, 6, 24, 2, 2, 18, 36,110, 18, 18, 18, 18, 18, 18,112,114,
|
||
|
|
116,118,120, 18, 0, 6, 6, 6, 44, 10, 0, 2, 54, 32, 46, 10,
|
||
|
|
26, 0, 0, 0, 0, 0, 34, 70, 6, 20, 0, 14, 44, 2, 16, 10,
|
||
|
|
2, 0, 72, 50,122, 48, 0, 32, 48, 32, 46, 0,124, 0, 0, 0,
|
||
|
|
16, 2, 10, 10, 12, 2,126, 0, 6, 6, 6, 14, 6, 14, 24, 2,
|
||
|
|
22, 22, 52, 74, 76, 32, 46, 0, 16, 58, 58, 78,128, 12, 14, 6,
|
||
|
|
2, 0, 36,130,132, 32, 46, 0, 0,134,136,138, 16, 0, 0, 0,
|
||
|
|
0, 70, 14, 6, 6, 20, 0, 6, 20, 6, 24, 0, 16, 10, 10, 2,
|
||
|
|
0, 16, 10, 0, 2, 10, 0, 2, 2, 0, 0, 22, 76, 48, 0, 80,
|
||
|
|
54, 22, 82, 0, 12, 12,140, 6, 28, 60, 38, 28, 84, 28, 86, 0,
|
||
|
|
0, 0,142, 84, 2, 10, 16, 0, 26, 2, 16, 2, 28, 60, 38, 60,
|
||
|
|
38, 18, 86, 0, 0, 0, 74, 38, 0, 0, 16, 10,144,146, 0, 0,
|
||
|
|
12, 12,148, 6, 2,150,152, 22, 22, 22, 48, 80, 54, 22, 82,154,
|
||
|
|
0, 0, 2,156, 0, 0, 0, 14, 0, 2, 2, 2, 2, 2, 26, 2,
|
||
|
|
2,158, 2, 2, 88, 6, 6, 6, 6,160, 90, 92,162,164, 62, 58,
|
||
|
|
166,168,170,172, 4, 4, 0, 10, 2, 6, 6, 94, 96, 26, 2,174,
|
||
|
|
176, 98,178,180, 98,100,100, 2,102, 62,182, 2, 2,184,186,188,
|
||
|
|
12, 12, 12,190, 4, 12,192, 0, 2, 26, 2, 2, 2, 88, 6, 6,
|
||
|
|
6, 6, 0, 90, 62, 92, 96,194,196,198, 94,200,202,104,104,106,
|
||
|
|
106,204, 0, 0, 42, 0,206, 0, 8,208, 8, 8,210, 40,212, 40,
|
||
|
|
40, 2,214,216, 8, 34, 0, 0, 0, 0,218, 0, 4, 4, 4, 0,
|
||
|
|
0, 34, 0, 0, 0, 0,108, 0, 0, 64,108, 0, 0, 0,220, 0,
|
||
|
|
0, 42, 4, 34, 8, 40, 40, 40, 0, 0, 0,222, 2, 2,102, 16,
|
||
|
|
4, 2, 2, 10, 16, 2, 4, 34, 0,224, 78, 2, 56, 12, 0, 0,
|
||
|
|
0,226, 72, 0, 37, 37, 2, 2, 6, 6, 31, 31, 0, 0, 2, 37,
|
||
|
|
29, 29, 37, 31, 37, 2, 12, 12, 31, 37, 11, 11, 31, 2, 24, 2,
|
||
|
|
14, 14, 36, 36, 37, 11, 6, 37, 22, 27, 12, 37, 27, 27, 37, 6,
|
||
|
|
24, 37, 11, 7, 11, 37, 11, 15, 11, 12, 15, 37, 37, 29, 0, 22,
|
||
|
|
14, 12, 32, 32, 30, 30, 6, 29, 37, 15, 29, 37, 22, 37, 37, 12,
|
||
|
|
12, 11, 22, 22, 15, 15, 11, 8, 14, 37, 14, 8, 2, 31, 35, 32,
|
||
|
|
32, 33, 35, 35, 33, 33, 35, 23, 23, 23, 2, 32, 26, 38, 38, 38,
|
||
|
|
30, 37, 12, 15, 12, 7, 15, 12, 37, 0, 0, 29, 29, 12, 18, 11,
|
||
|
|
37, 13, 37, 3, 37, 28, 11, 10, 10, 37, 37, 10, 10, 22, 10, 11,
|
||
|
|
29, 31, 37, 14, 37, 4, 4, 29, 6, 31, 2, 12, 12, 27, 25, 37,
|
||
|
|
2, 11, 2, 24, 31, 35, 33, 34, 0, 32, 29, 9, 1, 21, 19, 20,
|
||
|
|
16, 2, 21, 21, 17, 2, 23, 2, 2, 35, 32, 2, 20, 35, 34, 32,
|
||
|
|
32, 29, 2, 29, 29, 32, 32, 35, 35, 34, 34, 34, 38, 39, 39, 26,
|
||
|
|
9, 39, 27, 39, 0, 37, 0, 27, 27, 0, 0, 4, 4, 0, 41, 40,
|
||
|
|
5, 37, 31, 12, 2, 23, 37, 22,
|
||
|
|
};
|
||
|
|
|
||
|
|
static inline uint8_t _hb_indic_b4 (const uint8_t* a, unsigned i)
|
||
|
|
{
|
||
|
|
return (a[i>>1]>>((i&1)<<2))&15;
|
||
|
|
}
|
||
|
|
static inline uint8_t _hb_indic_get_categories_index (unsigned u)
|
||
|
|
{
|
||
|
|
/* packtab: [2^4,2^3,2^3,2^2,2^1] */
|
||
|
|
return u<71396u ? (uint8_t)(_hb_indic_u8[996u+_hb_indic_u8[488u+((_hb_indic_u8[186u+((_hb_indic_u8[70u+((_hb_indic_b4(_hb_indic_u8,((((((((u)>>1))>>2))>>3))>>3)))<<3)+((((((((u)>>1))>>2))>>3))&7)])<<3)+((((((u)>>1))>>2))&7)])<<2)+((((u)>>1))&3)]+((u)&1)]) : 37;
|
||
|
|
}
|
||
|
|
|
||
|
|
uint16_t
|
||
|
|
hb_indic_get_categories (hb_codepoint_t u)
|
||
|
|
{
|
||
|
|
return _hb_indic_values[_hb_indic_get_categories_index (u)];
|
||
|
|
}
|
||
|
|
|
||
|
|
#undef _
|
||
|
|
#undef INDIC_COMBINE_CATEGORIES
|
||
|
|
|
||
|
|
#undef _OT_A
|
||
|
|
#undef _OT_As
|
||
|
|
#undef _OT_C
|
||
|
|
#undef _OT_CM
|
||
|
|
#undef _OT_CS
|
||
|
|
#undef _OT_DC
|
||
|
|
#undef _OT_H
|
||
|
|
#undef _OT_M
|
||
|
|
#undef _OT_MH
|
||
|
|
#undef _OT_ML
|
||
|
|
#undef _OT_MP
|
||
|
|
#undef _OT_MR
|
||
|
|
#undef _OT_MW
|
||
|
|
#undef _OT_MY
|
||
|
|
#undef _OT_N
|
||
|
|
#undef _OT_GB
|
||
|
|
#undef _OT_PT
|
||
|
|
#undef _OT_R
|
||
|
|
#undef _OT_Rf
|
||
|
|
#undef _OT_Rt
|
||
|
|
#undef _OT_SM
|
||
|
|
#undef _OT_SP
|
||
|
|
#undef _OT_S
|
||
|
|
#undef _OT_V
|
||
|
|
#undef _OT_VA
|
||
|
|
#undef _OT_VB
|
||
|
|
#undef _OT_VL
|
||
|
|
#undef _OT_VR
|
||
|
|
#undef _OT_VS
|
||
|
|
#undef _OT_X
|
||
|
|
#undef _OT_Xg
|
||
|
|
#undef _OT_Yg
|
||
|
|
#undef _OT_ZWJ
|
||
|
|
#undef _OT_ZWNJ
|
||
|
|
|
||
|
|
#undef _POS_T
|
||
|
|
#undef _POS_A
|
||
|
|
#undef _POS_AP
|
||
|
|
#undef _POS_AS
|
||
|
|
#undef _POS_C
|
||
|
|
#undef _POS_BS
|
||
|
|
#undef _POS_B
|
||
|
|
#undef _POS_X
|
||
|
|
#undef _POS_R
|
||
|
|
#undef _POS_L
|
||
|
|
#undef _POS_LM
|
||
|
|
#undef _POS_SM
|
||
|
|
|
||
|
|
#endif
|
||
|
|
|
||
|
|
/* == End of generated table == */
|