diff --git a/ChangeLog.txt b/ChangeLog.txt index b92438dec5..0e8326973f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,18 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2014-02-03 18:11 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbct/dattime2.c + ! fixed potential GPF trap due to wrong protection condition + and change internal variable name (synced with Viktor's branch) + + * src/vm/classes.c + ! fixed typo in alternative code - thanks to Lorenzo for the info + + * contrib/hbhpdf/3rd/libhpdf/* + * updated HARUPDF library 2.3.0RC2 -> 2.3.0RC3 + (the same version is used in Viktor's branch) + 2014-02-03 09:59 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * ChangeLog.txt * updated previous ChangeLog entry to mark group of files. diff --git a/contrib/hbct/dattime2.c b/contrib/hbct/dattime2.c index 83e777aa85..ab0fc2bea9 100644 --- a/contrib/hbct/dattime2.c +++ b/contrib/hbct/dattime2.c @@ -83,10 +83,10 @@ static int ct_daysinmonth( int iMonth, HB_BOOL bLeap ) static int ct_daystomonth( int iMonth, HB_BOOL bLeap ) { - static const int sc_iMonthes[] = { + static const int sc_iMonths[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; - return ( iMonth < 1 && iMonth > 12 ) ? 0 : sc_iMonthes[ iMonth - 1 ] + + return ( iMonth < 1 || iMonth > 12 ) ? 0 : sc_iMonths[ iMonth - 1 ] + ( ( bLeap && iMonth > 2 ) ? 1 : 0 ); } diff --git a/contrib/hbhpdf/3rd/libhpdf/_hbhbpdf.c b/contrib/hbhpdf/3rd/libhpdf/_hbhbpdf.c index ae6190065c..8fe7dcdb52 100644 --- a/contrib/hbhpdf/3rd/libhpdf/_hbhbpdf.c +++ b/contrib/hbhpdf/3rd/libhpdf/_hbhbpdf.c @@ -1,4 +1,3 @@ - #include "hbapi.h" #if defined( HB_OS_WIN_CE ) diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdf.h b/contrib/hbhpdf/3rd/libhpdf/hpdf.h index 30719f332b..7af2d39575 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdf.h +++ b/contrib/hbhpdf/3rd/libhpdf/hpdf.h @@ -765,6 +765,11 @@ HPDF_EXPORT(HPDF_Image) HPDF_LoadU3DFromFile (HPDF_Doc pdf, const char *filename); +HPDF_EXPORT(HPDF_Image) +HPDF_LoadU3DFromMem (HPDF_Doc pdf, + const HPDF_BYTE *buffer, + HPDF_UINT size); + HPDF_EXPORT(HPDF_Image) HPDF_Image_LoadRaw1BitImageFromMem (HPDF_Doc pdf, const HPDF_BYTE *buf, @@ -1460,6 +1465,17 @@ HPDF_EXPORT(HPDF_STATUS) HPDF_Page_ExecuteXObject (HPDF_Page page, HPDF_XObject obj); +/*--- Content streams ----------------------------------------------------*/ + +HPDF_EXPORT(HPDF_STATUS) +HPDF_Page_New_Content_Stream (HPDF_Page page, + HPDF_Dict* new_stream); + +HPDF_EXPORT(HPDF_STATUS) +HPDF_Page_Insert_Shared_Content_Stream (HPDF_Page page, + HPDF_Dict shared_stream); + + /*--- Marked content -----------------------------------------------------*/ /* BMC --not implemented yet */ diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfcons.h b/contrib/hbhpdf/3rd/libhpdf/hpdfcons.h index 3ff2ce5282..d080f8df6e 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfcons.h +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfcons.h @@ -115,7 +115,7 @@ #define HPDF_LIMIT_MAX_STRING_LEN 65535 #define HPDF_LIMIT_MAX_NAME_LEN 127 -#define HPDF_LIMIT_MAX_ARRAY 8191 +#define HPDF_LIMIT_MAX_ARRAY 32767 #define HPDF_LIMIT_MAX_DICT_ELEMENT 4095 #define HPDF_LIMIT_MAX_XREF_ELEMENT 8388607 #define HPDF_LIMIT_MAX_GSTATE 28 @@ -142,7 +142,7 @@ #define HPDF_MAX_WORDSPACE 300 #define HPDF_MIN_CHARSPACE -30 #define HPDF_MAX_CHARSPACE 300 -#define HPDF_MAX_FONTSIZE 300 +#define HPDF_MAX_FONTSIZE 600 #define HPDF_MAX_ZOOMSIZE 10 #define HPDF_MAX_LEADING 300 #define HPDF_MAX_LINEWIDTH 100 diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfdoc.c b/contrib/hbhpdf/3rd/libhpdf/hpdfdoc.c index ee29e40b74..ab5d8c4397 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfdoc.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfdoc.c @@ -1528,8 +1528,7 @@ LoadTTFontFromStream (HPDF_Doc pdf, HPDF_FontDef tmpdef = HPDF_Doc_FindFontDef (pdf, def->base_font); if (tmpdef) { HPDF_FontDef_Free (def); - HPDF_SetError (&pdf->error, HPDF_FONT_EXISTS, 0); - return NULL; + return tmpdef->base_font; } if (HPDF_List_Add (pdf->fontdef_list, def) != HPDF_OK) { @@ -1607,8 +1606,7 @@ LoadTTFontFromStream2 (HPDF_Doc pdf, HPDF_FontDef tmpdef = HPDF_Doc_FindFontDef (pdf, def->base_font); if (tmpdef) { HPDF_FontDef_Free (def); - HPDF_SetError (&pdf->error, HPDF_FONT_EXISTS, 0); - return NULL; + return tmpdef->base_font; } if (HPDF_List_Add (pdf->fontdef_list, def) != HPDF_OK) { diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfenco.c b/contrib/hbhpdf/3rd/libhpdf/hpdfenco.c index 286e403b72..7d33c60051 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfenco.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfenco.c @@ -1097,7 +1097,7 @@ static const HPDF_UNICODE HPDF_UNICODE_MAP_STANDARD[] = { 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x00D1, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -1132,9 +1132,9 @@ static const HPDF_UNICODE HPDF_UNICODE_MAP_WIN_ANSI[] = { 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000, 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178, - 0x0000, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, - 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x0000, 0x00AE, 0x00AF, - 0x02DA, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, @@ -1159,21 +1159,21 @@ static const HPDF_UNICODE HPDF_UNICODE_MAP_MAC_ROMAN[] = { 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x0000, - 0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x0000, 0x00D6, 0x00DC, 0x00E1, + 0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, 0x00E1, 0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8, 0x00EA, 0x00EB, 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3, 0x00F2, 0x00F4, 0x00F6, 0x00F5, 0x00FA, 0x00F9, 0x00FB, 0x00FC, 0x2020, 0x00B0, 0x00A2, 0x00A3, 0x00A7, 0x2022, 0x00B6, 0x00DF, - 0x00AE, 0x00A9, 0x2122, 0x00B4, 0x00A8, 0x0000, 0x00C6, 0x00D8, - 0x0000, 0x00B1, 0x0000, 0x0000, 0x00A5, 0x00B5, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x00AA, 0x00BA, 0x0000, 0x00E6, 0x00F8, - 0x00BF, 0x00A1, 0x00AC, 0x0000, 0x0192, 0x0000, 0x0000, 0x00AB, - 0x00BB, 0x2026, 0x0020, 0x00C0, 0x00C3, 0x00D5, 0x0152, 0x0153, - 0x2013, 0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x0000, - 0x00FF, 0x0178, 0x2044, 0x00A4, 0x2039, 0x203A, 0xFB01, 0xFB02, + 0x00AE, 0x00A9, 0x2122, 0x00B4, 0x00A8, 0x2260, 0x00C6, 0x00D8, + 0x221E, 0x00B1, 0x2264, 0x2265, 0x00A5, 0x00B5, 0x2202, 0x2211, + 0x220F, 0x03C0, 0x222B, 0x00AA, 0x00BA, 0x03A9, 0x00E6, 0x00F8, + 0x00BF, 0x00A1, 0x00AC, 0x221A, 0x0192, 0x2248, 0x2206, 0x00AB, + 0x00BB, 0x2026, 0x00A0, 0x00C0, 0x00C3, 0x00D5, 0x0152, 0x0153, + 0x2013, 0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x25CA, + 0x00FF, 0x0178, 0x2044, 0x20AC, 0x2039, 0x203A, 0xFB01, 0xFB02, 0x2021, 0x00B7, 0x201A, 0x201E, 0x2030, 0x00C2, 0x00CA, 0x00C1, 0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x00D3, 0x00D4, - 0x0000, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0x0131, 0x02C6, 0x02DC, + 0xF8FF, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0x0131, 0x02C6, 0x02DC, 0x00AF, 0x02D8, 0x02D9, 0x02DA, 0x00B8, 0x02DD, 0x02DB, 0x02C7 }; @@ -2235,6 +2235,7 @@ HPDF_BasicEncoder_New (HPDF_MMgr mmgr, encoder->error = mmgr->error; encoder->type = HPDF_ENCODER_TYPE_SINGLE_BYTE; encoder->to_unicode_fn = HPDF_BasicEncoder_ToUnicode; + encoder->encode_text_fn = NULL; encoder->write_fn = HPDF_BasicEncoder_Write; encoder->free_fn = HPDF_BasicEncoder_Free; @@ -2520,7 +2521,7 @@ HPDF_Encoder_Validate (HPDF_Encoder encoder) HPDF_Encoder HPDF_CMapEncoder_New (HPDF_MMgr mmgr, - char *name, + char *name, HPDF_Encoder_Init_Func init_fn) { HPDF_Encoder encoder; @@ -2625,7 +2626,6 @@ HPDF_CMapEncoder_ToCID (HPDF_Encoder encoder, return attr->cid_map[l][h]; } - void HPDF_CMapEncoder_Free (HPDF_Encoder encoder) { @@ -2751,20 +2751,26 @@ HPDF_CMapEncoder_AddCMap (HPDF_Encoder encoder, HPDF_PTRACE ((" HPDF_CMapEncoder_AddCMap\n")); /* Copy specified pdf_cid_range array to fRangeArray. */ - while (range->from != 0xffff && range->to != 0xffff) { - HPDF_UINT16 code = range->from; - HPDF_UINT16 cid = range->cid; - HPDF_CidRange_Rec *prange; - HPDF_STATUS ret; + while (range->from != 0xffff || range->to != 0xffff) { + HPDF_CidRange_Rec *prange; + HPDF_STATUS ret; - while (code <= range->to) { - HPDF_BYTE l = (HPDF_BYTE)code; - HPDF_BYTE h = (HPDF_BYTE)(code >> 8); + /* + * Only if we have the default to_unicode_fn + */ + if (encoder->to_unicode_fn == HPDF_CMapEncoder_ToUnicode) { + HPDF_UINT16 code = range->from; + HPDF_UINT16 cid = range->cid; - attr->cid_map[l][h] = cid; - code++; - cid++; - } + while (code <= range->to) { + HPDF_BYTE l = code; + HPDF_BYTE h = code >> 8; + + attr->cid_map[l][h] = cid; + code++; + cid++; + } + } prange = HPDF_GetMem (encoder->mmgr, sizeof(HPDF_CidRange_Rec)); if (!prange) @@ -2994,4 +3000,3 @@ HPDF_Encoder_GetWritingMode (HPDF_Encoder encoder) return HPDF_WMODE_HORIZONTAL; } - diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfenco.h b/contrib/hbhpdf/3rd/libhpdf/hpdfenco.h index fe06d95306..f91e1b7859 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfenco.h +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfenco.h @@ -93,6 +93,11 @@ typedef HPDF_UNICODE (*HPDF_Encoder_ToUnicode_Func) (HPDF_Encoder encoder, HPDF_UINT16 code); +typedef char * +(*HPDF_Encoder_EncodeText_Func) (HPDF_Encoder encoder, + const char *text, + HPDF_UINT len, + HPDF_UINT *encoded_length); typedef HPDF_STATUS (*HPDF_Encoder_Write_Func) (HPDF_Encoder encoder, @@ -109,13 +114,14 @@ typedef void typedef struct _HPDF_Encoder_Rec { HPDF_UINT32 sig_bytes; - char name[HPDF_LIMIT_MAX_NAME_LEN + 1]; + char name[HPDF_LIMIT_MAX_NAME_LEN + 1]; HPDF_MMgr mmgr; HPDF_Error error; HPDF_EncoderType type; HPDF_Encoder_ByteType_Func byte_type_fn; HPDF_Encoder_ToUnicode_Func to_unicode_fn; + HPDF_Encoder_EncodeText_Func encode_text_fn; HPDF_Encoder_Write_Func write_fn; HPDF_Encoder_Free_Func free_fn; HPDF_Encoder_Init_Func init_fn; @@ -231,7 +237,7 @@ typedef struct _HPDF_CMapEncoderAttr_Rec { HPDF_Encoder HPDF_CMapEncoder_New (HPDF_MMgr mmgr, - char *name, + char *name, HPDF_Encoder_Init_Func init_fn); diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfencu.c b/contrib/hbhpdf/3rd/libhpdf/hpdfencu.c index c459fb09f9..f94eb8aada 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfencu.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfencu.c @@ -6,6 +6,7 @@ * Copyright (c) 1999-2006 Takeshi Kanno * Copyright (c) 2007-2008 Antony Dovgal * Copyright (c) 2010 Sergey Konovalov + * Copyright (c) 2011 Koen Deforche * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, @@ -21,2156 +22,188 @@ #include "hpdfenco.h" #include "hpdf.h" -static const HPDF_UnicodeMap_Rec UTF8_UNICODE_ARRAY[] = { - {0x0000, 0x0000}, - {0x0001, 0x0001}, - {0x0002, 0x0002}, - {0x0003, 0x0003}, - {0x0004, 0x0004}, - {0x0005, 0x0005}, - {0x0006, 0x0006}, - {0x0007, 0x0007}, - {0x0008, 0x0008}, - {0x0009, 0x0009}, - {0x000A, 0x000A}, - {0x000B, 0x000B}, - {0x000C, 0x000C}, - {0x000D, 0x000D}, - {0x000E, 0x000E}, - {0x000F, 0x000F}, - {0x0010, 0x0010}, - {0x0011, 0x0011}, - {0x0012, 0x0012}, - {0x0013, 0x0013}, - {0x0014, 0x0014}, - {0x0015, 0x0015}, - {0x0016, 0x0016}, - {0x0017, 0x0017}, - {0x0018, 0x0018}, - {0x0019, 0x0019}, - {0x001A, 0x001A}, - {0x001B, 0x001B}, - {0x001C, 0x001C}, - {0x001D, 0x001D}, - {0x001E, 0x001E}, - {0x001F, 0x001F}, - {0x0020, 0x0020}, - {0x0021, 0x0021}, - {0x0022, 0x0022}, - {0x0023, 0x0023}, - {0x0024, 0x0024}, - {0x0025, 0x0025}, - {0x0026, 0x0026}, - {0x0027, 0x0027}, - {0x0028, 0x0028}, - {0x0029, 0x0029}, - {0x002A, 0x002A}, - {0x002B, 0x002B}, - {0x002C, 0x002C}, - {0x002D, 0x002D}, - {0x002E, 0x002E}, - {0x002F, 0x002F}, - {0x0030, 0x0030}, - {0x0031, 0x0031}, - {0x0032, 0x0032}, - {0x0033, 0x0033}, - {0x0034, 0x0034}, - {0x0035, 0x0035}, - {0x0036, 0x0036}, - {0x0037, 0x0037}, - {0x0038, 0x0038}, - {0x0039, 0x0039}, - {0x003A, 0x003A}, - {0x003B, 0x003B}, - {0x003C, 0x003C}, - {0x003D, 0x003D}, - {0x003E, 0x003E}, - {0x003F, 0x003F}, - {0x0040, 0x0040}, - {0x0041, 0x0041}, - {0x0042, 0x0042}, - {0x0043, 0x0043}, - {0x0044, 0x0044}, - {0x0045, 0x0045}, - {0x0046, 0x0046}, - {0x0047, 0x0047}, - {0x0048, 0x0048}, - {0x0049, 0x0049}, - {0x004A, 0x004A}, - {0x004B, 0x004B}, - {0x004C, 0x004C}, - {0x004D, 0x004D}, - {0x004E, 0x004E}, - {0x004F, 0x004F}, - {0x0050, 0x0050}, - {0x0051, 0x0051}, - {0x0052, 0x0052}, - {0x0053, 0x0053}, - {0x0054, 0x0054}, - {0x0055, 0x0055}, - {0x0056, 0x0056}, - {0x0057, 0x0057}, - {0x0058, 0x0058}, - {0x0059, 0x0059}, - {0x005A, 0x005A}, - {0x005B, 0x005B}, - {0x005C, 0x005C}, - {0x005D, 0x005D}, - {0x005E, 0x005E}, - {0x005F, 0x005F}, - {0x0060, 0x0060}, - {0x0061, 0x0061}, - {0x0062, 0x0062}, - {0x0063, 0x0063}, - {0x0064, 0x0064}, - {0x0065, 0x0065}, - {0x0066, 0x0066}, - {0x0067, 0x0067}, - {0x0068, 0x0068}, - {0x0069, 0x0069}, - {0x006A, 0x006A}, - {0x006B, 0x006B}, - {0x006C, 0x006C}, - {0x006D, 0x006D}, - {0x006E, 0x006E}, - {0x006F, 0x006F}, - {0x0070, 0x0070}, - {0x0071, 0x0071}, - {0x0072, 0x0072}, - {0x0073, 0x0073}, - {0x0074, 0x0074}, - {0x0075, 0x0075}, - {0x0076, 0x0076}, - {0x0077, 0x0077}, - {0x0078, 0x0078}, - {0x0079, 0x0079}, - {0x007A, 0x007A}, - {0x007B, 0x007B}, - {0x007C, 0x007C}, - {0x007D, 0x007D}, - {0x007E, 0x007E}, - {0x007F, 0x007F}, - {0xC280, 0x0080}, - {0xC281, 0x0081}, - {0xC282, 0x0082}, - {0xC283, 0x0083}, - {0xC284, 0x0084}, - {0xC285, 0x0085}, - {0xC286, 0x0086}, - {0xC287, 0x0087}, - {0xC288, 0x0088}, - {0xC289, 0x0089}, - {0xC28A, 0x008A}, - {0xC28B, 0x008B}, - {0xC28C, 0x008C}, - {0xC28D, 0x008D}, - {0xC28E, 0x008E}, - {0xC28F, 0x008F}, - {0xC290, 0x0090}, - {0xC291, 0x0091}, - {0xC292, 0x0092}, - {0xC293, 0x0093}, - {0xC294, 0x0094}, - {0xC295, 0x0095}, - {0xC296, 0x0096}, - {0xC297, 0x0097}, - {0xC298, 0x0098}, - {0xC299, 0x0099}, - {0xC29A, 0x009A}, - {0xC29B, 0x009B}, - {0xC29C, 0x009C}, - {0xC29D, 0x009D}, - {0xC29E, 0x009E}, - {0xC29F, 0x009F}, - {0xC2A0, 0x00A0}, - {0xC2A1, 0x00A1}, - {0xC2A2, 0x00A2}, - {0xC2A3, 0x00A3}, - {0xC2A4, 0x00A4}, - {0xC2A5, 0x00A5}, - {0xC2A6, 0x00A6}, - {0xC2A7, 0x00A7}, - {0xC2A8, 0x00A8}, - {0xC2A9, 0x00A9}, - {0xC2AA, 0x00AA}, - {0xC2AB, 0x00AB}, - {0xC2AC, 0x00AC}, - {0xC2AD, 0x00AD}, - {0xC2AE, 0x00AE}, - {0xC2AF, 0x00AF}, - {0xC2B0, 0x00B0}, - {0xC2B1, 0x00B1}, - {0xC2B2, 0x00B2}, - {0xC2B3, 0x00B3}, - {0xC2B4, 0x00B4}, - {0xC2B5, 0x00B5}, - {0xC2B6, 0x00B6}, - {0xC2B7, 0x00B7}, - {0xC2B8, 0x00B8}, - {0xC2B9, 0x00B9}, - {0xC2BA, 0x00BA}, - {0xC2BB, 0x00BB}, - {0xC2BC, 0x00BC}, - {0xC2BD, 0x00BD}, - {0xC2BE, 0x00BE}, - {0xC2BF, 0x00BF}, - {0xC380, 0x00C0}, - {0xC381, 0x00C1}, - {0xC382, 0x00C2}, - {0xC383, 0x00C3}, - {0xC384, 0x00C4}, - {0xC385, 0x00C5}, - {0xC386, 0x00C6}, - {0xC387, 0x00C7}, - {0xC388, 0x00C8}, - {0xC389, 0x00C9}, - {0xC38A, 0x00CA}, - {0xC38B, 0x00CB}, - {0xC38C, 0x00CC}, - {0xC38D, 0x00CD}, - {0xC38E, 0x00CE}, - {0xC38F, 0x00CF}, - {0xC390, 0x00D0}, - {0xC391, 0x00D1}, - {0xC392, 0x00D2}, - {0xC393, 0x00D3}, - {0xC394, 0x00D4}, - {0xC395, 0x00D5}, - {0xC396, 0x00D6}, - {0xC397, 0x00D7}, - {0xC398, 0x00D8}, - {0xC399, 0x00D9}, - {0xC39A, 0x00DA}, - {0xC39B, 0x00DB}, - {0xC39C, 0x00DC}, - {0xC39D, 0x00DD}, - {0xC39E, 0x00DE}, - {0xC39F, 0x00DF}, - {0xC3A0, 0x00E0}, - {0xC3A1, 0x00E1}, - {0xC3A2, 0x00E2}, - {0xC3A3, 0x00E3}, - {0xC3A4, 0x00E4}, - {0xC3A5, 0x00E5}, - {0xC3A6, 0x00E6}, - {0xC3A7, 0x00E7}, - {0xC3A8, 0x00E8}, - {0xC3A9, 0x00E9}, - {0xC3AA, 0x00EA}, - {0xC3AB, 0x00EB}, - {0xC3AC, 0x00EC}, - {0xC3AD, 0x00ED}, - {0xC3AE, 0x00EE}, - {0xC3AF, 0x00EF}, - {0xC3B0, 0x00F0}, - {0xC3B1, 0x00F1}, - {0xC3B2, 0x00F2}, - {0xC3B3, 0x00F3}, - {0xC3B4, 0x00F4}, - {0xC3B5, 0x00F5}, - {0xC3B6, 0x00F6}, - {0xC3B7, 0x00F7}, - {0xC3B8, 0x00F8}, - {0xC3B9, 0x00F9}, - {0xC3BA, 0x00FA}, - {0xC3BB, 0x00FB}, - {0xC3BC, 0x00FC}, - {0xC3BD, 0x00FD}, - {0xC3BE, 0x00FE}, - {0xC3BF, 0x00FF}, - {0xC480, 0x0100}, - {0xC481, 0x0101}, - {0xC482, 0x0102}, - {0xC483, 0x0103}, - {0xC484, 0x0104}, - {0xC485, 0x0105}, - {0xC486, 0x0106}, - {0xC487, 0x0107}, - {0xC488, 0x0108}, - {0xC489, 0x0109}, - {0xC48A, 0x010A}, - {0xC48B, 0x010B}, - {0xC48C, 0x010C}, - {0xC48D, 0x010D}, - {0xC48E, 0x010E}, - {0xC48F, 0x010F}, - {0xC490, 0x0110}, - {0xC491, 0x0111}, - {0xC492, 0x0112}, - {0xC493, 0x0113}, - {0xC494, 0x0114}, - {0xC495, 0x0115}, - {0xC496, 0x0116}, - {0xC497, 0x0117}, - {0xC498, 0x0118}, - {0xC499, 0x0119}, - {0xC49A, 0x011A}, - {0xC49B, 0x011B}, - {0xC49C, 0x011C}, - {0xC49D, 0x011D}, - {0xC49E, 0x011E}, - {0xC49F, 0x011F}, - {0xC4A0, 0x0120}, - {0xC4A1, 0x0121}, - {0xC4A2, 0x0122}, - {0xC4A3, 0x0123}, - {0xC4A4, 0x0124}, - {0xC4A5, 0x0125}, - {0xC4A6, 0x0126}, - {0xC4A7, 0x0127}, - {0xC4A8, 0x0128}, - {0xC4A9, 0x0129}, - {0xC4AA, 0x012A}, - {0xC4AB, 0x012B}, - {0xC4AC, 0x012C}, - {0xC4AD, 0x012D}, - {0xC4AE, 0x012E}, - {0xC4AF, 0x012F}, - {0xC4B0, 0x0130}, - {0xC4B1, 0x0131}, - {0xC4B2, 0x0132}, - {0xC4B3, 0x0133}, - {0xC4B4, 0x0134}, - {0xC4B5, 0x0135}, - {0xC4B6, 0x0136}, - {0xC4B7, 0x0137}, - {0xC4B8, 0x0138}, - {0xC4B9, 0x0139}, - {0xC4BA, 0x013A}, - {0xC4BB, 0x013B}, - {0xC4BC, 0x013C}, - {0xC4BD, 0x013D}, - {0xC4BE, 0x013E}, - {0xC4BF, 0x013F}, - {0xC580, 0x0140}, - {0xC581, 0x0141}, - {0xC582, 0x0142}, - {0xC583, 0x0143}, - {0xC584, 0x0144}, - {0xC585, 0x0145}, - {0xC586, 0x0146}, - {0xC587, 0x0147}, - {0xC588, 0x0148}, - {0xC589, 0x0149}, - {0xC58A, 0x014A}, - {0xC58B, 0x014B}, - {0xC58C, 0x014C}, - {0xC58D, 0x014D}, - {0xC58E, 0x014E}, - {0xC58F, 0x014F}, - {0xC590, 0x0150}, - {0xC591, 0x0151}, - {0xC592, 0x0152}, - {0xC593, 0x0153}, - {0xC594, 0x0154}, - {0xC595, 0x0155}, - {0xC596, 0x0156}, - {0xC597, 0x0157}, - {0xC598, 0x0158}, - {0xC599, 0x0159}, - {0xC59A, 0x015A}, - {0xC59B, 0x015B}, - {0xC59C, 0x015C}, - {0xC59D, 0x015D}, - {0xC59E, 0x015E}, - {0xC59F, 0x015F}, - {0xC5A0, 0x0160}, - {0xC5A1, 0x0161}, - {0xC5A2, 0x0162}, - {0xC5A3, 0x0163}, - {0xC5A4, 0x0164}, - {0xC5A5, 0x0165}, - {0xC5A6, 0x0166}, - {0xC5A7, 0x0167}, - {0xC5A8, 0x0168}, - {0xC5A9, 0x0169}, - {0xC5AA, 0x016A}, - {0xC5AB, 0x016B}, - {0xC5AC, 0x016C}, - {0xC5AD, 0x016D}, - {0xC5AE, 0x016E}, - {0xC5AF, 0x016F}, - {0xC5B0, 0x0170}, - {0xC5B1, 0x0171}, - {0xC5B2, 0x0172}, - {0xC5B3, 0x0173}, - {0xC5B4, 0x0174}, - {0xC5B5, 0x0175}, - {0xC5B6, 0x0176}, - {0xC5B7, 0x0177}, - {0xC5B8, 0x0178}, - {0xC5B9, 0x0179}, - {0xC5BA, 0x017A}, - {0xC5BB, 0x017B}, - {0xC5BC, 0x017C}, - {0xC5BD, 0x017D}, - {0xC5BE, 0x017E}, - {0xC5BF, 0x017F}, - {0xC680, 0x0180}, - {0xC681, 0x0181}, - {0xC682, 0x0182}, - {0xC683, 0x0183}, - {0xC684, 0x0184}, - {0xC685, 0x0185}, - {0xC686, 0x0186}, - {0xC687, 0x0187}, - {0xC688, 0x0188}, - {0xC689, 0x0189}, - {0xC68A, 0x018A}, - {0xC68B, 0x018B}, - {0xC68C, 0x018C}, - {0xC68D, 0x018D}, - {0xC68E, 0x018E}, - {0xC68F, 0x018F}, - {0xC690, 0x0190}, - {0xC691, 0x0191}, - {0xC692, 0x0192}, - {0xC693, 0x0193}, - {0xC694, 0x0194}, - {0xC695, 0x0195}, - {0xC696, 0x0196}, - {0xC697, 0x0197}, - {0xC698, 0x0198}, - {0xC699, 0x0199}, - {0xC69A, 0x019A}, - {0xC69B, 0x019B}, - {0xC69C, 0x019C}, - {0xC69D, 0x019D}, - {0xC69E, 0x019E}, - {0xC69F, 0x019F}, - {0xC6A0, 0x01A0}, - {0xC6A1, 0x01A1}, - {0xC6A2, 0x01A2}, - {0xC6A3, 0x01A3}, - {0xC6A4, 0x01A4}, - {0xC6A5, 0x01A5}, - {0xC6A6, 0x01A6}, - {0xC6A7, 0x01A7}, - {0xC6A8, 0x01A8}, - {0xC6A9, 0x01A9}, - {0xC6AA, 0x01AA}, - {0xC6AB, 0x01AB}, - {0xC6AC, 0x01AC}, - {0xC6AD, 0x01AD}, - {0xC6AE, 0x01AE}, - {0xC6AF, 0x01AF}, - {0xC6B0, 0x01B0}, - {0xC6B1, 0x01B1}, - {0xC6B2, 0x01B2}, - {0xC6B3, 0x01B3}, - {0xC6B4, 0x01B4}, - {0xC6B5, 0x01B5}, - {0xC6B6, 0x01B6}, - {0xC6B7, 0x01B7}, - {0xC6B8, 0x01B8}, - {0xC6B9, 0x01B9}, - {0xC6BA, 0x01BA}, - {0xC6BB, 0x01BB}, - {0xC6BC, 0x01BC}, - {0xC6BD, 0x01BD}, - {0xC6BE, 0x01BE}, - {0xC6BF, 0x01BF}, - {0xC780, 0x01C0}, - {0xC781, 0x01C1}, - {0xC782, 0x01C2}, - {0xC783, 0x01C3}, - {0xC784, 0x01C4}, - {0xC785, 0x01C5}, - {0xC786, 0x01C6}, - {0xC787, 0x01C7}, - {0xC788, 0x01C8}, - {0xC789, 0x01C9}, - {0xC78A, 0x01CA}, - {0xC78B, 0x01CB}, - {0xC78C, 0x01CC}, - {0xC78D, 0x01CD}, - {0xC78E, 0x01CE}, - {0xC78F, 0x01CF}, - {0xC790, 0x01D0}, - {0xC791, 0x01D1}, - {0xC792, 0x01D2}, - {0xC793, 0x01D3}, - {0xC794, 0x01D4}, - {0xC795, 0x01D5}, - {0xC796, 0x01D6}, - {0xC797, 0x01D7}, - {0xC798, 0x01D8}, - {0xC799, 0x01D9}, - {0xC79A, 0x01DA}, - {0xC79B, 0x01DB}, - {0xC79C, 0x01DC}, - {0xC79D, 0x01DD}, - {0xC79E, 0x01DE}, - {0xC79F, 0x01DF}, - {0xC7A0, 0x01E0}, - {0xC7A1, 0x01E1}, - {0xC7A2, 0x01E2}, - {0xC7A3, 0x01E3}, - {0xC7A4, 0x01E4}, - {0xC7A5, 0x01E5}, - {0xC7A6, 0x01E6}, - {0xC7A7, 0x01E7}, - {0xC7A8, 0x01E8}, - {0xC7A9, 0x01E9}, - {0xC7AA, 0x01EA}, - {0xC7AB, 0x01EB}, - {0xC7AC, 0x01EC}, - {0xC7AD, 0x01ED}, - {0xC7AE, 0x01EE}, - {0xC7AF, 0x01EF}, - {0xC7B0, 0x01F0}, - {0xC7B1, 0x01F1}, - {0xC7B2, 0x01F2}, - {0xC7B3, 0x01F3}, - {0xC7B4, 0x01F4}, - {0xC7B5, 0x01F5}, - {0xC7B6, 0x01F6}, - {0xC7B7, 0x01F7}, - {0xC7B8, 0x01F8}, - {0xC7B9, 0x01F9}, - {0xC7BA, 0x01FA}, - {0xC7BB, 0x01FB}, - {0xC7BC, 0x01FC}, - {0xC7BD, 0x01FD}, - {0xC7BE, 0x01FE}, - {0xC7BF, 0x01FF}, - {0xC880, 0x0200}, - {0xC881, 0x0201}, - {0xC882, 0x0202}, - {0xC883, 0x0203}, - {0xC884, 0x0204}, - {0xC885, 0x0205}, - {0xC886, 0x0206}, - {0xC887, 0x0207}, - {0xC888, 0x0208}, - {0xC889, 0x0209}, - {0xC88A, 0x020A}, - {0xC88B, 0x020B}, - {0xC88C, 0x020C}, - {0xC88D, 0x020D}, - {0xC88E, 0x020E}, - {0xC88F, 0x020F}, - {0xC890, 0x0210}, - {0xC891, 0x0211}, - {0xC892, 0x0212}, - {0xC893, 0x0213}, - {0xC894, 0x0214}, - {0xC895, 0x0215}, - {0xC896, 0x0216}, - {0xC897, 0x0217}, - {0xC898, 0x0218}, - {0xC899, 0x0219}, - {0xC89A, 0x021A}, - {0xC89B, 0x021B}, - {0xC89C, 0x021C}, - {0xC89D, 0x021D}, - {0xC89E, 0x021E}, - {0xC89F, 0x021F}, - {0xC8A0, 0x0220}, - {0xC8A1, 0x0221}, - {0xC8A2, 0x0222}, - {0xC8A3, 0x0223}, - {0xC8A4, 0x0224}, - {0xC8A5, 0x0225}, - {0xC8A6, 0x0226}, - {0xC8A7, 0x0227}, - {0xC8A8, 0x0228}, - {0xC8A9, 0x0229}, - {0xC8AA, 0x022A}, - {0xC8AB, 0x022B}, - {0xC8AC, 0x022C}, - {0xC8AD, 0x022D}, - {0xC8AE, 0x022E}, - {0xC8AF, 0x022F}, - {0xC8B0, 0x0230}, - {0xC8B1, 0x0231}, - {0xC8B2, 0x0232}, - {0xC8B3, 0x0233}, - {0xC8B4, 0x0234}, - {0xC8B5, 0x0235}, - {0xC8B6, 0x0236}, - {0xC8B7, 0x0237}, - {0xC8B8, 0x0238}, - {0xC8B9, 0x0239}, - {0xC8BA, 0x023A}, - {0xC8BB, 0x023B}, - {0xC8BC, 0x023C}, - {0xC8BD, 0x023D}, - {0xC8BE, 0x023E}, - {0xC8BF, 0x023F}, - {0xC980, 0x0240}, - {0xC981, 0x0241}, - {0xC982, 0x0242}, - {0xC983, 0x0243}, - {0xC984, 0x0244}, - {0xC985, 0x0245}, - {0xC986, 0x0246}, - {0xC987, 0x0247}, - {0xC988, 0x0248}, - {0xC989, 0x0249}, - {0xC98A, 0x024A}, - {0xC98B, 0x024B}, - {0xC98C, 0x024C}, - {0xC98D, 0x024D}, - {0xC98E, 0x024E}, - {0xC98F, 0x024F}, - {0xC990, 0x0250}, - {0xC991, 0x0251}, - {0xC992, 0x0252}, - {0xC993, 0x0253}, - {0xC994, 0x0254}, - {0xC995, 0x0255}, - {0xC996, 0x0256}, - {0xC997, 0x0257}, - {0xC998, 0x0258}, - {0xC999, 0x0259}, - {0xC99A, 0x025A}, - {0xC99B, 0x025B}, - {0xC99C, 0x025C}, - {0xC99D, 0x025D}, - {0xC99E, 0x025E}, - {0xC99F, 0x025F}, - {0xC9A0, 0x0260}, - {0xC9A1, 0x0261}, - {0xC9A2, 0x0262}, - {0xC9A3, 0x0263}, - {0xC9A4, 0x0264}, - {0xC9A5, 0x0265}, - {0xC9A6, 0x0266}, - {0xC9A7, 0x0267}, - {0xC9A8, 0x0268}, - {0xC9A9, 0x0269}, - {0xC9AA, 0x026A}, - {0xC9AB, 0x026B}, - {0xC9AC, 0x026C}, - {0xC9AD, 0x026D}, - {0xC9AE, 0x026E}, - {0xC9AF, 0x026F}, - {0xC9B0, 0x0270}, - {0xC9B1, 0x0271}, - {0xC9B2, 0x0272}, - {0xC9B3, 0x0273}, - {0xC9B4, 0x0274}, - {0xC9B5, 0x0275}, - {0xC9B6, 0x0276}, - {0xC9B7, 0x0277}, - {0xC9B8, 0x0278}, - {0xC9B9, 0x0279}, - {0xC9BA, 0x027A}, - {0xC9BB, 0x027B}, - {0xC9BC, 0x027C}, - {0xC9BD, 0x027D}, - {0xC9BE, 0x027E}, - {0xC9BF, 0x027F}, - {0xCA80, 0x0280}, - {0xCA81, 0x0281}, - {0xCA82, 0x0282}, - {0xCA83, 0x0283}, - {0xCA84, 0x0284}, - {0xCA85, 0x0285}, - {0xCA86, 0x0286}, - {0xCA87, 0x0287}, - {0xCA88, 0x0288}, - {0xCA89, 0x0289}, - {0xCA8A, 0x028A}, - {0xCA8B, 0x028B}, - {0xCA8C, 0x028C}, - {0xCA8D, 0x028D}, - {0xCA8E, 0x028E}, - {0xCA8F, 0x028F}, - {0xCA90, 0x0290}, - {0xCA91, 0x0291}, - {0xCA92, 0x0292}, - {0xCA93, 0x0293}, - {0xCA94, 0x0294}, - {0xCA95, 0x0295}, - {0xCA96, 0x0296}, - {0xCA97, 0x0297}, - {0xCA98, 0x0298}, - {0xCA99, 0x0299}, - {0xCA9A, 0x029A}, - {0xCA9B, 0x029B}, - {0xCA9C, 0x029C}, - {0xCA9D, 0x029D}, - {0xCA9E, 0x029E}, - {0xCA9F, 0x029F}, - {0xCAA0, 0x02A0}, - {0xCAA1, 0x02A1}, - {0xCAA2, 0x02A2}, - {0xCAA3, 0x02A3}, - {0xCAA4, 0x02A4}, - {0xCAA5, 0x02A5}, - {0xCAA6, 0x02A6}, - {0xCAA7, 0x02A7}, - {0xCAA8, 0x02A8}, - {0xCAA9, 0x02A9}, - {0xCAAA, 0x02AA}, - {0xCAAB, 0x02AB}, - {0xCAAC, 0x02AC}, - {0xCAAD, 0x02AD}, - {0xCAAE, 0x02AE}, - {0xCAAF, 0x02AF}, - {0xCAB0, 0x02B0}, - {0xCAB1, 0x02B1}, - {0xCAB2, 0x02B2}, - {0xCAB3, 0x02B3}, - {0xCAB4, 0x02B4}, - {0xCAB5, 0x02B5}, - {0xCAB6, 0x02B6}, - {0xCAB7, 0x02B7}, - {0xCAB8, 0x02B8}, - {0xCAB9, 0x02B9}, - {0xCABA, 0x02BA}, - {0xCABB, 0x02BB}, - {0xCABC, 0x02BC}, - {0xCABD, 0x02BD}, - {0xCABE, 0x02BE}, - {0xCABF, 0x02BF}, - {0xCB80, 0x02C0}, - {0xCB81, 0x02C1}, - {0xCB82, 0x02C2}, - {0xCB83, 0x02C3}, - {0xCB84, 0x02C4}, - {0xCB85, 0x02C5}, - {0xCB86, 0x02C6}, - {0xCB87, 0x02C7}, - {0xCB88, 0x02C8}, - {0xCB89, 0x02C9}, - {0xCB8A, 0x02CA}, - {0xCB8B, 0x02CB}, - {0xCB8C, 0x02CC}, - {0xCB8D, 0x02CD}, - {0xCB8E, 0x02CE}, - {0xCB8F, 0x02CF}, - {0xCB90, 0x02D0}, - {0xCB91, 0x02D1}, - {0xCB92, 0x02D2}, - {0xCB93, 0x02D3}, - {0xCB94, 0x02D4}, - {0xCB95, 0x02D5}, - {0xCB96, 0x02D6}, - {0xCB97, 0x02D7}, - {0xCB98, 0x02D8}, - {0xCB99, 0x02D9}, - {0xCB9A, 0x02DA}, - {0xCB9B, 0x02DB}, - {0xCB9C, 0x02DC}, - {0xCB9D, 0x02DD}, - {0xCB9E, 0x02DE}, - {0xCB9F, 0x02DF}, - {0xCBA0, 0x02E0}, - {0xCBA1, 0x02E1}, - {0xCBA2, 0x02E2}, - {0xCBA3, 0x02E3}, - {0xCBA4, 0x02E4}, - {0xCBA5, 0x02E5}, - {0xCBA6, 0x02E6}, - {0xCBA7, 0x02E7}, - {0xCBA8, 0x02E8}, - {0xCBA9, 0x02E9}, - {0xCBAA, 0x02EA}, - {0xCBAB, 0x02EB}, - {0xCBAC, 0x02EC}, - {0xCBAD, 0x02ED}, - {0xCBAE, 0x02EE}, - {0xCBAF, 0x02EF}, - {0xCBB0, 0x02F0}, - {0xCBB1, 0x02F1}, - {0xCBB2, 0x02F2}, - {0xCBB3, 0x02F3}, - {0xCBB4, 0x02F4}, - {0xCBB5, 0x02F5}, - {0xCBB6, 0x02F6}, - {0xCBB7, 0x02F7}, - {0xCBB8, 0x02F8}, - {0xCBB9, 0x02F9}, - {0xCBBA, 0x02FA}, - {0xCBBB, 0x02FB}, - {0xCBBC, 0x02FC}, - {0xCBBD, 0x02FD}, - {0xCBBE, 0x02FE}, - {0xCBBF, 0x02FF}, - {0xCC80, 0x0300}, - {0xCC81, 0x0301}, - {0xCC82, 0x0302}, - {0xCC83, 0x0303}, - {0xCC84, 0x0304}, - {0xCC85, 0x0305}, - {0xCC86, 0x0306}, - {0xCC87, 0x0307}, - {0xCC88, 0x0308}, - {0xCC89, 0x0309}, - {0xCC8A, 0x030A}, - {0xCC8B, 0x030B}, - {0xCC8C, 0x030C}, - {0xCC8D, 0x030D}, - {0xCC8E, 0x030E}, - {0xCC8F, 0x030F}, - {0xCC90, 0x0310}, - {0xCC91, 0x0311}, - {0xCC92, 0x0312}, - {0xCC93, 0x0313}, - {0xCC94, 0x0314}, - {0xCC95, 0x0315}, - {0xCC96, 0x0316}, - {0xCC97, 0x0317}, - {0xCC98, 0x0318}, - {0xCC99, 0x0319}, - {0xCC9A, 0x031A}, - {0xCC9B, 0x031B}, - {0xCC9C, 0x031C}, - {0xCC9D, 0x031D}, - {0xCC9E, 0x031E}, - {0xCC9F, 0x031F}, - {0xCCA0, 0x0320}, - {0xCCA1, 0x0321}, - {0xCCA2, 0x0322}, - {0xCCA3, 0x0323}, - {0xCCA4, 0x0324}, - {0xCCA5, 0x0325}, - {0xCCA6, 0x0326}, - {0xCCA7, 0x0327}, - {0xCCA8, 0x0328}, - {0xCCA9, 0x0329}, - {0xCCAA, 0x032A}, - {0xCCAB, 0x032B}, - {0xCCAC, 0x032C}, - {0xCCAD, 0x032D}, - {0xCCAE, 0x032E}, - {0xCCAF, 0x032F}, - {0xCCB0, 0x0330}, - {0xCCB1, 0x0331}, - {0xCCB2, 0x0332}, - {0xCCB3, 0x0333}, - {0xCCB4, 0x0334}, - {0xCCB5, 0x0335}, - {0xCCB6, 0x0336}, - {0xCCB7, 0x0337}, - {0xCCB8, 0x0338}, - {0xCCB9, 0x0339}, - {0xCCBA, 0x033A}, - {0xCCBB, 0x033B}, - {0xCCBC, 0x033C}, - {0xCCBD, 0x033D}, - {0xCCBE, 0x033E}, - {0xCCBF, 0x033F}, - {0xCD80, 0x0340}, - {0xCD81, 0x0341}, - {0xCD82, 0x0342}, - {0xCD83, 0x0343}, - {0xCD84, 0x0344}, - {0xCD85, 0x0345}, - {0xCD86, 0x0346}, - {0xCD87, 0x0347}, - {0xCD88, 0x0348}, - {0xCD89, 0x0349}, - {0xCD8A, 0x034A}, - {0xCD8B, 0x034B}, - {0xCD8C, 0x034C}, - {0xCD8D, 0x034D}, - {0xCD8E, 0x034E}, - {0xCD8F, 0x034F}, - {0xCD90, 0x0350}, - {0xCD91, 0x0351}, - {0xCD92, 0x0352}, - {0xCD93, 0x0353}, - {0xCD94, 0x0354}, - {0xCD95, 0x0355}, - {0xCD96, 0x0356}, - {0xCD97, 0x0357}, - {0xCD98, 0x0358}, - {0xCD99, 0x0359}, - {0xCD9A, 0x035A}, - {0xCD9B, 0x035B}, - {0xCD9C, 0x035C}, - {0xCD9D, 0x035D}, - {0xCD9E, 0x035E}, - {0xCD9F, 0x035F}, - {0xCDA0, 0x0360}, - {0xCDA1, 0x0361}, - {0xCDA2, 0x0362}, - {0xCDA3, 0x0363}, - {0xCDA4, 0x0364}, - {0xCDA5, 0x0365}, - {0xCDA6, 0x0366}, - {0xCDA7, 0x0367}, - {0xCDA8, 0x0368}, - {0xCDA9, 0x0369}, - {0xCDAA, 0x036A}, - {0xCDAB, 0x036B}, - {0xCDAC, 0x036C}, - {0xCDAD, 0x036D}, - {0xCDAE, 0x036E}, - {0xCDAF, 0x036F}, - {0xCDB0, 0x0370}, - {0xCDB1, 0x0371}, - {0xCDB2, 0x0372}, - {0xCDB3, 0x0373}, - {0xCDB4, 0x0374}, - {0xCDB5, 0x0375}, - {0xCDB6, 0x0376}, - {0xCDB7, 0x0377}, - {0xCDB8, 0x0378}, - {0xCDB9, 0x0379}, - {0xCDBA, 0x037A}, - {0xCDBB, 0x037B}, - {0xCDBC, 0x037C}, - {0xCDBD, 0x037D}, - {0xCDBE, 0x037E}, - {0xCDBF, 0x037F}, - {0xCE80, 0x0380}, - {0xCE81, 0x0381}, - {0xCE82, 0x0382}, - {0xCE83, 0x0383}, - {0xCE84, 0x0384}, - {0xCE85, 0x0385}, - {0xCE86, 0x0386}, - {0xCE87, 0x0387}, - {0xCE88, 0x0388}, - {0xCE89, 0x0389}, - {0xCE8A, 0x038A}, - {0xCE8B, 0x038B}, - {0xCE8C, 0x038C}, - {0xCE8D, 0x038D}, - {0xCE8E, 0x038E}, - {0xCE8F, 0x038F}, - {0xCE90, 0x0390}, - {0xCE91, 0x0391}, - {0xCE92, 0x0392}, - {0xCE93, 0x0393}, - {0xCE94, 0x0394}, - {0xCE95, 0x0395}, - {0xCE96, 0x0396}, - {0xCE97, 0x0397}, - {0xCE98, 0x0398}, - {0xCE99, 0x0399}, - {0xCE9A, 0x039A}, - {0xCE9B, 0x039B}, - {0xCE9C, 0x039C}, - {0xCE9D, 0x039D}, - {0xCE9E, 0x039E}, - {0xCE9F, 0x039F}, - {0xCEA0, 0x03A0}, - {0xCEA1, 0x03A1}, - {0xCEA2, 0x03A2}, - {0xCEA3, 0x03A3}, - {0xCEA4, 0x03A4}, - {0xCEA5, 0x03A5}, - {0xCEA6, 0x03A6}, - {0xCEA7, 0x03A7}, - {0xCEA8, 0x03A8}, - {0xCEA9, 0x03A9}, - {0xCEAA, 0x03AA}, - {0xCEAB, 0x03AB}, - {0xCEAC, 0x03AC}, - {0xCEAD, 0x03AD}, - {0xCEAE, 0x03AE}, - {0xCEAF, 0x03AF}, - {0xCEB0, 0x03B0}, - {0xCEB1, 0x03B1}, - {0xCEB2, 0x03B2}, - {0xCEB3, 0x03B3}, - {0xCEB4, 0x03B4}, - {0xCEB5, 0x03B5}, - {0xCEB6, 0x03B6}, - {0xCEB7, 0x03B7}, - {0xCEB8, 0x03B8}, - {0xCEB9, 0x03B9}, - {0xCEBA, 0x03BA}, - {0xCEBB, 0x03BB}, - {0xCEBC, 0x03BC}, - {0xCEBD, 0x03BD}, - {0xCEBE, 0x03BE}, - {0xCEBF, 0x03BF}, - {0xCF80, 0x03C0}, - {0xCF81, 0x03C1}, - {0xCF82, 0x03C2}, - {0xCF83, 0x03C3}, - {0xCF84, 0x03C4}, - {0xCF85, 0x03C5}, - {0xCF86, 0x03C6}, - {0xCF87, 0x03C7}, - {0xCF88, 0x03C8}, - {0xCF89, 0x03C9}, - {0xCF8A, 0x03CA}, - {0xCF8B, 0x03CB}, - {0xCF8C, 0x03CC}, - {0xCF8D, 0x03CD}, - {0xCF8E, 0x03CE}, - {0xCF8F, 0x03CF}, - {0xCF90, 0x03D0}, - {0xCF91, 0x03D1}, - {0xCF92, 0x03D2}, - {0xCF93, 0x03D3}, - {0xCF94, 0x03D4}, - {0xCF95, 0x03D5}, - {0xCF96, 0x03D6}, - {0xCF97, 0x03D7}, - {0xCF98, 0x03D8}, - {0xCF99, 0x03D9}, - {0xCF9A, 0x03DA}, - {0xCF9B, 0x03DB}, - {0xCF9C, 0x03DC}, - {0xCF9D, 0x03DD}, - {0xCF9E, 0x03DE}, - {0xCF9F, 0x03DF}, - {0xCFA0, 0x03E0}, - {0xCFA1, 0x03E1}, - {0xCFA2, 0x03E2}, - {0xCFA3, 0x03E3}, - {0xCFA4, 0x03E4}, - {0xCFA5, 0x03E5}, - {0xCFA6, 0x03E6}, - {0xCFA7, 0x03E7}, - {0xCFA8, 0x03E8}, - {0xCFA9, 0x03E9}, - {0xCFAA, 0x03EA}, - {0xCFAB, 0x03EB}, - {0xCFAC, 0x03EC}, - {0xCFAD, 0x03ED}, - {0xCFAE, 0x03EE}, - {0xCFAF, 0x03EF}, - {0xCFB0, 0x03F0}, - {0xCFB1, 0x03F1}, - {0xCFB2, 0x03F2}, - {0xCFB3, 0x03F3}, - {0xCFB4, 0x03F4}, - {0xCFB5, 0x03F5}, - {0xCFB6, 0x03F6}, - {0xCFB7, 0x03F7}, - {0xCFB8, 0x03F8}, - {0xCFB9, 0x03F9}, - {0xCFBA, 0x03FA}, - {0xCFBB, 0x03FB}, - {0xCFBC, 0x03FC}, - {0xCFBD, 0x03FD}, - {0xCFBE, 0x03FE}, - {0xCFBF, 0x03FF}, - {0xD080, 0x0400}, - {0xD081, 0x0401}, - {0xD082, 0x0402}, - {0xD083, 0x0403}, - {0xD084, 0x0404}, - {0xD085, 0x0405}, - {0xD086, 0x0406}, - {0xD087, 0x0407}, - {0xD088, 0x0408}, - {0xD089, 0x0409}, - {0xD08A, 0x040A}, - {0xD08B, 0x040B}, - {0xD08C, 0x040C}, - {0xD08D, 0x040D}, - {0xD08E, 0x040E}, - {0xD08F, 0x040F}, - {0xD090, 0x0410}, - {0xD091, 0x0411}, - {0xD092, 0x0412}, - {0xD093, 0x0413}, - {0xD094, 0x0414}, - {0xD095, 0x0415}, - {0xD096, 0x0416}, - {0xD097, 0x0417}, - {0xD098, 0x0418}, - {0xD099, 0x0419}, - {0xD09A, 0x041A}, - {0xD09B, 0x041B}, - {0xD09C, 0x041C}, - {0xD09D, 0x041D}, - {0xD09E, 0x041E}, - {0xD09F, 0x041F}, - {0xD0A0, 0x0420}, - {0xD0A1, 0x0421}, - {0xD0A2, 0x0422}, - {0xD0A3, 0x0423}, - {0xD0A4, 0x0424}, - {0xD0A5, 0x0425}, - {0xD0A6, 0x0426}, - {0xD0A7, 0x0427}, - {0xD0A8, 0x0428}, - {0xD0A9, 0x0429}, - {0xD0AA, 0x042A}, - {0xD0AB, 0x042B}, - {0xD0AC, 0x042C}, - {0xD0AD, 0x042D}, - {0xD0AE, 0x042E}, - {0xD0AF, 0x042F}, - {0xD0B0, 0x0430}, - {0xD0B1, 0x0431}, - {0xD0B2, 0x0432}, - {0xD0B3, 0x0433}, - {0xD0B4, 0x0434}, - {0xD0B5, 0x0435}, - {0xD0B6, 0x0436}, - {0xD0B7, 0x0437}, - {0xD0B8, 0x0438}, - {0xD0B9, 0x0439}, - {0xD0BA, 0x043A}, - {0xD0BB, 0x043B}, - {0xD0BC, 0x043C}, - {0xD0BD, 0x043D}, - {0xD0BE, 0x043E}, - {0xD0BF, 0x043F}, - {0xD180, 0x0440}, - {0xD181, 0x0441}, - {0xD182, 0x0442}, - {0xD183, 0x0443}, - {0xD184, 0x0444}, - {0xD185, 0x0445}, - {0xD186, 0x0446}, - {0xD187, 0x0447}, - {0xD188, 0x0448}, - {0xD189, 0x0449}, - {0xD18A, 0x044A}, - {0xD18B, 0x044B}, - {0xD18C, 0x044C}, - {0xD18D, 0x044D}, - {0xD18E, 0x044E}, - {0xD18F, 0x044F}, - {0xD190, 0x0450}, - {0xD191, 0x0451}, - {0xD192, 0x0452}, - {0xD193, 0x0453}, - {0xD194, 0x0454}, - {0xD195, 0x0455}, - {0xD196, 0x0456}, - {0xD197, 0x0457}, - {0xD198, 0x0458}, - {0xD199, 0x0459}, - {0xD19A, 0x045A}, - {0xD19B, 0x045B}, - {0xD19C, 0x045C}, - {0xD19D, 0x045D}, - {0xD19E, 0x045E}, - {0xD19F, 0x045F}, - {0xD1A0, 0x0460}, - {0xD1A1, 0x0461}, - {0xD1A2, 0x0462}, - {0xD1A3, 0x0463}, - {0xD1A4, 0x0464}, - {0xD1A5, 0x0465}, - {0xD1A6, 0x0466}, - {0xD1A7, 0x0467}, - {0xD1A8, 0x0468}, - {0xD1A9, 0x0469}, - {0xD1AA, 0x046A}, - {0xD1AB, 0x046B}, - {0xD1AC, 0x046C}, - {0xD1AD, 0x046D}, - {0xD1AE, 0x046E}, - {0xD1AF, 0x046F}, - {0xD1B0, 0x0470}, - {0xD1B1, 0x0471}, - {0xD1B2, 0x0472}, - {0xD1B3, 0x0473}, - {0xD1B4, 0x0474}, - {0xD1B5, 0x0475}, - {0xD1B6, 0x0476}, - {0xD1B7, 0x0477}, - {0xD1B8, 0x0478}, - {0xD1B9, 0x0479}, - {0xD1BA, 0x047A}, - {0xD1BB, 0x047B}, - {0xD1BC, 0x047C}, - {0xD1BD, 0x047D}, - {0xD1BE, 0x047E}, - {0xD1BF, 0x047F}, - {0xD280, 0x0480}, - {0xD281, 0x0481}, - {0xD282, 0x0482}, - {0xD283, 0x0483}, - {0xD284, 0x0484}, - {0xD285, 0x0485}, - {0xD286, 0x0486}, - {0xD287, 0x0487}, - {0xD288, 0x0488}, - {0xD289, 0x0489}, - {0xD28A, 0x048A}, - {0xD28B, 0x048B}, - {0xD28C, 0x048C}, - {0xD28D, 0x048D}, - {0xD28E, 0x048E}, - {0xD28F, 0x048F}, - {0xD290, 0x0490}, - {0xD291, 0x0491}, - {0xD292, 0x0492}, - {0xD293, 0x0493}, - {0xD294, 0x0494}, - {0xD295, 0x0495}, - {0xD296, 0x0496}, - {0xD297, 0x0497}, - {0xD298, 0x0498}, - {0xD299, 0x0499}, - {0xD29A, 0x049A}, - {0xD29B, 0x049B}, - {0xD29C, 0x049C}, - {0xD29D, 0x049D}, - {0xD29E, 0x049E}, - {0xD29F, 0x049F}, - {0xD2A0, 0x04A0}, - {0xD2A1, 0x04A1}, - {0xD2A2, 0x04A2}, - {0xD2A3, 0x04A3}, - {0xD2A4, 0x04A4}, - {0xD2A5, 0x04A5}, - {0xD2A6, 0x04A6}, - {0xD2A7, 0x04A7}, - {0xD2A8, 0x04A8}, - {0xD2A9, 0x04A9}, - {0xD2AA, 0x04AA}, - {0xD2AB, 0x04AB}, - {0xD2AC, 0x04AC}, - {0xD2AD, 0x04AD}, - {0xD2AE, 0x04AE}, - {0xD2AF, 0x04AF}, - {0xD2B0, 0x04B0}, - {0xD2B1, 0x04B1}, - {0xD2B2, 0x04B2}, - {0xD2B3, 0x04B3}, - {0xD2B4, 0x04B4}, - {0xD2B5, 0x04B5}, - {0xD2B6, 0x04B6}, - {0xD2B7, 0x04B7}, - {0xD2B8, 0x04B8}, - {0xD2B9, 0x04B9}, - {0xD2BA, 0x04BA}, - {0xD2BB, 0x04BB}, - {0xD2BC, 0x04BC}, - {0xD2BD, 0x04BD}, - {0xD2BE, 0x04BE}, - {0xD2BF, 0x04BF}, - {0xD380, 0x04C0}, - {0xD381, 0x04C1}, - {0xD382, 0x04C2}, - {0xD383, 0x04C3}, - {0xD384, 0x04C4}, - {0xD385, 0x04C5}, - {0xD386, 0x04C6}, - {0xD387, 0x04C7}, - {0xD388, 0x04C8}, - {0xD389, 0x04C9}, - {0xD38A, 0x04CA}, - {0xD38B, 0x04CB}, - {0xD38C, 0x04CC}, - {0xD38D, 0x04CD}, - {0xD38E, 0x04CE}, - {0xD38F, 0x04CF}, - {0xD390, 0x04D0}, - {0xD391, 0x04D1}, - {0xD392, 0x04D2}, - {0xD393, 0x04D3}, - {0xD394, 0x04D4}, - {0xD395, 0x04D5}, - {0xD396, 0x04D6}, - {0xD397, 0x04D7}, - {0xD398, 0x04D8}, - {0xD399, 0x04D9}, - {0xD39A, 0x04DA}, - {0xD39B, 0x04DB}, - {0xD39C, 0x04DC}, - {0xD39D, 0x04DD}, - {0xD39E, 0x04DE}, - {0xD39F, 0x04DF}, - {0xD3A0, 0x04E0}, - {0xD3A1, 0x04E1}, - {0xD3A2, 0x04E2}, - {0xD3A3, 0x04E3}, - {0xD3A4, 0x04E4}, - {0xD3A5, 0x04E5}, - {0xD3A6, 0x04E6}, - {0xD3A7, 0x04E7}, - {0xD3A8, 0x04E8}, - {0xD3A9, 0x04E9}, - {0xD3AA, 0x04EA}, - {0xD3AB, 0x04EB}, - {0xD3AC, 0x04EC}, - {0xD3AD, 0x04ED}, - {0xD3AE, 0x04EE}, - {0xD3AF, 0x04EF}, - {0xD3B0, 0x04F0}, - {0xD3B1, 0x04F1}, - {0xD3B2, 0x04F2}, - {0xD3B3, 0x04F3}, - {0xD3B4, 0x04F4}, - {0xD3B5, 0x04F5}, - {0xD3B6, 0x04F6}, - {0xD3B7, 0x04F7}, - {0xD3B8, 0x04F8}, - {0xD3B9, 0x04F9}, - {0xD3BA, 0x04FA}, - {0xD3BB, 0x04FB}, - {0xD3BC, 0x04FC}, - {0xD3BD, 0x04FD}, - {0xD3BE, 0x04FE}, - {0xD3BF, 0x04FF}, - {0xD480, 0x0500}, - {0xD481, 0x0501}, - {0xD482, 0x0502}, - {0xD483, 0x0503}, - {0xD484, 0x0504}, - {0xD485, 0x0505}, - {0xD486, 0x0506}, - {0xD487, 0x0507}, - {0xD488, 0x0508}, - {0xD489, 0x0509}, - {0xD48A, 0x050A}, - {0xD48B, 0x050B}, - {0xD48C, 0x050C}, - {0xD48D, 0x050D}, - {0xD48E, 0x050E}, - {0xD48F, 0x050F}, - {0xD490, 0x0510}, - {0xD491, 0x0511}, - {0xD492, 0x0512}, - {0xD493, 0x0513}, - {0xD494, 0x0514}, - {0xD495, 0x0515}, - {0xD496, 0x0516}, - {0xD497, 0x0517}, - {0xD498, 0x0518}, - {0xD499, 0x0519}, - {0xD49A, 0x051A}, - {0xD49B, 0x051B}, - {0xD49C, 0x051C}, - {0xD49D, 0x051D}, - {0xD49E, 0x051E}, - {0xD49F, 0x051F}, - {0xD4A0, 0x0520}, - {0xD4A1, 0x0521}, - {0xD4A2, 0x0522}, - {0xD4A3, 0x0523}, - {0xD4A4, 0x0524}, - {0xD4A5, 0x0525}, - {0xD4A6, 0x0526}, - {0xD4A7, 0x0527}, - {0xD4A8, 0x0528}, - {0xD4A9, 0x0529}, - {0xD4AA, 0x052A}, - {0xD4AB, 0x052B}, - {0xD4AC, 0x052C}, - {0xD4AD, 0x052D}, - {0xD4AE, 0x052E}, - {0xD4AF, 0x052F}, - {0xD4B0, 0x0530}, - {0xD4B1, 0x0531}, - {0xD4B2, 0x0532}, - {0xD4B3, 0x0533}, - {0xD4B4, 0x0534}, - {0xD4B5, 0x0535}, - {0xD4B6, 0x0536}, - {0xD4B7, 0x0537}, - {0xD4B8, 0x0538}, - {0xD4B9, 0x0539}, - {0xD4BA, 0x053A}, - {0xD4BB, 0x053B}, - {0xD4BC, 0x053C}, - {0xD4BD, 0x053D}, - {0xD4BE, 0x053E}, - {0xD4BF, 0x053F}, - {0xD580, 0x0540}, - {0xD581, 0x0541}, - {0xD582, 0x0542}, - {0xD583, 0x0543}, - {0xD584, 0x0544}, - {0xD585, 0x0545}, - {0xD586, 0x0546}, - {0xD587, 0x0547}, - {0xD588, 0x0548}, - {0xD589, 0x0549}, - {0xD58A, 0x054A}, - {0xD58B, 0x054B}, - {0xD58C, 0x054C}, - {0xD58D, 0x054D}, - {0xD58E, 0x054E}, - {0xD58F, 0x054F}, - {0xD590, 0x0550}, - {0xD591, 0x0551}, - {0xD592, 0x0552}, - {0xD593, 0x0553}, - {0xD594, 0x0554}, - {0xD595, 0x0555}, - {0xD596, 0x0556}, - {0xD597, 0x0557}, - {0xD598, 0x0558}, - {0xD599, 0x0559}, - {0xD59A, 0x055A}, - {0xD59B, 0x055B}, - {0xD59C, 0x055C}, - {0xD59D, 0x055D}, - {0xD59E, 0x055E}, - {0xD59F, 0x055F}, - {0xD5A0, 0x0560}, - {0xD5A1, 0x0561}, - {0xD5A2, 0x0562}, - {0xD5A3, 0x0563}, - {0xD5A4, 0x0564}, - {0xD5A5, 0x0565}, - {0xD5A6, 0x0566}, - {0xD5A7, 0x0567}, - {0xD5A8, 0x0568}, - {0xD5A9, 0x0569}, - {0xD5AA, 0x056A}, - {0xD5AB, 0x056B}, - {0xD5AC, 0x056C}, - {0xD5AD, 0x056D}, - {0xD5AE, 0x056E}, - {0xD5AF, 0x056F}, - {0xD5B0, 0x0570}, - {0xD5B1, 0x0571}, - {0xD5B2, 0x0572}, - {0xD5B3, 0x0573}, - {0xD5B4, 0x0574}, - {0xD5B5, 0x0575}, - {0xD5B6, 0x0576}, - {0xD5B7, 0x0577}, - {0xD5B8, 0x0578}, - {0xD5B9, 0x0579}, - {0xD5BA, 0x057A}, - {0xD5BB, 0x057B}, - {0xD5BC, 0x057C}, - {0xD5BD, 0x057D}, - {0xD5BE, 0x057E}, - {0xD5BF, 0x057F}, - {0xD680, 0x0580}, - {0xD681, 0x0581}, - {0xD682, 0x0582}, - {0xD683, 0x0583}, - {0xD684, 0x0584}, - {0xD685, 0x0585}, - {0xD686, 0x0586}, - {0xD687, 0x0587}, - {0xD688, 0x0588}, - {0xD689, 0x0589}, - {0xD68A, 0x058A}, - {0xD68B, 0x058B}, - {0xD68C, 0x058C}, - {0xD68D, 0x058D}, - {0xD68E, 0x058E}, - {0xD68F, 0x058F}, - {0xD690, 0x0590}, - {0xD691, 0x0591}, - {0xD692, 0x0592}, - {0xD693, 0x0593}, - {0xD694, 0x0594}, - {0xD695, 0x0595}, - {0xD696, 0x0596}, - {0xD697, 0x0597}, - {0xD698, 0x0598}, - {0xD699, 0x0599}, - {0xD69A, 0x059A}, - {0xD69B, 0x059B}, - {0xD69C, 0x059C}, - {0xD69D, 0x059D}, - {0xD69E, 0x059E}, - {0xD69F, 0x059F}, - {0xD6A0, 0x05A0}, - {0xD6A1, 0x05A1}, - {0xD6A2, 0x05A2}, - {0xD6A3, 0x05A3}, - {0xD6A4, 0x05A4}, - {0xD6A5, 0x05A5}, - {0xD6A6, 0x05A6}, - {0xD6A7, 0x05A7}, - {0xD6A8, 0x05A8}, - {0xD6A9, 0x05A9}, - {0xD6AA, 0x05AA}, - {0xD6AB, 0x05AB}, - {0xD6AC, 0x05AC}, - {0xD6AD, 0x05AD}, - {0xD6AE, 0x05AE}, - {0xD6AF, 0x05AF}, - {0xD6B0, 0x05B0}, - {0xD6B1, 0x05B1}, - {0xD6B2, 0x05B2}, - {0xD6B3, 0x05B3}, - {0xD6B4, 0x05B4}, - {0xD6B5, 0x05B5}, - {0xD6B6, 0x05B6}, - {0xD6B7, 0x05B7}, - {0xD6B8, 0x05B8}, - {0xD6B9, 0x05B9}, - {0xD6BA, 0x05BA}, - {0xD6BB, 0x05BB}, - {0xD6BC, 0x05BC}, - {0xD6BD, 0x05BD}, - {0xD6BE, 0x05BE}, - {0xD6BF, 0x05BF}, - {0xD780, 0x05C0}, - {0xD781, 0x05C1}, - {0xD782, 0x05C2}, - {0xD783, 0x05C3}, - {0xD784, 0x05C4}, - {0xD785, 0x05C5}, - {0xD786, 0x05C6}, - {0xD787, 0x05C7}, - {0xD788, 0x05C8}, - {0xD789, 0x05C9}, - {0xD78A, 0x05CA}, - {0xD78B, 0x05CB}, - {0xD78C, 0x05CC}, - {0xD78D, 0x05CD}, - {0xD78E, 0x05CE}, - {0xD78F, 0x05CF}, - {0xD790, 0x05D0}, - {0xD791, 0x05D1}, - {0xD792, 0x05D2}, - {0xD793, 0x05D3}, - {0xD794, 0x05D4}, - {0xD795, 0x05D5}, - {0xD796, 0x05D6}, - {0xD797, 0x05D7}, - {0xD798, 0x05D8}, - {0xD799, 0x05D9}, - {0xD79A, 0x05DA}, - {0xD79B, 0x05DB}, - {0xD79C, 0x05DC}, - {0xD79D, 0x05DD}, - {0xD79E, 0x05DE}, - {0xD79F, 0x05DF}, - {0xD7A0, 0x05E0}, - {0xD7A1, 0x05E1}, - {0xD7A2, 0x05E2}, - {0xD7A3, 0x05E3}, - {0xD7A4, 0x05E4}, - {0xD7A5, 0x05E5}, - {0xD7A6, 0x05E6}, - {0xD7A7, 0x05E7}, - {0xD7A8, 0x05E8}, - {0xD7A9, 0x05E9}, - {0xD7AA, 0x05EA}, - {0xD7AB, 0x05EB}, - {0xD7AC, 0x05EC}, - {0xD7AD, 0x05ED}, - {0xD7AE, 0x05EE}, - {0xD7AF, 0x05EF}, - {0xD7B0, 0x05F0}, - {0xD7B1, 0x05F1}, - {0xD7B2, 0x05F2}, - {0xD7B3, 0x05F3}, - {0xD7B4, 0x05F4}, - {0xD7B5, 0x05F5}, - {0xD7B6, 0x05F6}, - {0xD7B7, 0x05F7}, - {0xD7B8, 0x05F8}, - {0xD7B9, 0x05F9}, - {0xD7BA, 0x05FA}, - {0xD7BB, 0x05FB}, - {0xD7BC, 0x05FC}, - {0xD7BD, 0x05FD}, - {0xD7BE, 0x05FE}, - {0xD7BF, 0x05FF}, - {0xD880, 0x0600}, - {0xD881, 0x0601}, - {0xD882, 0x0602}, - {0xD883, 0x0603}, - {0xD884, 0x0604}, - {0xD885, 0x0605}, - {0xD886, 0x0606}, - {0xD887, 0x0607}, - {0xD888, 0x0608}, - {0xD889, 0x0609}, - {0xD88A, 0x060A}, - {0xD88B, 0x060B}, - {0xD88C, 0x060C}, - {0xD88D, 0x060D}, - {0xD88E, 0x060E}, - {0xD88F, 0x060F}, - {0xD890, 0x0610}, - {0xD891, 0x0611}, - {0xD892, 0x0612}, - {0xD893, 0x0613}, - {0xD894, 0x0614}, - {0xD895, 0x0615}, - {0xD896, 0x0616}, - {0xD897, 0x0617}, - {0xD898, 0x0618}, - {0xD899, 0x0619}, - {0xD89A, 0x061A}, - {0xD89B, 0x061B}, - {0xD89C, 0x061C}, - {0xD89D, 0x061D}, - {0xD89E, 0x061E}, - {0xD89F, 0x061F}, - {0xD8A0, 0x0620}, - {0xD8A1, 0x0621}, - {0xD8A2, 0x0622}, - {0xD8A3, 0x0623}, - {0xD8A4, 0x0624}, - {0xD8A5, 0x0625}, - {0xD8A6, 0x0626}, - {0xD8A7, 0x0627}, - {0xD8A8, 0x0628}, - {0xD8A9, 0x0629}, - {0xD8AA, 0x062A}, - {0xD8AB, 0x062B}, - {0xD8AC, 0x062C}, - {0xD8AD, 0x062D}, - {0xD8AE, 0x062E}, - {0xD8AF, 0x062F}, - {0xD8B0, 0x0630}, - {0xD8B1, 0x0631}, - {0xD8B2, 0x0632}, - {0xD8B3, 0x0633}, - {0xD8B4, 0x0634}, - {0xD8B5, 0x0635}, - {0xD8B6, 0x0636}, - {0xD8B7, 0x0637}, - {0xD8B8, 0x0638}, - {0xD8B9, 0x0639}, - {0xD8BA, 0x063A}, - {0xD8BB, 0x063B}, - {0xD8BC, 0x063C}, - {0xD8BD, 0x063D}, - {0xD8BE, 0x063E}, - {0xD8BF, 0x063F}, - {0xD980, 0x0640}, - {0xD981, 0x0641}, - {0xD982, 0x0642}, - {0xD983, 0x0643}, - {0xD984, 0x0644}, - {0xD985, 0x0645}, - {0xD986, 0x0646}, - {0xD987, 0x0647}, - {0xD988, 0x0648}, - {0xD989, 0x0649}, - {0xD98A, 0x064A}, - {0xD98B, 0x064B}, - {0xD98C, 0x064C}, - {0xD98D, 0x064D}, - {0xD98E, 0x064E}, - {0xD98F, 0x064F}, - {0xD990, 0x0650}, - {0xD991, 0x0651}, - {0xD992, 0x0652}, - {0xD993, 0x0653}, - {0xD994, 0x0654}, - {0xD995, 0x0655}, - {0xD996, 0x0656}, - {0xD997, 0x0657}, - {0xD998, 0x0658}, - {0xD999, 0x0659}, - {0xD99A, 0x065A}, - {0xD99B, 0x065B}, - {0xD99C, 0x065C}, - {0xD99D, 0x065D}, - {0xD99E, 0x065E}, - {0xD99F, 0x065F}, - {0xD9A0, 0x0660}, - {0xD9A1, 0x0661}, - {0xD9A2, 0x0662}, - {0xD9A3, 0x0663}, - {0xD9A4, 0x0664}, - {0xD9A5, 0x0665}, - {0xD9A6, 0x0666}, - {0xD9A7, 0x0667}, - {0xD9A8, 0x0668}, - {0xD9A9, 0x0669}, - {0xD9AA, 0x066A}, - {0xD9AB, 0x066B}, - {0xD9AC, 0x066C}, - {0xD9AD, 0x066D}, - {0xD9AE, 0x066E}, - {0xD9AF, 0x066F}, - {0xD9B0, 0x0670}, - {0xD9B1, 0x0671}, - {0xD9B2, 0x0672}, - {0xD9B3, 0x0673}, - {0xD9B4, 0x0674}, - {0xD9B5, 0x0675}, - {0xD9B6, 0x0676}, - {0xD9B7, 0x0677}, - {0xD9B8, 0x0678}, - {0xD9B9, 0x0679}, - {0xD9BA, 0x067A}, - {0xD9BB, 0x067B}, - {0xD9BC, 0x067C}, - {0xD9BD, 0x067D}, - {0xD9BE, 0x067E}, - {0xD9BF, 0x067F}, - {0xDA80, 0x0680}, - {0xDA81, 0x0681}, - {0xDA82, 0x0682}, - {0xDA83, 0x0683}, - {0xDA84, 0x0684}, - {0xDA85, 0x0685}, - {0xDA86, 0x0686}, - {0xDA87, 0x0687}, - {0xDA88, 0x0688}, - {0xDA89, 0x0689}, - {0xDA8A, 0x068A}, - {0xDA8B, 0x068B}, - {0xDA8C, 0x068C}, - {0xDA8D, 0x068D}, - {0xDA8E, 0x068E}, - {0xDA8F, 0x068F}, - {0xDA90, 0x0690}, - {0xDA91, 0x0691}, - {0xDA92, 0x0692}, - {0xDA93, 0x0693}, - {0xDA94, 0x0694}, - {0xDA95, 0x0695}, - {0xDA96, 0x0696}, - {0xDA97, 0x0697}, - {0xDA98, 0x0698}, - {0xDA99, 0x0699}, - {0xDA9A, 0x069A}, - {0xDA9B, 0x069B}, - {0xDA9C, 0x069C}, - {0xDA9D, 0x069D}, - {0xDA9E, 0x069E}, - {0xDA9F, 0x069F}, - {0xDAA0, 0x06A0}, - {0xDAA1, 0x06A1}, - {0xDAA2, 0x06A2}, - {0xDAA3, 0x06A3}, - {0xDAA4, 0x06A4}, - {0xDAA5, 0x06A5}, - {0xDAA6, 0x06A6}, - {0xDAA7, 0x06A7}, - {0xDAA8, 0x06A8}, - {0xDAA9, 0x06A9}, - {0xDAAA, 0x06AA}, - {0xDAAB, 0x06AB}, - {0xDAAC, 0x06AC}, - {0xDAAD, 0x06AD}, - {0xDAAE, 0x06AE}, - {0xDAAF, 0x06AF}, - {0xDAB0, 0x06B0}, - {0xDAB1, 0x06B1}, - {0xDAB2, 0x06B2}, - {0xDAB3, 0x06B3}, - {0xDAB4, 0x06B4}, - {0xDAB5, 0x06B5}, - {0xDAB6, 0x06B6}, - {0xDAB7, 0x06B7}, - {0xDAB8, 0x06B8}, - {0xDAB9, 0x06B9}, - {0xDABA, 0x06BA}, - {0xDABB, 0x06BB}, - {0xDABC, 0x06BC}, - {0xDABD, 0x06BD}, - {0xDABE, 0x06BE}, - {0xDABF, 0x06BF}, - {0xDB80, 0x06C0}, - {0xDB81, 0x06C1}, - {0xDB82, 0x06C2}, - {0xDB83, 0x06C3}, - {0xDB84, 0x06C4}, - {0xDB85, 0x06C5}, - {0xDB86, 0x06C6}, - {0xDB87, 0x06C7}, - {0xDB88, 0x06C8}, - {0xDB89, 0x06C9}, - {0xDB8A, 0x06CA}, - {0xDB8B, 0x06CB}, - {0xDB8C, 0x06CC}, - {0xDB8D, 0x06CD}, - {0xDB8E, 0x06CE}, - {0xDB8F, 0x06CF}, - {0xDB90, 0x06D0}, - {0xDB91, 0x06D1}, - {0xDB92, 0x06D2}, - {0xDB93, 0x06D3}, - {0xDB94, 0x06D4}, - {0xDB95, 0x06D5}, - {0xDB96, 0x06D6}, - {0xDB97, 0x06D7}, - {0xDB98, 0x06D8}, - {0xDB99, 0x06D9}, - {0xDB9A, 0x06DA}, - {0xDB9B, 0x06DB}, - {0xDB9C, 0x06DC}, - {0xDB9D, 0x06DD}, - {0xDB9E, 0x06DE}, - {0xDB9F, 0x06DF}, - {0xDBA0, 0x06E0}, - {0xDBA1, 0x06E1}, - {0xDBA2, 0x06E2}, - {0xDBA3, 0x06E3}, - {0xDBA4, 0x06E4}, - {0xDBA5, 0x06E5}, - {0xDBA6, 0x06E6}, - {0xDBA7, 0x06E7}, - {0xDBA8, 0x06E8}, - {0xDBA9, 0x06E9}, - {0xDBAA, 0x06EA}, - {0xDBAB, 0x06EB}, - {0xDBAC, 0x06EC}, - {0xDBAD, 0x06ED}, - {0xDBAE, 0x06EE}, - {0xDBAF, 0x06EF}, - {0xDBB0, 0x06F0}, - {0xDBB1, 0x06F1}, - {0xDBB2, 0x06F2}, - {0xDBB3, 0x06F3}, - {0xDBB4, 0x06F4}, - {0xDBB5, 0x06F5}, - {0xDBB6, 0x06F6}, - {0xDBB7, 0x06F7}, - {0xDBB8, 0x06F8}, - {0xDBB9, 0x06F9}, - {0xDBBA, 0x06FA}, - {0xDBBB, 0x06FB}, - {0xDBBC, 0x06FC}, - {0xDBBD, 0x06FD}, - {0xDBBE, 0x06FE}, - {0xDBBF, 0x06FF}, - {0xDC80, 0x0700}, - {0xDC81, 0x0701}, - {0xDC82, 0x0702}, - {0xDC83, 0x0703}, - {0xDC84, 0x0704}, - {0xDC85, 0x0705}, - {0xDC86, 0x0706}, - {0xDC87, 0x0707}, - {0xDC88, 0x0708}, - {0xDC89, 0x0709}, - {0xDC8A, 0x070A}, - {0xDC8B, 0x070B}, - {0xDC8C, 0x070C}, - {0xDC8D, 0x070D}, - {0xDC8E, 0x070E}, - {0xDC8F, 0x070F}, - {0xDC90, 0x0710}, - {0xDC91, 0x0711}, - {0xDC92, 0x0712}, - {0xDC93, 0x0713}, - {0xDC94, 0x0714}, - {0xDC95, 0x0715}, - {0xDC96, 0x0716}, - {0xDC97, 0x0717}, - {0xDC98, 0x0718}, - {0xDC99, 0x0719}, - {0xDC9A, 0x071A}, - {0xDC9B, 0x071B}, - {0xDC9C, 0x071C}, - {0xDC9D, 0x071D}, - {0xDC9E, 0x071E}, - {0xDC9F, 0x071F}, - {0xDCA0, 0x0720}, - {0xDCA1, 0x0721}, - {0xDCA2, 0x0722}, - {0xDCA3, 0x0723}, - {0xDCA4, 0x0724}, - {0xDCA5, 0x0725}, - {0xDCA6, 0x0726}, - {0xDCA7, 0x0727}, - {0xDCA8, 0x0728}, - {0xDCA9, 0x0729}, - {0xDCAA, 0x072A}, - {0xDCAB, 0x072B}, - {0xDCAC, 0x072C}, - {0xDCAD, 0x072D}, - {0xDCAE, 0x072E}, - {0xDCAF, 0x072F}, - {0xDCB0, 0x0730}, - {0xDCB1, 0x0731}, - {0xDCB2, 0x0732}, - {0xDCB3, 0x0733}, - {0xDCB4, 0x0734}, - {0xDCB5, 0x0735}, - {0xDCB6, 0x0736}, - {0xDCB7, 0x0737}, - {0xDCB8, 0x0738}, - {0xDCB9, 0x0739}, - {0xDCBA, 0x073A}, - {0xDCBB, 0x073B}, - {0xDCBC, 0x073C}, - {0xDCBD, 0x073D}, - {0xDCBE, 0x073E}, - {0xDCBF, 0x073F}, - {0xDD80, 0x0740}, - {0xDD81, 0x0741}, - {0xDD82, 0x0742}, - {0xDD83, 0x0743}, - {0xDD84, 0x0744}, - {0xDD85, 0x0745}, - {0xDD86, 0x0746}, - {0xDD87, 0x0747}, - {0xDD88, 0x0748}, - {0xDD89, 0x0749}, - {0xDD8A, 0x074A}, - {0xDD8B, 0x074B}, - {0xDD8C, 0x074C}, - {0xDD8D, 0x074D}, - {0xDD8E, 0x074E}, - {0xDD8F, 0x074F}, - {0xDD90, 0x0750}, - {0xDD91, 0x0751}, - {0xDD92, 0x0752}, - {0xDD93, 0x0753}, - {0xDD94, 0x0754}, - {0xDD95, 0x0755}, - {0xDD96, 0x0756}, - {0xDD97, 0x0757}, - {0xDD98, 0x0758}, - {0xDD99, 0x0759}, - {0xDD9A, 0x075A}, - {0xDD9B, 0x075B}, - {0xDD9C, 0x075C}, - {0xDD9D, 0x075D}, - {0xDD9E, 0x075E}, - {0xDD9F, 0x075F}, - {0xDDA0, 0x0760}, - {0xDDA1, 0x0761}, - {0xDDA2, 0x0762}, - {0xDDA3, 0x0763}, - {0xDDA4, 0x0764}, - {0xDDA5, 0x0765}, - {0xDDA6, 0x0766}, - {0xDDA7, 0x0767}, - {0xDDA8, 0x0768}, - {0xDDA9, 0x0769}, - {0xDDAA, 0x076A}, - {0xDDAB, 0x076B}, - {0xDDAC, 0x076C}, - {0xDDAD, 0x076D}, - {0xDDAE, 0x076E}, - {0xDDAF, 0x076F}, - {0xDDB0, 0x0770}, - {0xDDB1, 0x0771}, - {0xDDB2, 0x0772}, - {0xDDB3, 0x0773}, - {0xDDB4, 0x0774}, - {0xDDB5, 0x0775}, - {0xDDB6, 0x0776}, - {0xDDB7, 0x0777}, - {0xDDB8, 0x0778}, - {0xDDB9, 0x0779}, - {0xDDBA, 0x077A}, - {0xDDBB, 0x077B}, - {0xDDBC, 0x077C}, - {0xDDBD, 0x077D}, - {0xDDBE, 0x077E}, - {0xDDBF, 0x077F}, - {0xDE80, 0x0780}, - {0xDE81, 0x0781}, - {0xDE82, 0x0782}, - {0xDE83, 0x0783}, - {0xDE84, 0x0784}, - {0xDE85, 0x0785}, - {0xDE86, 0x0786}, - {0xDE87, 0x0787}, - {0xDE88, 0x0788}, - {0xDE89, 0x0789}, - {0xDE8A, 0x078A}, - {0xDE8B, 0x078B}, - {0xDE8C, 0x078C}, - {0xDE8D, 0x078D}, - {0xDE8E, 0x078E}, - {0xDE8F, 0x078F}, - {0xDE90, 0x0790}, - {0xDE91, 0x0791}, - {0xDE92, 0x0792}, - {0xDE93, 0x0793}, - {0xDE94, 0x0794}, - {0xDE95, 0x0795}, - {0xDE96, 0x0796}, - {0xDE97, 0x0797}, - {0xDE98, 0x0798}, - {0xDE99, 0x0799}, - {0xDE9A, 0x079A}, - {0xDE9B, 0x079B}, - {0xDE9C, 0x079C}, - {0xDE9D, 0x079D}, - {0xDE9E, 0x079E}, - {0xDE9F, 0x079F}, - {0xDEA0, 0x07A0}, - {0xDEA1, 0x07A1}, - {0xDEA2, 0x07A2}, - {0xDEA3, 0x07A3}, - {0xDEA4, 0x07A4}, - {0xDEA5, 0x07A5}, - {0xDEA6, 0x07A6}, - {0xDEA7, 0x07A7}, - {0xDEA8, 0x07A8}, - {0xDEA9, 0x07A9}, - {0xDEAA, 0x07AA}, - {0xDEAB, 0x07AB}, - {0xDEAC, 0x07AC}, - {0xDEAD, 0x07AD}, - {0xDEAE, 0x07AE}, - {0xDEAF, 0x07AF}, - {0xDEB0, 0x07B0}, - {0xDEB1, 0x07B1}, - {0xDEB2, 0x07B2}, - {0xDEB3, 0x07B3}, - {0xDEB4, 0x07B4}, - {0xDEB5, 0x07B5}, - {0xDEB6, 0x07B6}, - {0xDEB7, 0x07B7}, - {0xDEB8, 0x07B8}, - {0xDEB9, 0x07B9}, - {0xDEBA, 0x07BA}, - {0xDEBB, 0x07BB}, - {0xDEBC, 0x07BC}, - {0xDEBD, 0x07BD}, - {0xDEBE, 0x07BE}, - {0xDEBF, 0x07BF}, - {0xDF80, 0x07C0}, - {0xDF81, 0x07C1}, - {0xDF82, 0x07C2}, - {0xDF83, 0x07C3}, - {0xDF84, 0x07C4}, - {0xDF85, 0x07C5}, - {0xDF86, 0x07C6}, - {0xDF87, 0x07C7}, - {0xDF88, 0x07C8}, - {0xDF89, 0x07C9}, - {0xDF8A, 0x07CA}, - {0xDF8B, 0x07CB}, - {0xDF8C, 0x07CC}, - {0xDF8D, 0x07CD}, - {0xDF8E, 0x07CE}, - {0xDF8F, 0x07CF}, - {0xDF90, 0x07D0}, - {0xDF91, 0x07D1}, - {0xDF92, 0x07D2}, - {0xDF93, 0x07D3}, - {0xDF94, 0x07D4}, - {0xDF95, 0x07D5}, - {0xDF96, 0x07D6}, - {0xDF97, 0x07D7}, - {0xDF98, 0x07D8}, - {0xDF99, 0x07D9}, - {0xDF9A, 0x07DA}, - {0xDF9B, 0x07DB}, - {0xDF9C, 0x07DC}, - {0xDF9D, 0x07DD}, - {0xDF9E, 0x07DE}, - {0xDF9F, 0x07DF}, - {0xDFA0, 0x07E0}, - {0xDFA1, 0x07E1}, - {0xDFA2, 0x07E2}, - {0xDFA3, 0x07E3}, - {0xDFA4, 0x07E4}, - {0xDFA5, 0x07E5}, - {0xDFA6, 0x07E6}, - {0xDFA7, 0x07E7}, - {0xDFA8, 0x07E8}, - {0xDFA9, 0x07E9}, - {0xDFAA, 0x07EA}, - {0xDFAB, 0x07EB}, - {0xDFAC, 0x07EC}, - {0xDFAD, 0x07ED}, - {0xDFAE, 0x07EE}, - {0xDFAF, 0x07EF}, - {0xDFB0, 0x07F0}, - {0xDFB1, 0x07F1}, - {0xDFB2, 0x07F2}, - {0xDFB3, 0x07F3}, - {0xDFB4, 0x07F4}, - {0xDFB5, 0x07F5}, - {0xDFB6, 0x07F6}, - {0xDFB7, 0x07F7}, - {0xDFB8, 0x07F8}, - {0xDFB9, 0x07F9}, - {0xDFBA, 0x07FA}, - {0xDFBB, 0x07FB}, - {0xDFBC, 0x07FC}, - {0xDFBD, 0x07FD}, - {0xDFBE, 0x07FE}, - {0xDFBF, 0x07FF}, - {0xFFFF, 0xFFFF} +typedef struct _UTF8_EncoderAttr_Rec *UTF8_EncoderAttr; +typedef struct _UTF8_EncoderAttr_Rec { + HPDF_BYTE current_byte; + HPDF_BYTE end_byte; + HPDF_BYTE utf8_bytes[8]; +} UTF8_EncoderAttr_Rec; + +static const HPDF_CidRange_Rec UTF8_NOTDEF_RANGE = {0x0000, 0x001F, 1}; +static const HPDF_CidRange_Rec UTF8_SPACE_RANGE = {0x0000, 0xFFFF, 0}; +static const HPDF_CidRange_Rec UTF8_CID_RANGE[] = { + { 0x0000, 0xFFFF, 0x0 }, + { 0xFFFF, 0xFFFF, 0x0 } }; +static HPDF_ByteType +UTF8_Encoder_ByteType_Func (HPDF_Encoder encoder, + HPDF_ParseText_Rec *state); -static const HPDF_CidRange_Rec CMAP_ARRAY_UTF8[] = { - {0x20, 0x7F, 0x20}, - {0xC280, 0xC2BF, 0x0080}, - {0xC380, 0xC3BF, 0x00C0}, - {0xC480, 0xC4BF, 0x0100}, - {0xC580, 0xC5BF, 0x0140}, - {0xC680, 0xC6BF, 0x0180}, - {0xC780, 0xC7BF, 0x01C0}, - {0xC880, 0xC8BF, 0x0200}, - {0xC980, 0xC9BF, 0x0240}, - {0xCA80, 0xCABF, 0x0280}, - {0xCB80, 0xCBBF, 0x02C0}, - {0xCC80, 0xCCBF, 0x0300}, - {0xCD80, 0xCDBF, 0x0340}, - {0xCE80, 0xCEBF, 0x0380}, - {0xCF80, 0xCFBF, 0x03C0}, - {0xD080, 0xD0BF, 0x0400}, - {0xD180, 0xD1BF, 0x0440}, - {0xD280, 0xD2BF, 0x0480}, - {0xD380, 0xD3BF, 0x04C0}, - {0xD480, 0xD4BF, 0x0500}, - {0xD580, 0xD5BF, 0x0540}, - {0xD680, 0xD6BF, 0x0580}, - {0xD780, 0xD7BF, 0x05C0}, - {0xD880, 0xD8BF, 0x0600}, - {0xD980, 0xD9BF, 0x0640}, - {0xDA80, 0xDABF, 0x0680}, - {0xDB80, 0xDBBF, 0x06C0}, - {0xDC80, 0xDCBF, 0x0700}, - {0xDD80, 0xDDBF, 0x0740}, - {0xDE80, 0xDEBF, 0x0780}, - {0xDF80, 0xDFBF, 0x07C0}, - {0xFFFF, 0xFFFF, 0} -}; - - -static const HPDF_CidRange_Rec UTF8_NOTDEF_RANGE = {0x00, 0x1F, 1}; - - -static HPDF_BOOL -UTF8_IsLeadByte (HPDF_Encoder encoder, - HPDF_BYTE b); - - -static HPDF_BOOL -UTF8_IsTrialByte (HPDF_Encoder encoder, - HPDF_BYTE b); - - -static HPDF_STATUS -UTF8_AddCodeSpaceRange (HPDF_Encoder encoder); +static HPDF_UNICODE +UTF8_Encoder_ToUnicode_Func (HPDF_Encoder encoder, + HPDF_UINT16 code); +static char * +UTF8_Encoder_EncodeText_Func (HPDF_Encoder encoder, + const char *text, + HPDF_UINT len, + HPDF_UINT *length); static HPDF_STATUS UTF8_Init (HPDF_Encoder encoder); - -static HPDF_STATUS -UTF8_Init (HPDF_Encoder encoder); - - /*--------------------------------------------------------------------------*/ -static HPDF_BOOL -UTF8_IsLeadByte (HPDF_Encoder encoder, - HPDF_BYTE b) + +/* + * This function is taken from hpdf_encoder_utf8.c, originally submitted + * to libharu by 'Mirco' + */ +static HPDF_ByteType +UTF8_Encoder_ByteType_Func (HPDF_Encoder encoder, + HPDF_ParseText_Rec *state) { - return ((b >= 0xC2 && b <= 0xDF)); + // This function is supposed to increment state->index + // Not logical ! (look at function HPDF_String_Write in hpdf_string.c) + + // When HPDF_BYTE_TYPE_SINGLE is returned, the current byte is the + // CODE argument in call ToUnicode_Func + // When HPDF_BYTE_TYPE_LEAD is returned, the current byte (msb) and the + // next byte (lsb) is the CODE arguement in call ToUnicodeFunc + // When HPDF_BYTE_TYPE_TRIAL is returned, the current byte is ignored + + HPDF_CMapEncoderAttr encoder_attr; + HPDF_BYTE byte; + UTF8_EncoderAttr utf8_attr; + + encoder_attr = (HPDF_CMapEncoderAttr) encoder->attr; + utf8_attr = (UTF8_EncoderAttr) ((void *)encoder_attr->cid_map[0]); + + if (state->index == 0) { + //First byte, initialize. + HPDF_PTRACE ((" UTF8_Encoder_ByteType_Func - Initialize: (%u) %s\n", + state->len, state->text)); + + utf8_attr->current_byte = 0; + } + + byte = state->text[state->index]; + state->index++; + + HPDF_PTRACE ((" UTF8_Encoder_ByteType_Func - Byte: %hx\n", byte)); + + if (utf8_attr->current_byte == 0) { + utf8_attr->utf8_bytes[0] = byte; + utf8_attr->current_byte = 1; + + if (!(byte & 0x80)) { + utf8_attr->current_byte = 0; + utf8_attr->end_byte = 0; + return HPDF_BYTE_TYPE_SINGLE; + } + + if ((byte & 0xf8) == 0xf0) + utf8_attr->end_byte = 3; + else if ((byte & 0xf0) == 0xe0) + utf8_attr->end_byte = 2; + else if ((byte & 0xe0) == 0xc0) + utf8_attr->end_byte = 1; + else + utf8_attr->current_byte = 0; //ERROR, skip this byte + } else { + utf8_attr->utf8_bytes[utf8_attr->current_byte] = byte; + if (utf8_attr->current_byte == utf8_attr->end_byte) { + utf8_attr->current_byte = 0; + return HPDF_BYTE_TYPE_SINGLE; + } + + utf8_attr->current_byte++; + } + + return HPDF_BYTE_TYPE_TRIAL; } - -static HPDF_BOOL -UTF8_IsTrialByte (HPDF_Encoder encoder, - HPDF_BYTE b) +/* + * This function is taken from hpdf_encoder_utf8.c, originally submitted + * to libharu by 'Mirco' + */ +static HPDF_UNICODE +UTF8_Encoder_ToUnicode_Func (HPDF_Encoder encoder, + HPDF_UINT16 code) { - return (b >= 0x80 && b <= 0xBF); + // Supposed to convert CODE to unicode. + // This function is allways called after ByteType_Func. + // ByteType_Func recognizes the utf-8 bytes belonging to one character. + + HPDF_CMapEncoderAttr encoder_attr; + UTF8_EncoderAttr utf8_attr; + unsigned int val; + + encoder_attr = (HPDF_CMapEncoderAttr) encoder->attr; + utf8_attr = (UTF8_EncoderAttr) ((void *)encoder_attr->cid_map[0]); + + switch (utf8_attr->end_byte) { + case 3: + val = (unsigned int) ((utf8_attr->utf8_bytes[0] & 0x7) << 18) + + (unsigned int) ((utf8_attr->utf8_bytes[1]) << 12) + + (unsigned int) ((utf8_attr->utf8_bytes[2] & 0x3f) << 6) + + (unsigned int) ((utf8_attr->utf8_bytes[3] & 0x3f)); + break; + case 2: + val = (unsigned int) ((utf8_attr->utf8_bytes[0] & 0xf) << 12) + + (unsigned int) ((utf8_attr->utf8_bytes[1] & 0x3f) << 6) + + (unsigned int) ((utf8_attr->utf8_bytes[2] & 0x3f)); + break; + case 1: + val = (unsigned int) ((utf8_attr->utf8_bytes[0] & 0x1f) << 6) + + (unsigned int) ((utf8_attr->utf8_bytes[1] & 0x3f)); + break; + case 0: + val = (unsigned int) utf8_attr->utf8_bytes[0]; + break; + default: + val = 32; // Unknown character + } + + if (val > 65535) //Convert everything outside UCS-2 to space + val = 32; + + return val; } - -static HPDF_STATUS -UTF8_AddCodeSpaceRange (HPDF_Encoder encoder) +static char * +UTF8_Encoder_EncodeText_Func (HPDF_Encoder encoder, + const char *text, + HPDF_UINT len, + HPDF_UINT *length) { - HPDF_CidRange_Rec code_space_range1 = {0x00, 0x7F, 0}; - HPDF_CidRange_Rec code_space_range2 = {0xC280, 0xDFBF, 0}; + char *result = malloc(len * 2); + char *c = result; + HPDF_ParseText_Rec parse_state; + HPDF_UINT i; - if (HPDF_CMapEncoder_AddCodeSpaceRange (encoder, code_space_range1) - != HPDF_OK) - return encoder->error->error_no; + HPDF_Encoder_SetParseText (encoder, &parse_state, + (const HPDF_BYTE *)text, len); - if (HPDF_CMapEncoder_AddCodeSpaceRange (encoder, code_space_range2) - != HPDF_OK) - return encoder->error->error_no; + for (i = 0; i < len; i++) { + HPDF_UNICODE tmp_unicode; + HPDF_ByteType btype = HPDF_Encoder_ByteType (encoder, &parse_state); - return HPDF_OK; + if (btype != HPDF_BYTE_TYPE_TRIAL) { + tmp_unicode = HPDF_Encoder_ToUnicode (encoder, 0); + + HPDF_UInt16Swap (&tmp_unicode); + HPDF_MemCpy ((HPDF_BYTE *)c, (const HPDF_BYTE*)&tmp_unicode, 2); + c += 2; + } + } + + *length = c - result; + + return result; } - static HPDF_STATUS UTF8_Init (HPDF_Encoder encoder) { @@ -2180,26 +213,32 @@ UTF8_Init (HPDF_Encoder encoder) if ((ret = HPDF_CMapEncoder_InitAttr (encoder)) != HPDF_OK) return ret; + /* + * We override these two + */ + encoder->byte_type_fn = UTF8_Encoder_ByteType_Func; + encoder->to_unicode_fn = UTF8_Encoder_ToUnicode_Func; + encoder->encode_text_fn = UTF8_Encoder_EncodeText_Func; + attr = (HPDF_CMapEncoderAttr)encoder->attr; - if (HPDF_CMapEncoder_AddCMap (encoder, CMAP_ARRAY_UTF8) != HPDF_OK) + if (HPDF_CMapEncoder_AddCMap (encoder, UTF8_CID_RANGE) != HPDF_OK) return encoder->error->error_no; - if ((ret = UTF8_AddCodeSpaceRange (encoder)) != HPDF_OK) - return ret; + if (HPDF_CMapEncoder_AddCodeSpaceRange (encoder, UTF8_SPACE_RANGE) + != HPDF_OK) + return encoder->error->error_no; if (HPDF_CMapEncoder_AddNotDefRange (encoder, UTF8_NOTDEF_RANGE) != HPDF_OK) return encoder->error->error_no; - HPDF_CMapEncoder_SetUnicodeArray (encoder, UTF8_UNICODE_ARRAY); - - attr->is_lead_byte_fn = UTF8_IsLeadByte; - attr->is_trial_byte_fn = UTF8_IsTrialByte; + attr->is_lead_byte_fn = NULL; + attr->is_trial_byte_fn = NULL; HPDF_StrCpy (attr->registry, "Adobe", attr->registry + HPDF_LIMIT_MAX_NAME_LEN); - HPDF_StrCpy (attr->ordering, "UTF-8", attr->ordering + + HPDF_StrCpy (attr->ordering, "Identity-H", attr->ordering + HPDF_LIMIT_MAX_NAME_LEN); attr->suppliment = 0; attr->writing_mode = HPDF_WMODE_HORIZONTAL; diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdffdfj.c b/contrib/hbhpdf/3rd/libhpdf/hpdffdfj.c old mode 100644 new mode 100755 index 57d8abddd8..1fb19eb3ec --- a/contrib/hbhpdf/3rd/libhpdf/hpdffdfj.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdffdfj.c @@ -780,7 +780,7 @@ static const HPDF_CID_Width MS_PGothic_W_ARRAY[] = { }; -static const HPDF_CID_Width MS_Mincyo_W_ARRAY[] = { +static const HPDF_CID_Width MS_Mincho_W_ARRAY[] = { {1, 500}, {2, 500}, {3, 500}, @@ -1039,7 +1039,7 @@ static const HPDF_CID_Width MS_Mincyo_W_ARRAY[] = { -static const HPDF_CID_Width MS_PMincyo_W_ARRAY[] = { +static const HPDF_CID_Width MS_PMincho_W_ARRAY[] = { {1, 304}, {2, 304}, {3, 460}, @@ -1545,7 +1545,7 @@ static const HPDF_CID_Width MS_PMincyo_W_ARRAY[] = { /*---------------------------------------------------------------------------*/ -/*----- Mincyo Font ---------------------------------------------------------*/ +/*----- Mincho Font ---------------------------------------------------------*/ static HPDF_STATUS @@ -1671,11 +1671,11 @@ MS_PGothic_BoldItalic_Init (HPDF_FontDef fontdef) static HPDF_STATUS -MS_Mincyo_Init (HPDF_FontDef fontdef) +MS_Mincho_Init (HPDF_FontDef fontdef) { HPDF_STATUS ret; - HPDF_PTRACE ((" HPDF_FontDef_MS_Mincyo_Init\n")); + HPDF_PTRACE ((" HPDF_FontDef_MS_Mincho_Init\n")); fontdef->ascent = 859; fontdef->descent = -140; @@ -1698,9 +1698,9 @@ MS_Mincyo_Init (HPDF_FontDef fontdef) static HPDF_STATUS -MS_Mincyo_Bold_Init (HPDF_FontDef fontdef) +MS_Mincho_Bold_Init (HPDF_FontDef fontdef) { - HPDF_STATUS ret = MS_Mincyo_Init (fontdef); + HPDF_STATUS ret = MS_Mincho_Init (fontdef); if (ret != HPDF_OK) return ret; @@ -1710,9 +1710,9 @@ MS_Mincyo_Bold_Init (HPDF_FontDef fontdef) static HPDF_STATUS -MS_Mincyo_Italic_Init (HPDF_FontDef fontdef) +MS_Mincho_Italic_Init (HPDF_FontDef fontdef) { - HPDF_STATUS ret = MS_Mincyo_Init (fontdef); + HPDF_STATUS ret = MS_Mincho_Init (fontdef); if (ret != HPDF_OK) return ret; @@ -1721,9 +1721,9 @@ MS_Mincyo_Italic_Init (HPDF_FontDef fontdef) } static HPDF_STATUS -MS_Mincyo_BoldItalic_Init (HPDF_FontDef fontdef) +MS_Mincho_BoldItalic_Init (HPDF_FontDef fontdef) { - HPDF_STATUS ret = MS_Mincyo_Init (fontdef); + HPDF_STATUS ret = MS_Mincho_Init (fontdef); if (ret != HPDF_OK) return ret; @@ -1733,11 +1733,11 @@ MS_Mincyo_BoldItalic_Init (HPDF_FontDef fontdef) static HPDF_STATUS -MS_PMincyo_Init (HPDF_FontDef fontdef) +MS_PMincho_Init (HPDF_FontDef fontdef) { HPDF_STATUS ret; - HPDF_PTRACE ((" HPDF_FontDef_MS_PMincyo_Init\n")); + HPDF_PTRACE ((" HPDF_FontDef_MS_PMincho_Init\n")); fontdef->ascent = 859; fontdef->descent = -140; @@ -1759,9 +1759,9 @@ MS_PMincyo_Init (HPDF_FontDef fontdef) static HPDF_STATUS -MS_PMincyo_Bold_Init (HPDF_FontDef fontdef) +MS_PMincho_Bold_Init (HPDF_FontDef fontdef) { - HPDF_STATUS ret = MS_PMincyo_Init (fontdef); + HPDF_STATUS ret = MS_PMincho_Init (fontdef); if (ret != HPDF_OK) return ret; @@ -1771,9 +1771,9 @@ MS_PMincyo_Bold_Init (HPDF_FontDef fontdef) static HPDF_STATUS -MS_PMincyo_Italic_Init (HPDF_FontDef fontdef) +MS_PMincho_Italic_Init (HPDF_FontDef fontdef) { - HPDF_STATUS ret = MS_PMincyo_Init (fontdef); + HPDF_STATUS ret = MS_PMincho_Init (fontdef); if (ret != HPDF_OK) return ret; @@ -1782,9 +1782,9 @@ MS_PMincyo_Italic_Init (HPDF_FontDef fontdef) } static HPDF_STATUS -MS_PMincyo_BoldItalic_Init (HPDF_FontDef fontdef) +MS_PMincho_BoldItalic_Init (HPDF_FontDef fontdef) { - HPDF_STATUS ret = MS_PMincyo_Init (fontdef); + HPDF_STATUS ret = MS_PMincho_Init (fontdef); if (ret != HPDF_OK) return ret; @@ -1852,52 +1852,52 @@ HPDF_UseJPFonts (HPDF_Doc pdf) if ((ret = HPDF_Doc_RegisterFontDef (pdf, fontdef)) != HPDF_OK) return ret; - /* MS-Mincyo */ - fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-Mincyo", - MS_Mincyo_Init); + /* MS-Mincho */ + fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-Mincho", + MS_Mincho_Init); if ((ret = HPDF_Doc_RegisterFontDef (pdf, fontdef)) != HPDF_OK) return ret; - fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-Mincyo,Bold", - MS_Mincyo_Bold_Init); + fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-Mincho,Bold", + MS_Mincho_Bold_Init); if ((ret = HPDF_Doc_RegisterFontDef (pdf, fontdef)) != HPDF_OK) return ret; - fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-Mincyo,Italic", - MS_Mincyo_Italic_Init); + fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-Mincho,Italic", + MS_Mincho_Italic_Init); if ((ret = HPDF_Doc_RegisterFontDef (pdf, fontdef)) != HPDF_OK) return ret; - fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-Mincyo,BoldItalic", - MS_Mincyo_BoldItalic_Init); + fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-Mincho,BoldItalic", + MS_Mincho_BoldItalic_Init); if ((ret = HPDF_Doc_RegisterFontDef (pdf, fontdef)) != HPDF_OK) return ret; - /* MS-PMincyo */ - fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-PMincyo", - MS_PMincyo_Init); + /* MS-PMincho */ + fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-PMincho", + MS_PMincho_Init); if ((ret = HPDF_Doc_RegisterFontDef (pdf, fontdef)) != HPDF_OK) return ret; - fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-PMincyo,Bold", - MS_PMincyo_Bold_Init); + fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-PMincho,Bold", + MS_PMincho_Bold_Init); if ((ret = HPDF_Doc_RegisterFontDef (pdf, fontdef)) != HPDF_OK) return ret; - fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-PMincyo,Italic", - MS_PMincyo_Italic_Init); + fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-PMincho,Italic", + MS_PMincho_Italic_Init); if ((ret = HPDF_Doc_RegisterFontDef (pdf, fontdef)) != HPDF_OK) return ret; - fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-PMincyo,BoldItalic", - MS_PMincyo_BoldItalic_Init); + fontdef = HPDF_CIDFontDef_New (pdf->mmgr, "MS-PMincho,BoldItalic", + MS_PMincho_BoldItalic_Init); if ((ret = HPDF_Doc_RegisterFontDef (pdf, fontdef)) != HPDF_OK) return ret; diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdffdft.c b/contrib/hbhpdf/3rd/libhpdf/hpdffdft.c index cae1587f95..d050149823 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdffdft.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdffdft.c @@ -1678,6 +1678,7 @@ ParseOS2 (HPDF_FontDef fontdef) HPDF_TTFontDefAttr attr = (HPDF_TTFontDefAttr)fontdef->attr; HPDF_TTFTable *tbl = FindTable (fontdef, "OS/2"); HPDF_STATUS ret; + HPDF_UINT16 version; HPDF_UINT len; HPDF_PTRACE ((" ParseOS2\n")); @@ -1685,11 +1686,19 @@ ParseOS2 (HPDF_FontDef fontdef) if (!tbl) return HPDF_SetError (fontdef->error, HPDF_TTF_MISSING_TABLE, 0); + /* get the number version. */ + ret = HPDF_Stream_Seek (attr->stream, tbl->offset, HPDF_SEEK_SET); + if (ret != HPDF_OK) + return ret; + + if ((ret = GetUINT16 (attr->stream, &version)) != HPDF_OK) + return ret; + + /* check whether the font is allowed to be embedded. */ ret = HPDF_Stream_Seek (attr->stream, tbl->offset + 8, HPDF_SEEK_SET); if (ret != HPDF_OK) return ret; - /* check whether the font is allowed to be embedded. */ if ((ret = GetUINT16 (attr->stream, &attr->fs_type)) != HPDF_OK) return ret; @@ -1697,32 +1706,59 @@ ParseOS2 (HPDF_FontDef fontdef) return HPDF_SetError (fontdef->error, HPDF_TTF_CANNOT_EMBEDDING_FONT, 0); - if ((ret = HPDF_Stream_Seek (attr->stream, tbl->offset + 20, HPDF_SEEK_SET)) + /* get fields sfamilyclass and panose. */ + if ((ret = HPDF_Stream_Seek (attr->stream, tbl->offset + 30, HPDF_SEEK_SET)) != HPDF_OK) return ret; - len = 12; + len = 2; + if ((ret = HPDF_Stream_Read (attr->stream, attr->sfamilyclass, &len)) != HPDF_OK) + return ret; + + len = 10; if ((ret = HPDF_Stream_Read (attr->stream, attr->panose, &len)) != HPDF_OK) return ret; - HPDF_PTRACE((" ParseOS2 PANOSE=%u-%u " - "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n", + HPDF_PTRACE((" ParseOS2 sFamilyClass=%d-%d " + "Panose=%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X\n", + attr->sfamilyclass[0], attr->sfamilyclass[1], attr->panose[0], attr->panose[1], attr->panose[2], attr->panose[3], attr->panose[4], attr->panose[5], attr->panose[6], attr->panose[7], - attr->panose[8], attr->panose[9], attr->panose[10], attr->panose[11])); + attr->panose[8], attr->panose[9])); - if (attr->panose[0] == 1 || attr->panose[0] == 4) + /* Class ID = 1 Oldstyle Serifs + Class ID = 2 Transitional Serifs + Class ID = 3 Modern Serifs + Class ID = 4 Clarendon Serifs + Class ID = 5 Slab Serifs + Class ID = 6 (reserved for future use) + Class ID = 7 Freeform Serifs + Class ID = 8 Sans Serif + Class ID = 9 Ornamentals + Class ID = 10 Scripts + Class ID = 11 (reserved for future use) + Class ID = 12 Symbolic */ + if ((attr->sfamilyclass[0] > 0 && attr->sfamilyclass[0] < 6) + || (attr->sfamilyclass[0] == 7)) fontdef->flags = fontdef->flags | HPDF_FONT_SERIF; - /* get ulCodePageRange1 */ - if ((ret = HPDF_Stream_Seek (attr->stream, 78, HPDF_SEEK_CUR)) != HPDF_OK) - return ret; + if (attr->sfamilyclass[0] == 10) + fontdef->flags = fontdef->flags | HPDF_FONT_SCRIPT; - if ((ret = GetUINT32 (attr->stream, &attr->code_page_range1)) != HPDF_OK) - return ret; + if (attr->sfamilyclass[0] == 12) + fontdef->flags = fontdef->flags | HPDF_FONT_SYMBOLIC; - if ((ret = GetUINT32 (attr->stream, &attr->code_page_range2)) != HPDF_OK) - return ret; + /* get fields ulCodePageRange1 and ulCodePageRange2 */ + if(version > 0) { + if ((ret = HPDF_Stream_Seek (attr->stream, 36, HPDF_SEEK_CUR)) != HPDF_OK) + return ret; + + if ((ret = GetUINT32 (attr->stream, &attr->code_page_range1)) != HPDF_OK) + return ret; + + if ((ret = GetUINT32 (attr->stream, &attr->code_page_range2)) != HPDF_OK) + return ret; + } HPDF_PTRACE((" ParseOS2 CodePageRange1=%08X CodePageRange2=%08X\n", (HPDF_UINT)attr->code_page_range1, @@ -1959,6 +1995,9 @@ HPDF_TTFontDef_SaveFontData (HPDF_FontDef fontdef, HPDF_STATUS ret; HPDF_UINT32 offset_base; HPDF_UINT32 tmp_check_sum = 0xB1B0AFBA; + HPDF_TTFTable emptyTable; + emptyTable.length = 0; + emptyTable.offset = 0; HPDF_PTRACE ((" SaveFontData\n")); @@ -1991,6 +2030,12 @@ HPDF_TTFontDef_SaveFontData (HPDF_FontDef fontdef, HPDF_UINT32 *poffset; HPDF_UINT32 value; + if (!tbl) { + tbl = &emptyTable; + HPDF_MemCpy((HPDF_BYTE *)tbl->tag, + (const HPDF_BYTE *)REQUIRED_TAGS[i], 4); + } + if (!tbl) { ret = HPDF_SetError (fontdef->error, HPDF_TTF_MISSING_TABLE, i); goto Exit; @@ -2228,4 +2273,3 @@ INT16Swap (HPDF_INT16 *value) HPDF_MemCpy (b, (HPDF_BYTE *)value, 2); *value = (HPDF_INT16)((HPDF_INT16)b[0] << 8 | (HPDF_INT16)b[1]); } - diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdffonc.c b/contrib/hbhpdf/3rd/libhpdf/hpdffonc.c index cb2e4aacdc..382d373f2e 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdffonc.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdffonc.c @@ -48,10 +48,16 @@ MeasureText (HPDF_Font font, static char* -UINT16ToHex (char *s, - HPDF_UINT16 val, - char *eptr); +UINT16ToHex (char *s, + HPDF_UINT16 val, + char *eptr, + HPDF_BYTE width); +static char * +CidRangeToHex (char *s, + HPDF_UINT16 from, + HPDF_UINT16 to, + char *eptr); static HPDF_Dict CreateCMap (HPDF_Encoder encoder, @@ -132,12 +138,31 @@ HPDF_Type0Font_New (HPDF_MMgr mmgr, if (fontdef->type == HPDF_FONTDEF_TYPE_CID) { ret += HPDF_Dict_AddName (font, "Encoding", encoder->name); } else { - attr->cmap_stream = CreateCMap (encoder, xref); + /* + * Handle the Unicode encoding, see hpdf_encoding_utf.c For some + * reason, xpdf-based readers cannot deal with our cmap but work + * fine when using the predefined "Identity-H" + * encoding. However, text selection does not work, unless we + * add a ToUnicode cmap. This CMap should also be "Identity", + * but that does not work -- specifying our cmap as a stream however + * does work. Who can understand that ? + */ + if (HPDF_StrCmp(encoder_attr->ordering, "Identity-H") == 0) { + ret += HPDF_Dict_AddName (font, "Encoding", "Identity-H"); + attr->cmap_stream = CreateCMap (encoder, xref); - if (attr->cmap_stream) { - ret += HPDF_Dict_Add (font, "Encoding", attr->cmap_stream); - } else - return NULL; + if (attr->cmap_stream) { + ret += HPDF_Dict_Add (font, "ToUnicode", attr->cmap_stream); + } else + return NULL; + } else { + attr->cmap_stream = CreateCMap (encoder, xref); + + if (attr->cmap_stream) { + ret += HPDF_Dict_Add (font, "Encoding", attr->cmap_stream); + } else + return NULL; + } } if (ret != HPDF_OK) @@ -372,15 +397,25 @@ CIDFontType2_New (HPDF_Font parent, HPDF_Xref xref) HPDF_UINT j; for (j = 0; j < 256; j++) { - HPDF_UINT16 cid = encoder_attr->cid_map[i][j]; - if (cid != 0) { - HPDF_UNICODE unicode = encoder_attr->unicode_map[i][j]; - HPDF_UINT16 gid = HPDF_TTFontDef_GetGlyphid (fontdef, unicode); - tmp_map[cid] = gid; - if (max < cid) - max = cid; - } - } + if (encoder->to_unicode_fn == HPDF_CMapEncoder_ToUnicode) { + HPDF_UINT16 cid = encoder_attr->cid_map[i][j]; + if (cid != 0) { + HPDF_UNICODE unicode = encoder_attr->unicode_map[i][j]; + HPDF_UINT16 gid = HPDF_TTFontDef_GetGlyphid (fontdef, + unicode); + tmp_map[cid] = gid; + if (max < cid) + max = cid; + } + } else { + HPDF_UNICODE unicode = (i << 8) | j; + HPDF_UINT16 gid = HPDF_TTFontDef_GetGlyphid (fontdef, + unicode); + tmp_map[unicode] = gid; + if (max < unicode) + max = unicode; + } + } } if (max > 0) { @@ -575,7 +610,7 @@ TextWidth (HPDF_Font font, HPDF_Encoder_SetParseText (encoder, &parse_state, text, len); while (i < len) { - HPDF_ByteType btype = HPDF_CMapEncoder_ByteType (encoder, &parse_state); + HPDF_ByteType btype = (encoder->byte_type_fn)(encoder, &parse_state); HPDF_UINT16 cid; HPDF_UNICODE unicode; HPDF_UINT16 code; @@ -597,7 +632,7 @@ TextWidth (HPDF_Font font, w = HPDF_CIDFontDef_GetCIDWidth (attr->fontdef, cid); } else { /* unicode-based font */ - unicode = HPDF_CMapEncoder_ToUnicode (encoder, code); + unicode = (encoder->to_unicode_fn)(encoder, code); w = HPDF_TTFontDef_GetCharWidth (attr->fontdef, unicode); } } else { @@ -713,7 +748,7 @@ MeasureText (HPDF_Font font, tmp_w = HPDF_CIDFontDef_GetCIDWidth (attr->fontdef, cid); } else { /* unicode-based font */ - unicode = HPDF_CMapEncoder_ToUnicode (encoder, code); + unicode = (encoder->to_unicode_fn)(encoder, code); tmp_w = HPDF_TTFontDef_GetCharWidth (attr->fontdef, unicode); } @@ -745,10 +780,12 @@ MeasureText (HPDF_Font font, } + static char* -UINT16ToHex (char *s, - HPDF_UINT16 val, - char *eptr) +UINT16ToHex (char *s, + HPDF_UINT16 val, + char *eptr, + HPDF_BYTE width) { HPDF_BYTE b[2]; HPDF_UINT16 val2; @@ -765,8 +802,15 @@ UINT16ToHex (char *s, *s++ = '<'; - if (b[0] != 0) { - c = (char)(b[0] >> 4); + /* + * In principle a range of <00> - <1F> can now not be + * distinguished from <0000> - <001F>..., this seems something + * that is wrong with CID ranges. For the UCS-2 encoding we need + * to add <0000> - and this cannot be <00> - (or at + * least, that crashes Mac OSX Preview). + */ + if (width == 2) { + c = b[0] >> 4; if (c <= 9) c += 0x30; else @@ -801,6 +845,21 @@ UINT16ToHex (char *s, return s; } +static char* +CidRangeToHex (char *s, + HPDF_UINT16 from, + HPDF_UINT16 to, + char *eptr) +{ + HPDF_BYTE width = (to > 255) ? 2 : 1; + char *pbuf; + + pbuf = UINT16ToHex (s, from, eptr, width); + *pbuf++ = ' '; + pbuf = UINT16ToHex (pbuf, to, eptr, width); + + return pbuf; +} static HPDF_Dict CreateCMap (HPDF_Encoder encoder, @@ -930,9 +989,8 @@ CreateCMap (HPDF_Encoder encoder, HPDF_CidRange_Rec *range = HPDF_List_ItemAt (attr->code_space_range, i); - pbuf = UINT16ToHex (buf, range->from, eptr); - *pbuf++ = ' '; - pbuf = UINT16ToHex (pbuf, range->to, eptr); + pbuf = CidRangeToHex(buf, range->from, range->to, eptr); + HPDF_StrCpy (pbuf, "\r\n", eptr); ret += HPDF_Stream_WriteStr (cmap->stream, buf); @@ -954,9 +1012,7 @@ CreateCMap (HPDF_Encoder encoder, for (i = 0; i < attr->notdef_range->count; i++) { HPDF_CidRange_Rec *range = HPDF_List_ItemAt (attr->notdef_range, i); - pbuf = UINT16ToHex (buf, range->from, eptr); - *pbuf++ = ' '; - pbuf = UINT16ToHex (pbuf, range->to, eptr); + pbuf = CidRangeToHex(buf, range->from, range->to, eptr); *pbuf++ = ' '; pbuf = HPDF_IToA (pbuf, range->cid, eptr); HPDF_StrCpy (pbuf, "\r\n", eptr); @@ -985,9 +1041,7 @@ CreateCMap (HPDF_Encoder encoder, for (i = 0; i < attr->cmap_range->count; i++) { HPDF_CidRange_Rec *range = HPDF_List_ItemAt (attr->cmap_range, i); - pbuf = UINT16ToHex (buf, range->from, eptr); - *pbuf++ = ' '; - pbuf = UINT16ToHex (pbuf, range->to, eptr); + pbuf = CidRangeToHex(buf, range->from, range->to, eptr); *pbuf++ = ' '; pbuf = HPDF_IToA (pbuf, range->cid, eptr); HPDF_StrCpy (pbuf, "\r\n", eptr); diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdffond.h b/contrib/hbhpdf/3rd/libhpdf/hpdffond.h index 8fce8b5716..9e73c97344 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdffond.h +++ b/contrib/hbhpdf/3rd/libhpdf/hpdffond.h @@ -303,7 +303,8 @@ typedef struct _HPDF_TTFontDefAttr_Rec { HPDF_TTF_OffsetTbl offset_tbl; HPDF_TTF_CmapRange cmap; HPDF_UINT16 fs_type; - HPDF_BYTE panose[12]; + HPDF_BYTE sfamilyclass[2]; + HPDF_BYTE panose[10]; HPDF_UINT32 code_page_range1; HPDF_UINT32 code_page_range2; @@ -403,4 +404,3 @@ HPDF_CIDFontDef_ChangeStyle (HPDF_FontDef fontdef, #endif /* __cplusplus */ #endif /* _HPDF_FONTDEF_H */ - diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdffott.c b/contrib/hbhpdf/3rd/libhpdf/hpdffott.c index f039592e73..97d0dee1f6 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdffott.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdffott.c @@ -180,6 +180,7 @@ CreateDescriptor (HPDF_Font font) ret += HPDF_Dict_AddName (descriptor, "Type", "FontDescriptor"); ret += HPDF_Dict_AddNumber (descriptor, "Ascent", def->ascent); ret += HPDF_Dict_AddNumber (descriptor, "Descent", def->descent); + ret += HPDF_Dict_AddNumber (descriptor, "CapHeight", def->cap_height); ret += HPDF_Dict_AddNumber (descriptor, "Flags", def->flags); array = HPDF_Box_Array_New (font->mmgr, def->font_bbox); @@ -405,5 +406,3 @@ OnFree (HPDF_Dict obj) HPDF_FreeMem (obj->mmgr, attr); } } - - diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfgsta.c b/contrib/hbhpdf/3rd/libhpdf/hpdfgsta.c index 502cc4b221..63619ad99e 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfgsta.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfgsta.c @@ -62,6 +62,7 @@ HPDF_GState_New (HPDF_MMgr mmgr, gstate->font = current->font; gstate->font_size = current->font_size; + gstate->writing_mode = current->writing_mode; gstate->prev = current; gstate->depth = current->depth + 1; diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfimac.c b/contrib/hbhpdf/3rd/libhpdf/hpdfimac.c index 4654cc3664..55dddb4ea8 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfimac.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfimac.c @@ -175,6 +175,8 @@ HPDF_Fax3SetupState(struct _HPDF_CCITT_Data *pData, HPDF_UINT width, HPDF_Fax3CodecState* esp = EncoderState(pData); uint32 rowbytes, rowpixels, nruns; + HPDF_UNUSED (height); + rowbytes = line_width; rowpixels = width; @@ -650,6 +652,8 @@ HPDF_Stream_CcittToStream( const HPDF_BYTE *buf, int lineIncrement; struct _HPDF_CCITT_Data data; + HPDF_UNUSED (e); + if(height==0) return 1; if(top_is_first) { pBufPos = buf; @@ -750,7 +754,7 @@ HPDF_Image_Load1BitImageFromMem (HPDF_MMgr mmgr, * TRUE if image is oriented TOP-BOTTOM; * FALSE if image is oriented BOTTOM-TOP */ -HPDF_Image +HPDF_EXPORT(HPDF_Image) HPDF_Image_LoadRaw1BitImageFromMem (HPDF_Doc pdf, const HPDF_BYTE *buf, HPDF_UINT width, diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfoutl.c b/contrib/hbhpdf/3rd/libhpdf/hpdfoutl.c index 47eecd07c6..b7b8e58603 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfoutl.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfoutl.c @@ -67,7 +67,7 @@ HPDF_OutlineRoot_New (HPDF_MMgr mmgr, open_flg->header.obj_id |= HPDF_OTYPE_HIDDEN; ret += HPDF_Dict_Add (outline, "_OPENED", open_flg); - ret += HPDF_Dict_AddName (outline, "Type", "Outline"); + ret += HPDF_Dict_AddName (outline, "Type", "Outlines"); if (ret != HPDF_OK) return NULL; @@ -117,7 +117,7 @@ HPDF_Outline_New (HPDF_MMgr mmgr, open_flg->header.obj_id |= HPDF_OTYPE_HIDDEN; ret += HPDF_Dict_Add (outline, "_OPENED", open_flg); - ret += HPDF_Dict_AddName (outline, "Type", "Outline"); + ret += HPDF_Dict_AddName (outline, "Type", "Outlines"); ret += AddChild (parent, outline); if (ret != HPDF_OK) @@ -328,5 +328,3 @@ HPDF_Outline_SetOpened (HPDF_Outline outline, return HPDF_OK; } - - diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfpago.c b/contrib/hbhpdf/3rd/libhpdf/hpdfpago.c index 069dfed18e..2da6883502 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfpago.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfpago.c @@ -1155,7 +1155,7 @@ HPDF_Page_SetFontAndSize (HPDF_Page page, return HPDF_RaiseError (page->error, HPDF_PAGE_INVALID_FONT, 0); if (size <= 0 || size > HPDF_MAX_FONTSIZE) - return HPDF_RaiseError (page->error, HPDF_PAGE_INVALID_FONT_SIZE, 0); + return HPDF_RaiseError (page->error, HPDF_PAGE_INVALID_FONT_SIZE, size); if (page->mmgr != font->mmgr) return HPDF_RaiseError (page->error, HPDF_PAGE_INVALID_FONT, 0); @@ -2183,7 +2183,7 @@ HPDF_Page_Arc (HPDF_Page page, HPDF_PTRACE ((" HPDF_Page_Arc\n")); - if (ang1 >= ang2 || (ang2 - ang1) >= 360) + if (fabs(ang2 - ang1) >= 360) HPDF_RaiseError (page->error, HPDF_PAGE_OUT_OF_RANGE, 0); if (ret != HPDF_OK) @@ -2196,10 +2196,10 @@ HPDF_Page_Arc (HPDF_Page page, for (;;) { - if (ang2 - ang1 <= 90) + if (fabs(ang2 - ang1) <= 90) return InternalArc (page, x, y, ray, ang1, ang2, cont_flg); else { - HPDF_REAL tmp_ang = ang1 + 90; + HPDF_REAL tmp_ang = (ang2 > ang1 ? ang1 + 90 : ang1 - 90); if ((ret = InternalArc (page, x, y, ray, ang1, tmp_ang, cont_flg)) != HPDF_OK) @@ -2208,7 +2208,7 @@ HPDF_Page_Arc (HPDF_Page page, ang1 = tmp_ang; } - if (ang1 >= ang2) + if (fabs(ang1 - ang2) < 0.1) break; cont_flg = HPDF_TRUE; @@ -2271,7 +2271,11 @@ InternalArc (HPDF_Page page, pbuf = HPDF_FToA (pbuf, (HPDF_REAL)x0, eptr); *pbuf++ = ' '; pbuf = HPDF_FToA (pbuf, (HPDF_REAL)y0, eptr); - pbuf = (char *)HPDF_StrCpy (pbuf, " m\012", eptr); + + if (attr->gmode == HPDF_GMODE_PATH_OBJECT) + pbuf = (char *)HPDF_StrCpy (pbuf, " l\012", eptr); + else + pbuf = (char *)HPDF_StrCpy (pbuf, " m\012", eptr); } pbuf = HPDF_FToA (pbuf, (HPDF_REAL)x1, eptr); @@ -2333,13 +2337,34 @@ InternalWriteText (HPDF_PageAttr attr, if (font_attr->type == HPDF_FONT_TYPE0_TT || font_attr->type == HPDF_FONT_TYPE0_CID) { + HPDF_Encoder encoder; + HPDF_UINT len; + if ((ret = HPDF_Stream_WriteStr (attr->stream, "<")) != HPDF_OK) return ret; - if ((ret = HPDF_Stream_WriteBinary (attr->stream, (HPDF_BYTE *)text, - HPDF_StrLen (text, HPDF_LIMIT_MAX_STRING_LEN), NULL)) - != HPDF_OK) - return ret; + encoder = font_attr->encoder; + len = HPDF_StrLen (text, HPDF_LIMIT_MAX_STRING_LEN); + + if (encoder->encode_text_fn == NULL) { + if ((ret = HPDF_Stream_WriteBinary (attr->stream, (HPDF_BYTE *)text, + len, NULL)) + != HPDF_OK) + return ret; + } else { + char *encoded; + HPDF_UINT length; + + encoded = (encoder->encode_text_fn)(encoder, text, len, &length); + + ret = HPDF_Stream_WriteBinary (attr->stream, (HPDF_BYTE *)encoded, + length, NULL); + + free(encoded); + + if (ret != HPDF_OK) + return ret; + } return HPDF_Stream_WriteStr (attr->stream, ">"); } @@ -2598,12 +2623,28 @@ InternalShowTextNextLine (HPDF_Page page, if (font_attr->type == HPDF_FONT_TYPE0_TT || font_attr->type == HPDF_FONT_TYPE0_CID) { + HPDF_Encoder encoder = font_attr->encoder; + if ((ret = HPDF_Stream_WriteStr (attr->stream, "<")) != HPDF_OK) return ret; - if ((ret = HPDF_Stream_WriteBinary (attr->stream, (HPDF_BYTE *)text, len, NULL)) - != HPDF_OK) - return ret; + if (encoder->encode_text_fn == NULL) { + if ((ret = HPDF_Stream_WriteBinary (attr->stream, (HPDF_BYTE *)text, + len, NULL)) + != HPDF_OK) + return ret; + } else { + char *encoded; + HPDF_UINT length; + + encoded = (encoder->encode_text_fn)(encoder, text, len, &length); + ret = HPDF_Stream_WriteBinary (attr->stream, (HPDF_BYTE *)encoded, + length, NULL); + free(encoded); + + if (ret != HPDF_OK) + return ret; + } if ((ret = HPDF_Stream_WriteStr (attr->stream, ">")) != HPDF_OK) return ret; @@ -2761,3 +2802,100 @@ Fail: HPDF_Dict_Free (dict); return HPDF_Error_GetCode (page->error); } + + +/* + * This function is contributed by Finn Arildsen. + */ + +HPDF_EXPORT(HPDF_STATUS) +HPDF_Page_New_Content_Stream (HPDF_Page page, + HPDF_Dict* new_stream) +{ + /* Call this function to start a new content stream on a page. The + handle is returned to new_stream. + new_stream can later be used on other pages as a shared content stream; + insert using HPDF_Page_Insert_Shared_Content_Stream */ + + HPDF_STATUS ret = HPDF_Page_CheckState (page, HPDF_GMODE_PAGE_DESCRIPTION | + HPDF_GMODE_TEXT_OBJECT); + HPDF_PageAttr attr; + HPDF_UINT filter; + HPDF_Array contents_array; + + HPDF_PTRACE((" HPDF_Page_New_Content_Stream\n")); + + attr = (HPDF_PageAttr)page->attr; + filter = attr->contents->filter; + + /* check if there is already an array of contents */ + contents_array = (HPDF_Array) HPDF_Dict_GetItem(page,"Contents", HPDF_OCLASS_ARRAY); + if (!contents_array) { + HPDF_Error_Reset (page->error); + /* no contents_array already -- create one + and replace current single contents item */ + contents_array = HPDF_Array_New(page->mmgr); + if (!contents_array) + return HPDF_Error_GetCode (page->error); + ret += HPDF_Array_Add(contents_array,attr->contents); + ret += HPDF_Dict_Add (page, "Contents", contents_array); + } + + /* create new contents stream and add it to the page's contents array */ + attr->contents = HPDF_DictStream_New (page->mmgr, attr->xref); + attr->contents->filter = filter; + attr->stream = attr->contents->stream; + + if (!attr->contents) + return HPDF_Error_GetCode (page->error); + + ret += HPDF_Array_Add (contents_array,attr->contents); + + /* return the value of the new stream, so that + the application can use it as a shared contents stream */ + if (ret == HPDF_OK && new_stream != NULL) + *new_stream = attr->contents; + + return ret; +} + + +/* + * This function is contributed by Finn Arildsen. + */ + +HPDF_EXPORT(HPDF_STATUS) +HPDF_Page_Insert_Shared_Content_Stream (HPDF_Page page, + HPDF_Dict shared_stream) +{ + /* Call this function to insert a previously (with HPDF_New_Content_Stream) created content stream + as a shared content stream on this page */ + + HPDF_STATUS ret = HPDF_Page_CheckState (page, HPDF_GMODE_PAGE_DESCRIPTION | + HPDF_GMODE_TEXT_OBJECT); + HPDF_Array contents_array; + + HPDF_PTRACE((" HPDF_Page_Insert_Shared_Content_Stream\n")); + + /* check if there is already an array of contents */ + contents_array = (HPDF_Array) HPDF_Dict_GetItem(page,"Contents", HPDF_OCLASS_ARRAY); + if (!contents_array) { + HPDF_PageAttr attr; + HPDF_Error_Reset (page->error); + /* no contents_array already -- create one + and replace current single contents item */ + contents_array = HPDF_Array_New(page->mmgr); + if (!contents_array) + return HPDF_Error_GetCode (page->error); + attr = (HPDF_PageAttr)page->attr; + ret += HPDF_Array_Add(contents_array,attr->contents); + ret += HPDF_Dict_Add (page, "Contents", contents_array); + } + + ret += HPDF_Array_Add (contents_array,shared_stream); + + /* Continue with a new stream */ + ret += HPDF_Page_New_Content_Stream (page, NULL); + + return ret; +} diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfpags.c b/contrib/hbhpdf/3rd/libhpdf/hpdfpags.c index d1fe8812cf..88a82a9e65 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfpags.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfpags.c @@ -34,7 +34,7 @@ typedef struct _HPDF_PageSizeValue { static const HPDF_PageSizeValue HPDF_PREDEFINED_PAGE_SIZES[] = { {612, 792}, /* HPDF_PAGE_SIZE_LETTER */ {612, 1008}, /* HPDF_PAGE_SIZE_LEGAL */ - {(HPDF_REAL)841.89, (HPDF_REAL)1199.551}, /* HPDF_PAGE_SIZE_A3 */ + {(HPDF_REAL)841.89, (HPDF_REAL)1190.551}, /* HPDF_PAGE_SIZE_A3 */ {(HPDF_REAL)595.276, (HPDF_REAL)841.89}, /* HPDF_PAGE_SIZE_A4 */ {(HPDF_REAL)419.528, (HPDF_REAL)595.276}, /* HPDF_PAGE_SIZE_A5 */ {(HPDF_REAL)708.661, (HPDF_REAL)1000.63}, /* HPDF_PAGE_SIZE_B4 */ diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfpdfa.c b/contrib/hbhpdf/3rd/libhpdf/hpdfpdfa.c index 4c40cccf92..8c5e3f23d8 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfpdfa.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfpdfa.c @@ -25,20 +25,33 @@ #include -#define XMP_HEADER "" -#define XMP_FOOTER "" -#define XMP_PDFA1A "" -#define XMP_PDFA1B "" -#define XMP_PRODUCER_STARTTAG "" -#define XMP_INFODATA_STARTTAG "" -#define XMP_INFODATA_ENDTAG "" -#define XMP_CREATE_DATE_STARTTAG "" -#define XMP_CREATE_DATE_ENDTAG "" -#define XMP_MOD_DATE_STARTTAG "" -#define XMP_MOD_DATE_ENDTAG "" +#define HEADER "" +#define DC_HEADER "" +#define DC_TITLE_STARTTAG "" +#define DC_TITLE_ENDTAG "" +#define DC_CREATOR_STARTTAG "" +#define DC_CREATOR_ENDTAG "" +#define DC_DESCRIPTION_STARTTAG "" +#define DC_DESCRIPTION_ENDTAG "" +#define DC_FOOTER "" +#define XMP_HEADER "" #define XMP_CREATORTOOL_STARTTAG "" -#define XMP_CREATORTOOL_ENDTAG "" +#define XMP_CREATORTOOL_ENDTAG "" +#define XMP_CREATE_DATE_STARTTAG "" +#define XMP_CREATE_DATE_ENDTAG "" +#define XMP_MOD_DATE_STARTTAG "" +#define XMP_MOD_DATE_ENDTAG "" +#define XMP_FOOTER "" +#define PDF_HEADER "" +#define PDF_KEYWORDS_STARTTAG "" +#define PDF_KEYWORDS_ENDTAG "" +#define PDF_PRODUCER_STARTTAG "" +#define PDF_PRODUCER_ENDTAG "" +#define PDF_FOOTER "" +#define PDFAID_PDFA1A "" +#define PDFAID_PDFA1B "" +#define FOOTER "" + /* * Convert date in PDF specific format: D:YYYYMMDDHHmmSS @@ -100,12 +113,21 @@ HPDF_STATUS ConvertDateToXMDate(HPDF_Stream stream, const char *pDate) pDate+=2; /* Write +... */ if(pDate[0]==0) { - ret = HPDF_Stream_Write(stream, (const HPDF_BYTE*)"+0:00", 5); + ret = HPDF_Stream_Write(stream, (const HPDF_BYTE*)"Z", 1); return ret; } if(pDate[0]=='+'||pDate[0]=='-') { - ret = HPDF_Stream_Write(stream, (const HPDF_BYTE*)pDate, strlen(pDate)); - return ret; + ret = HPDF_Stream_Write(stream, (const HPDF_BYTE*)pDate, 3); + if (ret != HPDF_OK) + return ret; + pDate+=4; + ret = HPDF_Stream_Write(stream, (const HPDF_BYTE*)":", 1); + if (ret != HPDF_OK) + return ret; + ret = HPDF_Stream_Write(stream, (const HPDF_BYTE*)pDate, 2); + if (ret != HPDF_OK) + return ret; + return ret; } return HPDF_SetError (stream->error, HPDF_INVALID_PARAMETER, 0); } @@ -117,68 +139,148 @@ HPDF_PDFA_SetPDFAConformance (HPDF_Doc pdf,HPDF_PDFAType pdfatype) { HPDF_OutputIntent xmp; HPDF_STATUS ret; + + const char *dc_title = NULL; + const char *dc_creator = NULL; + const char *dc_description = NULL; + + const char *xmp_CreatorTool = NULL; + const char *xmp_CreateDate = NULL; + const char *xmp_ModifyDate = NULL; + + const char *pdf_Keywords = NULL; + const char *pdf_Producer = NULL; + const char *info = NULL; - + if (!HPDF_HasDoc(pdf)) { return HPDF_INVALID_DOCUMENT; } - - xmp = HPDF_DictStream_New(pdf->mmgr,pdf->xref); - if (!xmp) { - return HPDF_INVALID_STREAM; - } - - HPDF_Dict_AddName(xmp,"Type","Metadata"); - HPDF_Dict_AddName(xmp,"SubType","XML"); - ret = HPDF_OK; - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_HEADER); - - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_PRODUCER_STARTTAG); - - info = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_PRODUCER); - ret += HPDF_Stream_WriteStr(xmp->stream, info); - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_PRODUCER_ENDTAG); - - /* Add CreateDate, ModifyDate, and CreatorTool */ - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_INFODATA_STARTTAG); - info = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_CREATION_DATE); - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATE_DATE_STARTTAG); - /* Convert date to XMP compatible format */ - ret += ConvertDateToXMDate(xmp->stream, info); - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATE_DATE_ENDTAG); - - info = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_MOD_DATE); - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_MOD_DATE_STARTTAG); - ret += ConvertDateToXMDate(xmp->stream, info); - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_MOD_DATE_ENDTAG); - - info = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_CREATOR); - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATORTOOL_STARTTAG); - ret += HPDF_Stream_WriteStr(xmp->stream, info); - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATORTOOL_ENDTAG); - - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_INFODATA_ENDTAG); - - switch(pdfatype) { - case HPDF_PDFA_1A: - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_PDFA1A); - break; - case HPDF_PDFA_1B: - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_PDFA1B); - break; - } - ret += HPDF_Stream_WriteStr(xmp->stream, XMP_FOOTER); + dc_title = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_TITLE); + dc_creator = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_AUTHOR); + dc_description = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_SUBJECT); - if (ret != HPDF_OK) { - return HPDF_INVALID_STREAM; + xmp_CreateDate = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_CREATION_DATE); + xmp_ModifyDate = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_MOD_DATE); + xmp_CreatorTool = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_CREATOR); + + pdf_Keywords = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_KEYWORDS); + pdf_Producer = (const char *)HPDF_GetInfoAttr(pdf, HPDF_INFO_PRODUCER); + + if((dc_title != NULL) || (dc_creator != NULL) || (dc_description != NULL) + || (xmp_CreateDate != NULL) || (xmp_ModifyDate != NULL) || (xmp_CreatorTool != NULL) + || (pdf_Keywords != NULL)) { + + xmp = HPDF_DictStream_New(pdf->mmgr,pdf->xref); + if (!xmp) { + return HPDF_INVALID_STREAM; + } + + /* Update the PDF number version */ + pdf->pdf_version = HPDF_VER_14; + + HPDF_Dict_AddName(xmp,"Type","Metadata"); + HPDF_Dict_AddName(xmp,"SubType","XML"); + + ret = HPDF_OK; + ret += HPDF_Stream_WriteStr(xmp->stream, HEADER); + + /* Add the dc block */ + if((dc_title != NULL) || (dc_creator != NULL) || (dc_description != NULL)) { + ret += HPDF_Stream_WriteStr(xmp->stream, DC_HEADER); + + if(dc_title != NULL) { + ret += HPDF_Stream_WriteStr(xmp->stream, DC_TITLE_STARTTAG); + ret += HPDF_Stream_WriteStr(xmp->stream, dc_title); + ret += HPDF_Stream_WriteStr(xmp->stream, DC_TITLE_ENDTAG); + } + + if(dc_creator != NULL) { + ret += HPDF_Stream_WriteStr(xmp->stream, DC_CREATOR_STARTTAG); + ret += HPDF_Stream_WriteStr(xmp->stream, dc_creator); + ret += HPDF_Stream_WriteStr(xmp->stream, DC_CREATOR_ENDTAG); + } + + if(dc_description != NULL) { + ret += HPDF_Stream_WriteStr(xmp->stream, DC_DESCRIPTION_STARTTAG); + ret += HPDF_Stream_WriteStr(xmp->stream, dc_description); + ret += HPDF_Stream_WriteStr(xmp->stream, DC_DESCRIPTION_ENDTAG); + } + + ret += HPDF_Stream_WriteStr(xmp->stream, DC_FOOTER); + } + + /* Add the xmp block */ + if((xmp_CreateDate != NULL) || (xmp_ModifyDate != NULL) || (xmp_CreatorTool != NULL)) { + ret += HPDF_Stream_WriteStr(xmp->stream, XMP_HEADER); + + /* Add CreateDate, ModifyDate, and CreatorTool */ + if(xmp_CreatorTool != NULL) { + ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATORTOOL_STARTTAG); + ret += HPDF_Stream_WriteStr(xmp->stream, xmp_CreatorTool); + ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATORTOOL_ENDTAG); + } + + if(xmp_CreateDate != NULL) { + ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATE_DATE_STARTTAG); + /* Convert date to XMP compatible format */ + ret += ConvertDateToXMDate(xmp->stream, xmp_CreateDate); + ret += HPDF_Stream_WriteStr(xmp->stream, XMP_CREATE_DATE_ENDTAG); + } + + if(xmp_ModifyDate != NULL) { + ret += HPDF_Stream_WriteStr(xmp->stream, XMP_MOD_DATE_STARTTAG); + ret += ConvertDateToXMDate(xmp->stream, xmp_ModifyDate); + ret += HPDF_Stream_WriteStr(xmp->stream, XMP_MOD_DATE_ENDTAG); + } + + ret += HPDF_Stream_WriteStr(xmp->stream, XMP_FOOTER); + } + + /* Add the pdf block */ + if((pdf_Keywords != NULL) || (pdf_Producer != NULL)) { + ret += HPDF_Stream_WriteStr(xmp->stream, PDF_HEADER); + + if(pdf_Keywords != NULL) { + ret += HPDF_Stream_WriteStr(xmp->stream, PDF_KEYWORDS_STARTTAG); + ret += HPDF_Stream_WriteStr(xmp->stream, pdf_Keywords); + ret += HPDF_Stream_WriteStr(xmp->stream, PDF_KEYWORDS_ENDTAG); + } + + if(pdf_Producer != NULL) { + ret += HPDF_Stream_WriteStr(xmp->stream, PDF_PRODUCER_STARTTAG); + ret += HPDF_Stream_WriteStr(xmp->stream, pdf_Producer); + ret += HPDF_Stream_WriteStr(xmp->stream, PDF_PRODUCER_ENDTAG); + } + + ret += HPDF_Stream_WriteStr(xmp->stream, PDF_FOOTER); + } + + /* Add the pdfaid block */ + switch(pdfatype) { + case HPDF_PDFA_1A: + ret += HPDF_Stream_WriteStr(xmp->stream, PDFAID_PDFA1A); + break; + case HPDF_PDFA_1B: + ret += HPDF_Stream_WriteStr(xmp->stream, PDFAID_PDFA1B); + break; + } + + ret += HPDF_Stream_WriteStr(xmp->stream, FOOTER); + + if (ret != HPDF_OK) { + return HPDF_INVALID_STREAM; + } + + if ((ret = HPDF_Dict_Add(pdf->catalog, "Metadata", xmp)) != HPDF_OK) { + return ret; + } + + return HPDF_PDFA_GenerateID(pdf); } - - if ((ret = HPDF_Dict_Add(pdf->catalog, "Metadata", xmp)) != HPDF_OK) { - return ret; - } - - return HPDF_PDFA_GenerateID(pdf); + + return HPDF_OK; } /* Generate an ID for the trailer dict, PDF/A needs this. diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfu3d.c b/contrib/hbhpdf/3rd/libhpdf/hpdfu3d.c index 78825d5ed5..d1bd4d9519 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfu3d.c +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfu3d.c @@ -132,6 +132,48 @@ HPDF_LoadU3DFromFile (HPDF_Doc pdf, return image; } +HPDF_EXPORT(HPDF_Image) +HPDF_LoadU3DFromMem (HPDF_Doc pdf, + const HPDF_BYTE *buffer, + HPDF_UINT size) +{ + HPDF_Stream imagedata; + HPDF_Image image; + + HPDF_PTRACE ((" HPDF_LoadU3DFromMem\n")); + + if (!HPDF_HasDoc (pdf)) { + return NULL; + } + + /* create file stream */ + imagedata = HPDF_MemStream_New (pdf->mmgr, size); + + if (!HPDF_Stream_Validate (imagedata)) { + HPDF_RaiseError (&pdf->error, HPDF_INVALID_STREAM, 0); + return NULL; + } + + if (HPDF_Stream_Write (imagedata, buffer, size) != HPDF_OK) { + HPDF_Stream_Free (imagedata); + return NULL; + } + + if (HPDF_Stream_Validate (imagedata)) { + image = HPDF_U3D_LoadU3D (pdf->mmgr, imagedata, pdf->xref); + } else { + image = NULL; + } + + /* destroy file stream */ + HPDF_Stream_Free (imagedata); + + if (!image) { + HPDF_CheckError (&pdf->error); + } + return image; +} + HPDF_U3D HPDF_U3D_LoadU3D (HPDF_MMgr mmgr, HPDF_Stream u3d_data, diff --git a/contrib/hbhpdf/3rd/libhpdf/hpdfu3d.h b/contrib/hbhpdf/3rd/libhpdf/hpdfu3d.h index 4ea495ba6a..2f1e3dbc48 100644 --- a/contrib/hbhpdf/3rd/libhpdf/hpdfu3d.h +++ b/contrib/hbhpdf/3rd/libhpdf/hpdfu3d.h @@ -28,6 +28,7 @@ HPDF_EXPORT(HPDF_JavaScript) HPDF_CreateJavaScript(HPDF_Doc pdf, const char *cod HPDF_EXPORT(HPDF_U3D) HPDF_LoadU3DFromFile (HPDF_Doc pdf, const char *filename); +HPDF_EXPORT(HPDF_Image) HPDF_LoadU3DFromMem (HPDF_Doc pdf, const HPDF_BYTE *buffer, HPDF_UINT size); HPDF_EXPORT(HPDF_Dict) HPDF_Create3DView (HPDF_MMgr mmgr, const char *name); HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_Add3DView(HPDF_U3D u3d, HPDF_Dict view); HPDF_EXPORT(HPDF_STATUS) HPDF_U3D_SetDefault3DView(HPDF_U3D u3d, const char *name); diff --git a/contrib/hbhpdf/3rd/libhpdf/libhpdf.dif b/contrib/hbhpdf/3rd/libhpdf/libhpdf.dif index 13eae75ad8..a980efa24b 100644 --- a/contrib/hbhpdf/3rd/libhpdf/libhpdf.dif +++ b/contrib/hbhpdf/3rd/libhpdf/libhpdf.dif @@ -1,6 +1,6 @@ diff -urN libhpdf.orig/hpdf.h libhpdf/hpdf.h ---- libhpdf.orig/hpdf.h 2013-06-12 13:30:26.932035572 +0200 -+++ libhpdf/hpdf.h 2013-06-12 13:30:26.932035572 +0200 +--- libhpdf.orig/hpdf.h 2014-02-03 17:57:08.252031640 +0100 ++++ libhpdf/hpdf.h 2014-02-03 17:57:08.252031640 +0100 @@ -17,7 +17,7 @@ #ifndef _HPDF_H #define _HPDF_H @@ -20,8 +20,8 @@ diff -urN libhpdf.orig/hpdf.h libhpdf/hpdf.h HPDF_Rect rect, const char *text, diff -urN libhpdf.orig/hpdfimac.c libhpdf/hpdfimac.c ---- libhpdf.orig/hpdfimac.c 2013-06-12 13:30:26.856035571 +0200 -+++ libhpdf/hpdfimac.c 2013-06-12 13:30:26.856035571 +0200 +--- libhpdf.orig/hpdfimac.c 2014-02-03 17:57:08.168031638 +0100 ++++ libhpdf/hpdfimac.c 2014-02-03 17:57:08.168031638 +0100 @@ -78,7 +78,7 @@ #define Fax3State(tif) (&(tif)->tif_data->b) @@ -31,20 +31,9 @@ diff -urN libhpdf.orig/hpdfimac.c libhpdf/hpdfimac.c /* NB: the uint32 casts are to silence certain ANSI-C compilers */ #define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) -diff -urN libhpdf.orig/hpdfimap.c libhpdf/hpdfimap.c ---- libhpdf.orig/hpdfimap.c 2013-06-12 13:30:26.860035571 +0200 -+++ libhpdf/hpdfimap.c 2013-06-12 13:30:26.860035571 +0200 -@@ -21,6 +21,7 @@ - - #ifndef LIBHPDF_HAVE_NOPNGLIB - #include -+#include - - static void - PngErrorFunc (png_structp png_ptr, diff -urN libhpdf.orig/hpdfutil.h libhpdf/hpdfutil.h ---- libhpdf.orig/hpdfutil.h 2013-06-12 13:30:26.968035573 +0200 -+++ libhpdf/hpdfutil.h 2013-06-12 13:30:26.968035573 +0200 +--- libhpdf.orig/hpdfutil.h 2014-02-03 17:57:08.288031641 +0100 ++++ libhpdf/hpdfutil.h 2014-02-03 17:57:08.288031641 +0100 @@ -18,7 +18,7 @@ #ifndef _HPDF_UTILS_H #define _HPDF_UTILS_H @@ -55,8 +44,8 @@ diff -urN libhpdf.orig/hpdfutil.h libhpdf/hpdfutil.h #ifdef __cplusplus diff -urN libhpdf.orig/t4.h libhpdf/t4.h ---- libhpdf.orig/t4.h 2013-06-12 13:30:26.920035572 +0200 -+++ libhpdf/t4.h 2013-06-12 13:30:26.920035572 +0200 +--- libhpdf.orig/t4.h 2014-02-03 17:57:08.244031640 +0100 ++++ libhpdf/t4.h 2014-02-03 17:57:08.244031640 +0100 @@ -1,4 +1,4 @@ -/* $Id: t4.h,v 1.20 2007/11/10 18:40:44 drolon Exp $ */ +/* $Id$ */ diff --git a/contrib/hbhpdf/3rd/libhpdf/libhpdf.hbp b/contrib/hbhpdf/3rd/libhpdf/libhpdf.hbp index f0c74de2df..17081df2db 100644 --- a/contrib/hbhpdf/3rd/libhpdf/libhpdf.hbp +++ b/contrib/hbhpdf/3rd/libhpdf/libhpdf.hbp @@ -93,8 +93,8 @@ hpdfutil.c hpdfxref.c # ORIGIN http://libharu.org/ -# VER 2.3.0RC2 -# URL http://libharu.org/files/libhpdf-2.3.0RC2.tar.gz +# VER 2.3.0RC3 +# URL https://github.com/libharu/libharu/archive/RELEASE_2_3_0RC3.zip # DIFF libhpdf.dif # # MAP README diff --git a/src/vm/classes.c b/src/vm/classes.c index 661e892799..225e0575f9 100644 --- a/src/vm/classes.c +++ b/src/vm/classes.c @@ -1917,7 +1917,7 @@ PHB_SYMB hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pMessage, } #else { - PMETHOD pMethod = b_clsFindMsg( pClass, pMsg ); + PMETHOD pMethod = hb_clsFindMsg( pClass, pMsg ); if( pMethod ) { pStack->uiMethod = ( HB_USHORT ) ( pMethod - pClass->pMethods );