diff options
Diffstat (limited to 'hwpfilter/source/hcode.cxx')
-rw-r--r-- | hwpfilter/source/hcode.cxx | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx index 5949628c48a5..6ecd3544658e 100644 --- a/hwpfilter/source/hcode.cxx +++ b/hwpfilter/source/hcode.cxx @@ -523,7 +523,7 @@ static hchar cdkssm2ks_han(hchar kssm) unsigned int index; unsigned char lo, hi; -/* "" */ +/* "한" */ if (kssm == 0xd3c5) return 0xc7d1; @@ -585,7 +585,7 @@ static const hchar choseong_to_unicode[] = 0x110e, 0x110f, 0x1110, 0x1111, 0x1112, 0x1120, 0x1121, 0x1127, 0x112b, 0x112d, 0x112f, 0x1132, 0x1136, 0x1140, 0x114c, 0x1158 }; -/* 0 1 ٸ ڵ ִ. ̺κп Ģ ̾ƶ. */ +/* 중성이 0과 1인 곳에는 다른 코드들이 들어가 있다. 이부분에 대한 법칙을 뽑아라. */ static const hchar joongseong_to_unicode[] = { 0, 0, 0, 0x1161, 0x1162, 0x1163, 0x1164, 0x1165, @@ -602,12 +602,12 @@ static const hchar jongseong_to_unicode[] = 0x11bd, 0x11be, 0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x11eb, 0x11f0 }; -/* 0 1ΰ */ -/* ó 32 ڸ, 32 . - * 0x8000 ~ 0xa413 32 , 0x0400 0x8400 ٽ 32 ȴ. - * ڸ Ϲ ̺ ü ̺ . +/* 중성이 0과 1인곳 */ +/* 처음 32개는 자모, 나머지 32개는 조합으로 구성. + * 0x8000 ~ 0xa413까지 32개 나오고, 0x0400더한 0x8400에서 다시 32개 나오는 식으로 진행된다. + * 자모영역은 일반 테이블로 나머지는 구조체 매핑테이블로 만든다. */ -/* 308.. 1152 308 844 ڸ̴. */ +/* 308개.. 1152개에서 308개를 제외한 나머지 844개는 자모조합이다. */ static const hchar jamo_to_unicode[] = { 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3138, @@ -666,7 +666,7 @@ struct JamoComp{ hchar v2; hchar v3; }; -/* 704 + 12 = 706 */ +/* 704 + 12 = 706 개 */ static const JamoComp jamocomp1_to_unicode[] = { {3, 0x1100, 0x1161, 0x11e7}, {3, 0x1100, 0x1161, 0x3167}, @@ -789,7 +789,7 @@ static const JamoComp jamocomp1_to_unicode[] = {3, 0x1105, 0x119e, 0x11d7}, {3, 0x1105, 0x119e, 0x11dc}, {3, 0x1105, 0x119e, 0x11dd}, {2, 0x1105, 0x1176, 0x0000}, -/* -- ȹٲ , 3 2 ٲپ ־ . */ +/* -- 여기부터 숫자 안바꿈 즉, 3을 2로 바꾸어 주어야 함. */ {2, 0x1105, 0x1178, 0x0000}, {2, 0x1105, 0x117a, 0x0000}, {2, 0x1105, 0x117b, 0x0000}, {2, 0x1105, 0x1186, 0x0000}, {2, 0x1105, 0x1187, 0x0000}, {2, 0x1105, 0x118c, 0x0000}, @@ -914,13 +914,13 @@ int hcharconv(hchar ch, hchar *dest, int codeType) dest[0] = ch; return 1; } - /* ڴ 0x4000 4888 . */ + /* 한자는 0x4000부터 4888가지의 값을 가진다. */ else if (IsHanja(ch)) { unsigned int index; unsigned char hi; - /* 4888̿ Ʒѱۿ Ȯ̴. ̰Ϳ ؼ - ڵ峪 ϼڵ ȯ ̺ ̴. + /* 4888이외의 수는 아래한글에서 정의한 확장한자이다. 이것에 대해서는 + 유니코드나 완성형코드로의 변환을 위한 매핑테이블어 없는 실정이다. */ if ((index = ch - 0x4000) >= 4888) { @@ -932,8 +932,8 @@ int hcharconv(hchar ch, hchar *dest, int codeType) } if (codeType == KS) { - /* ڵ ڵ ڵ ڵ 0xA1 - 0xFE . - ڵ忡 üִ 0xFE - 0xA1 +1 ̴. + /* 한자코드는 상위코드와 하위코드로 나누어지며 하위코드는 0xA1 - 0xFE 까지의 값을 가진다. + 즉 하위코드에 올수있는 가지수는 0xFE - 0xA1 +1 가지수이다. */ hi = sal::static_int_cast<unsigned char>(index / (0xFE - 0xA1 + 1) + 0xCA); lo = sal::static_int_cast<unsigned char>(index % (0xFE - 0xA1 + 1) + 0xA1); @@ -997,8 +997,8 @@ int hcharconv(hchar ch, hchar *dest, int codeType) return 1 ; } /** - * Ư ڵ - * Ʒѱۿ 0x3400 Ưڰ ۵ȴ. 0xA1A0 + * 특수문자 코드 + * 아래한글에서는 0x3400부터 특수문자가 시작된다. 조합형은 0xA1A0 */ else { @@ -1013,7 +1013,7 @@ int hcharconv(hchar ch, hchar *dest, int codeType) dest[0] = ch; return 1; } - /* ѱ۰ǻ : 0x37c0 ~ 0x37c5 */ + /* 한글과컴퓨터 : 0x37c0 ~ 0x37c5 */ if( ch2 >= 0x37c0 && ch2 <= 0x37c5 ){ if( ch2 == 0x37c0 ) dest[0] = 0xd55c; else if( ch2 == 0x37c1 ) dest[0] = 0xae00; @@ -1059,7 +1059,7 @@ int hcharconv(hchar ch, hchar *dest, int codeType) } } -/* ѱ . */ +/* 한글일 경우. */ int kssm_hangul_to_ucs2(hchar ch, hchar *dest) { hchar choseong, joongseong, jongseong; @@ -1070,13 +1070,13 @@ int kssm_hangul_to_ucs2(hchar ch, hchar *dest) //printf("kssm_hangul_to_ucs2 : [%d,%d,%d]\n", choseong,joongseong,jongseong); - if( joongseong < 2 ){ /* յ =0,1 */ - if( joongseong == 0 && ch < 0xa414 ){ /* ڸ */ + if( joongseong < 2 ){ /* 조합되지 않은 영역 중성=0,1 */ + if( joongseong == 0 && ch < 0xa414 ){ /* 고어포함 자모 */ int index = choseong * 32 + jongseong; dest[0] = jamo_to_unicode[index]; return 1; } - else{ /* ڸ : ̺ ̿ϼ */ + else{ /* 고어포함 자모조합 : 테이블 미완성 */ unsigned int index = choseong * 32 + jongseong - 308; if( index < SAL_N_ELEMENTS(jamocomp1_to_unicode) ){ dest[0] = jamocomp1_to_unicode[index].v1; @@ -1088,11 +1088,11 @@ int kssm_hangul_to_ucs2(hchar ch, hchar *dest) return 1; } } - else if ( choseong == 1 && jongseong == 1 ){ /* */ + else if ( choseong == 1 && jongseong == 1 ){ /* 모음 */ dest[0] = joongseong_to_unicode[joongseong]; return 1; } - else if ( joongseong == 2 && jongseong == 1 ){ /* */ + else if ( joongseong == 2 && jongseong == 1 ){ /* 자음 */ dest[0] = choseong_to_unicode[choseong]; return 1; } @@ -1101,8 +1101,8 @@ int kssm_hangul_to_ucs2(hchar ch, hchar *dest) joongseong == 25 || joongseong > 29 || jongseong == 0 || jongseong == 18 || jongseong > 29 || - choseong == 1 || joongseong == 2 /* ϼ ѱ */ - ) { /* */ + choseong == 1 || joongseong == 2 /* 완성되지 않은 한글 */ + ) { /* 고어 */ int count = 0; if( choseong != 1 ){ dest[count] = choseong_to_unicode[choseong]; @@ -1182,7 +1182,7 @@ hchar_string hstr2ucsstr(hchar const* hstr) } /** - * ĽƮ ϼƮ ȯѴ + * 한컴스트링을 완성형스트링으로 변환한다 */ ::std::string hstr2ksstr(hchar const* hstr) { @@ -1212,8 +1212,8 @@ hchar_string hstr2ucsstr(hchar const* hstr) /* - * ѱۿ ڱ ִ kcharŸ ڿ - * ѱۿ ϴ hcharŸ ڿ ȯѴ. + * 한글에서 영문외의 문자까지 포함할 수 있는 kchar타입의 문자열을 + * 한글에서 사용하는 hchar타입의 문자열로 변환한다. */ hchar_string kstr2hstr(unsigned char const* src) { @@ -1244,7 +1244,7 @@ char* Int2Str(int value, const char *format, char *buf) } -/* colorε Ͽ Ÿǽ color ȯ */ +/* color인덱스 값과 음영값을 조합하여 스타오피스의 color로 변환 */ char *hcolor2str(uchar color, uchar shade, char *buf, bool bIsChar) { unsigned short red,green,blue; @@ -1448,11 +1448,11 @@ double calcAngle(int x1, int y1, int x2, int y2) } double angle; angle = (180 / PI) * atan( ( y2 - y1 ) * 1.0 / ( x2 - x1 )); - if( y2 >= y1 ){ /* 1,2и */ + if( y2 >= y1 ){ /* 1,2사분면 */ if( angle < 0. ) angle += 180.; } - else{ /* 3, 4 и */ + else{ /* 3, 4 사분면 */ if( angle > 0 ) angle += 180.; else |