/* Ãʼº: Cho/leading consonant:l * Áß¼º: Jung/middle vowel:m * Á¾¼º: Jong/trailing consonant:n */ #define LCON_KIND 2 #define TCON_KIND 3 /* ¹ÞħÀÌ ¾ø´Â °æ¿ìµµ Æ÷ÇÔ */ #define MVOW_KIND 7 #define LCON_BASE 0x1001 #define MVOW_BASE 0x4001 #define TCON_BASE 0x8001 #define LCON_OFFSET 0x50 #define MVOW_OFFSET 0x50 #define TCON_OFFSET 0x50 /* Ãʼº¹ú¼ö Á¾·ù */ static char lcon_kind[]={ 0, /* ¤¡ ¤¢ ¤¤ ¤§ ¤¨ ¤© ¤± ¤² ¤³ ¤µ ¤¶ ¤· ¤¸ ¤¹ ¤º ¤» ¤¼ ¤½ ¤¾*/ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, }; /* Áß¼º¹ú¼ö Á¾·ù */ /* ¤Ç ÇüÅÂÀÎÁö ¾Æ´ÑÁö ±¸º°:¤¡,¤»ÀÏ °æ¿ì */ static char vow_kind[] = { 0, /* ¤¿ ¤À ¤Á ¤Â ¤Ã ¤Ä ¤Å ¤Æ ¤Ç ¤È ¤É */ /* ¤Ê ¤Ë ¤Ì ¤Í ¤Î ¤Ï ¤Ð ¤Ñ ¤Ò ¤Ó */ 0, 2, 0, 2, 1, 2, 1, 2, 4, 3, 3, 3, 4, 5, 6, 6, 6, 5, 4, 3, 0 /* [¤¿/¤Á/¤Ó][¤Ã/¤Å][¤À/¤Â/¤Ä/¤Æ][¤È/¤É/¤Ê/¤Ò][¤Ç/¤Ë/¤Ñ][¤Ì/¤Ð][¤Í/¤Î/¤Ï] */ #if 0 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 3, 1, 2, 4, 4, 4, 2, 1, 3, 0 0, 2, 0, 2, 1, 2, 1, 2, 3, 0, 0, 0, 3, 3, 1, 1, 1, 3, 3, 0, 0 #endif /* 10-{3,4}-4¿¡¼­ XXX ¤Ñ¿Í ¤ÒÀÇ ¹ú¼ö°¡ 4¹úÀÏ ÇÊ¿ä ¾ø´Ù.*/ }; /* Á¾¼º¹ú¼ö Á¾·ù */ static char tcon_kind[] = { 0, /* ¤¡ ¤¢ ¤£ ¤¤ ¤¥ ¤¦ ¤§ ¤© ¤ª ¤« ¤¬ ¤­ ¤® ¤¯ ¤° */ /* ¤± ¤² ¤´ ¤µ ¤¶ ¤· ¤¸ ¤º ¤» ¤¼ ¤½ ¤¾ */ 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; /* Áß¼ºÁ¾·ù: Ãʼº¿¡ µû¶ó¼­ Áß¼º ºÐ·ù */ static char vow_by_lcon[MVOW_KIND][LCON_KIND] = { /* INDEX */ {0, 0}, /* vow_kind==0ÀÎ °æ¿ì [¤¡/¤»]°ú [ÀϹÝ] ±¸º°¾ÈÇÑ´Ù */ {0, 0}, /* vow_kind==1ÀÎ °æ¿ì [¤¡/¤»]°ú [ÀϹÝ] ±¸º°ÇÑ´Ù */ {0, 0}, /* vow_kind==2ÀÎ °æ¿ì [¤¡/¤»]°ú [ÀϹÝ] ±¸º°¾ÈÇÑ´Ù */ {1, 0}, /* vow_kind==3ÀÎ °æ¿ì [¤¡/¤»]°ú [ÀϹÝ] ±¸º°ÇÑ´Ù */ {1, 0}, /* vow_kind==4ÀÎ °æ¿ì [¤¡/¤»]°ú [ÀϹÝ] ±¸º°ÇÑ´Ù */ {0, 0}, /* vow_kind==5ÀÎ °æ¿ì [¤¡/¤»]°ú [ÀϹÝ] ±¸º°¾ÈÇÑ´Ù */ {0, 0}, /* vow_kind==6ÀÎ °æ¿ì [¤¡/¤»]°ú [ÀϹÝ] ±¸º°¾ÈÇÑ´Ù */ /* [¤¿/¤Á/¤Ó][¤Ã/¤Å][¤À/¤Â/¤Ä/¤Æ][¤È/¤É/¤Ê/¤Ò][¤Ç/¤Ë/¤Ñ][¤Ì/¤Ð][¤Í/¤Î/¤Ï] */ }; static char vow_by_tcon[MVOW_KIND][TCON_KIND] = { /* INDEX */ {0, 1, 2}, /* vow_kind==0ÀÎ °æ¿ì [ÀϹÝ]°ú [¤¤] ±¸º°ÇÑ´Ù */ {0, 1, 2}, /* vow_kind==1ÀÎ °æ¿ì [ÀϹÝ]°ú [¤¤] ±¸º°ÇÑ´Ù */ {0, 1, 2}, /* vow_kind==2ÀÎ °æ¿ì [ÀϹÝ]°ú [¤¤] ±¸º°ÇÑ´Ù */ {0, 2, 2}, /* vow_kind==3ÀÎ °æ¿ì [ÀϹÝ]°ú [¤¤] ±¸º°¾ÈÇÑ´Ù */ {0, 2, 2}, /* vow_kind==4ÀÎ °æ¿ì [ÀϹÝ]°ú [¤¤] ±¸º°¾ÈÇÑ´Ù */ {0, 1, 2}, /* vow_kind==5ÀÎ °æ¿ì [ÀϹÝ]°ú [¤¤] ±¸º°ÇÑ´Ù */ {0, 1, 2}, /* vow_kind==6ÀÎ °æ¿ì [ÀϹÝ]°ú [¤¤] ±¸º°ÇÑ´Ù */ /* [¤¿/¤Á/¤Ó][¤Ã/¤Å][¤À/¤Â/¤Ä/¤Æ][¤È/¤É/¤Ê/¤Ò][¤Ç/¤Ë/¤Ñ][¤Ì/¤Ð][¤Í/¤Î/¤Ï] */ }; /* Áß¼º¿¡ µû¶ó ¾î¶² ¸ð¾çÀÇ ÃʼºÀ» ¾µ °ÇÁö °áÁ¤ */ static char lcon_by_vow[LCON_KIND][MVOW_KIND] = { /* lcon_kind==0À̸é */ {0,0,0,3,1,2,4}, /* lcon_kind==1À̸é */ {0,0,0,3,1,2,4}, /* [¤¿/¤Á/¤Ó][¤Ã/¤Å][¤À/¤Â/¤Ä/¤Æ][¤È/¤É/¤Ê/¤Ò][¤Ç/¤Ë/¤Ñ][¤Ì/¤Ð][¤Í/¤Î/¤Ï] */ }; /* Á¾¼º¿¡ µû¶ó ¾î¶² ¸ð¾çÀÇ ÃʼºÀ» ¾µ °ÍÀÎÁö °áÁ¤ */ static char lcon_by_tcon[LCON_KIND][TCON_KIND] = { /* lcon_kind==0À̸é */ {0,5,5}, /* lcon_kind==1À̸é */ {0,5,5}, }; static char tcon_by_vow[TCON_KIND][MVOW_KIND] = { /* tcon_kind==0À̸é */ {0,0,0,0,0,0,0}, /* ¹Þħ ¾øÀ»¶§ */ /* tcon_kind==1À̸é */ {0,1,2,0,3,3,2}, /* tcon_kind==2À̸é */ {0,1,2,0,3,3,2}, /* [¤¿/¤Á/¤Ó][¤Ã/¤Å][¤À/¤Â/¤Ä/¤Æ][¤È/¤É/¤Ê/¤Ò][¤Ç/¤Ë/¤Ñ][¤Ì/¤Ð][¤Í/¤Î/¤Ï] */ }; #if 0 static char tcon_by_lcon[TCON_KIND][LCON_KIND] = { {0,0}, {0,0}, {0,0}, }; #endif #if 0 /* (¸ðÀ½) ¿¡ µû¸¥ font index */ static int vow_base[] = { 0, /* ¤¿ ¤À ¤Á ¤Â ¤Ã ¤Ä ¤Å ¤Æ ¤Ç ¤È ¤É */ 311, 314, 317, 320, 323, 326, 329, 332, 335, 339, 343, /* ¤Ê ¤Ë ¤Ì ¤Í ¤Î ¤Ï ¤Ð ¤Ñ ¤Ò ¤Ó */ 347, 351, 355, 358, 361, 364, 367, 370, 374, 378 }; #endif static char lcon_idx[]= { /* 0:fill, 2:¤¡, ... */ 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static char vow_idx[]= { /* 0:fill 1:¤¿, ... */ 0, 0, 0, 1, 2, 3, 4, 5, 0, 0, 6, 7, 8, 9, 10, 11, 0, 0, 12, 13, 14, 15, 16, 17, 0, 0, 18, 19, 20, 21, 0, 0 }; static char tcon_idx[]= { /* 0:fill, 2:¤¡, ... */ 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 0, 0 }; #if 1 convert_3_to_johab(l, m, n, des) int l,m,n; // XChar2b *des; int *des; { int ind; int i; int _l,_m,_n; if (l==0xff || l < 1 || l > 20 || m < 2 || m > 29 || n < 1 || n > 29) { des[0] = 0; /* °ø¹é */ return 1; } l=lcon_idx[l]; m=vow_idx[m]; n=tcon_idx[n]; _l=lcon_kind[l]; _m=vow_kind[m]; _n=tcon_kind[n]; // printf("%d,%d,%d\n",l,m,n); i = 0; if (l != 0) { // ind = l * 10 + lcon_by_vow[lcon_kind[l]][vow_kind[m]] + ind = LCON_BASE + LCON_OFFSET*(l-1) + lcon_by_vow[_l][_m] + lcon_by_tcon[_l][_n]; // des[i].byte1 = ind >> 8; // des[i].byte2 = ind; des[i] = ind; i++; } if (m != 0) { /* ä¿òÀÌ ¾Æ´Ï¸é ... */ // ind = vow_base[m]; ind =MVOW_BASE + MVOW_OFFSET*(m-1) + vow_by_tcon[_m][_n] + vow_by_lcon[_m][_l]; // des[i].byte1 = ind >> 8; // des[i].byte2 = ind; des[i] = ind; i++; } if (n != 0) { // ind = n * 4 + tcon_by_vow[tcon_kind[n]][vow_kind[m]]; ind = TCON_BASE + TCON_OFFSET*(n-1) + tcon_by_vow[_n][_m]; // des[i].byte1 = ind >> 8; // des[i].byte2 = ind; des[i] = ind; i++; } if (l != 0 && m == 0 && n == 0) { /* initial sound only? */ // des[i].byte1 = 0; /* dummy for no zero width */ // des[i].byte2 = 0; des[i] = 0; i++; } return i; } #endif