Changeset 561 for trunk/src/3rdparty/harfbuzz
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c
r2 r561 487 487 for (int i = 0; i < len; ++i) 488 488 qDebug("arabic properties(%d): uc=%x shape=%d, justification=%d", i, chars[i], properties[i].shape, properties[i].justification); 489 */ 490 } 491 492 static Joining getNkoJoining(unsigned short uc) 493 { 494 if (uc < 0x7ca) 495 return JNone; 496 if (uc <= 0x7ea) 497 return JDual; 498 if (uc <= 0x7f3) 499 return JTransparent; 500 if (uc <= 0x7f9) 501 return JNone; 502 if (uc == 0x7fa) 503 return JCausing; 504 return JNone; 505 } 506 507 static void getNkoProperties(const unsigned short *chars, int len, HB_ArabicProperties *properties) 508 { 509 int lastPos = 0; 510 int i = 0; 511 512 Joining j = getNkoJoining(chars[0]); 513 ArabicShape shape = joining_table[XIsolated][j].form2; 514 properties[0].justification = HB_NoJustification; 515 516 for (i = 1; i < len; ++i) { 517 properties[i].justification = (HB_GetUnicodeCharCategory(chars[i]) == HB_Separator_Space) ? 518 ArabicSpace : ArabicNone; 519 520 j = getNkoJoining(chars[i]); 521 522 if (j == JTransparent) { 523 properties[i].shape = XIsolated; 524 continue; 525 } 526 527 properties[lastPos].shape = joining_table[shape][j].form1; 528 shape = joining_table[shape][j].form2; 529 530 531 lastPos = i; 532 } 533 properties[lastPos].shape = joining_table[shape][JNone].form1; 534 535 536 /* 537 for (int i = 0; i < len; ++i) 538 qDebug("nko properties(%d): uc=%x shape=%d, justification=%d", i, chars[i], properties[i].shape, properties[i].justification); 489 539 */ 490 540 } … … 1010 1060 ++properties; 1011 1061 } 1012 if (f + l < item->stringLength) {1062 if (f + l + item->item.pos < item->stringLength) { 1013 1063 ++l; 1014 1064 } 1015 getArabicProperties(uc+f, l, props); 1065 if (item->item.script == HB_Script_Nko) 1066 getNkoProperties(uc+f, l, props); 1067 else 1068 getArabicProperties(uc+f, l, props); 1016 1069 1017 1070 for (i = 0; i < (int)item->num_glyphs; i++) { … … 1052 1105 HB_STACKARRAY(HB_UChar16, shapedChars, item->item.length); 1053 1106 1054 assert(item->item.script == HB_Script_Arabic || item->item.script == HB_Script_Syriac); 1107 assert(item->item.script == HB_Script_Arabic || item->item.script == HB_Script_Syriac 1108 || item->item.script == HB_Script_Nko); 1055 1109 1056 1110 #ifndef NO_OPENTYPE … … 1066 1120 #endif 1067 1121 1068 if (item->item.script == HB_Script_Syriac)1122 if (item->item.script != HB_Script_Arabic) 1069 1123 return HB_BasicShape(item); 1070 1124 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
r2 r561 2060 2060 HB_Anchor *bans; 2061 2061 2062 HB_UNUSED(num_classes);2063 2064 2062 if ( ba->BaseRecord ) 2065 2063 { … … 2068 2066 if ( ba->BaseCount ) 2069 2067 { 2068 HB_UShort i, count; 2069 count = num_classes * ba->BaseCount; 2070 2070 bans = br[0].BaseAnchor; 2071 for (i = 0; i < count; i++) 2072 Free_Anchor (&bans[i]); 2071 2073 FREE( bans ); 2072 2074 } … … 2724 2726 HB_Error error; 2725 2727 2726 HB_UShort k,m, n, count;2728 HB_UShort m, n, count; 2727 2729 HB_UInt cur_offset, new_offset, base_offset; 2728 2730 -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c
r2 r561 63 63 if (!HB_ConvertStringToGlyphIndices(shaper_item)) 64 64 return FALSE; 65 66 65 67 66 HB_HeuristicSetGlyphAttributes(shaper_item); -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-impl.c
r2 r561 34 34 HB_Error *perror ) 35 35 { 36 HB_Error error = 0;36 HB_Error error = (HB_Error)0; 37 37 HB_Pointer block = NULL; 38 38 … … 55 55 { 56 56 HB_Pointer block2 = NULL; 57 HB_Error error = 0;57 HB_Error error = (HB_Error)0; 58 58 59 59 block2 = realloc( block, new_size ); -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
r2 r561 420 420 421 421 Invalid, Invalid, Invalid, Invalid, 422 Invalid, Invalid, Invalid, LengthMark,422 Invalid, Invalid, Invalid, Matra, 423 423 Invalid, Invalid, Invalid, Invalid, 424 424 Invalid, Invalid, Invalid, Invalid, … … 567 567 None, None, None, None, 568 568 569 None, None, None, None,569 Below, None, None, None, 570 570 None, None, None, None, 571 571 None, None, None, None, … … 1051 1051 // vowel matras that have to be split into two parts. 1052 1052 static const unsigned short split_matras[] = { 1053 // matra, split1, split2 1053 // matra, split1, split2, split3 1054 1054 1055 1055 // bengalis 1056 0x9cb, 0x9c7, 0x9be, 1057 0x9cc, 0x9c7, 0x9d7, 1056 0x9cb, 0x9c7, 0x9be, 0x0, 1057 0x9cc, 0x9c7, 0x9d7, 0x0, 1058 1058 // oriya 1059 0xb48, 0xb47, 0xb56, 1060 0xb4b, 0xb47, 0xb3e, 1061 0xb4c, 0xb47, 0xb57, 1059 0xb48, 0xb47, 0xb56, 0x0, 1060 0xb4b, 0xb47, 0xb3e, 0x0, 1061 0xb4c, 0xb47, 0xb57, 0x0, 1062 1062 // tamil 1063 0xbca, 0xbc6, 0xbbe, 1064 0xbcb, 0xbc7, 0xbbe, 1065 0xbcc, 0xbc6, 0xbd7, 1063 0xbca, 0xbc6, 0xbbe, 0x0, 1064 0xbcb, 0xbc7, 0xbbe, 0x0, 1065 0xbcc, 0xbc6, 0xbd7, 0x0, 1066 1066 // telugu 1067 0xc48, 0xc46, 0xc56, 1067 0xc48, 0xc46, 0xc56, 0x0, 1068 1068 // kannada 1069 0xcc0, 0xcbf, 0xcd5, 1070 0xcc7, 0xcc6, 0xcd5, 1071 0xcc8, 0xcc6, 0xcd6, 1072 0xcca, 0xcc6, 0xcc2, 1073 0xccb, 0xcc a, 0xcd5,1069 0xcc0, 0xcbf, 0xcd5, 0x0, 1070 0xcc7, 0xcc6, 0xcd5, 0x0, 1071 0xcc8, 0xcc6, 0xcd6, 0x0, 1072 0xcca, 0xcc6, 0xcc2, 0x0, 1073 0xccb, 0xcc6, 0xcc2, 0xcd5, 1074 1074 // malayalam 1075 0xd4a, 0xd46, 0xd3e, 1076 0xd4b, 0xd47, 0xd3e, 1077 0xd4c, 0xd46, 0xd57, 1075 0xd4a, 0xd46, 0xd3e, 0x0, 1076 0xd4b, 0xd47, 0xd3e, 0x0, 1077 0xd4c, 0xd46, 0xd57, 0x0, 1078 1078 // sinhala 1079 0xdda, 0xdd9, 0xdca, 1080 0xddc, 0xdd9, 0xdcf, 1081 0xddd, 0xdd c, 0xdca,1082 0xdde, 0xdd9, 0xddf, 1079 0xdda, 0xdd9, 0xdca, 0x0, 1080 0xddc, 0xdd9, 0xdcf, 0x0, 1081 0xddd, 0xdd9, 0xdcf, 0xdca, 1082 0xdde, 0xdd9, 0xddf, 0x0, 1083 1083 0xffff 1084 1084 }; 1085 1085 1086 static inline void splitMatra(unsigned short *reordered, int matra, int &len , int &base)1086 static inline void splitMatra(unsigned short *reordered, int matra, int &len) 1087 1087 { 1088 1088 unsigned short matra_uc = reordered[matra]; … … 1091 1091 const unsigned short *split = split_matras; 1092 1092 while (split[0] < matra_uc) 1093 split += 3;1093 split += 4; 1094 1094 1095 1095 assert(*split == matra_uc); 1096 1096 ++split; 1097 1097 1098 if (indic_position(*split) == Pre) { 1099 reordered[matra] = split[1]; 1100 memmove(reordered + 1, reordered, len*sizeof(unsigned short)); 1101 reordered[0] = split[0]; 1102 base++; 1103 } else { 1104 memmove(reordered + matra + 1, reordered + matra, (len-matra)*sizeof(unsigned short)); 1105 reordered[matra] = split[0]; 1106 reordered[matra+1] = split[1]; 1107 } 1108 len++; 1098 int added_chars = split[2] == 0x0 ? 1 : 2; 1099 1100 memmove(reordered + matra + added_chars, reordered + matra, (len-matra)*sizeof(unsigned short)); 1101 reordered[matra] = split[0]; 1102 reordered[matra+1] = split[1]; 1103 if(added_chars == 2) 1104 reordered[matra+2] = split[2]; 1105 len += added_chars; 1109 1106 } 1110 1107 … … 1131 1128 // #define INDIC_DEBUG 1132 1129 #ifdef INDIC_DEBUG 1133 #define IDEBUG qDebug 1130 #define IDEBUG hb_debug 1131 #include <stdarg.h> 1132 1133 static void hb_debug(const char *msg, ...) 1134 { 1135 va_list ap; 1136 va_start(ap, msg); // use variable arg list 1137 vfprintf(stderr, msg, ap); 1138 va_end(ap); 1139 fprintf(stderr, "\n"); 1140 } 1141 1134 1142 #else 1135 1143 #define IDEBUG if(0) printf 1136 1144 #endif 1137 1145 1138 #if def INDIC_DEBUG1146 #if 0 //def INDIC_DEBUG 1139 1147 static QString propertiesToString(int properties) 1140 1148 { … … 1245 1253 // #### replace the HasReph property by testing if the feature exists in the font! 1246 1254 if (form(*uc) == Consonant || (script == HB_Script_Bengali && form(*uc) == IndependentVowel)) { 1247 beginsWithRa = (properties & HasReph) && ((len > 2) && *uc == ra && *(uc+1) == halant); 1255 if ((properties & HasReph) && (len > 2) && 1256 (*uc == ra || *uc == 0x9f0) && *(uc+1) == halant) 1257 beginsWithRa = true; 1248 1258 1249 1259 if (beginsWithRa && form(*(uc+2)) == Control) … … 1387 1397 // them there now. 1388 1398 if (matra_position == Split) { 1389 splitMatra(uc, matra, len , base);1399 splitMatra(uc, matra, len); 1390 1400 // Handle three-part matras (0xccb in Kannada) 1391 1401 matra_position = indic_position(uc[matra]); 1392 if (matra_position == Split)1393 splitMatra(uc, matra, len, base); 1394 } elseif (matra_position == Pre) {1402 } 1403 1404 if (matra_position == Pre) { 1395 1405 unsigned short m = uc[matra]; 1396 1406 while (matra--) … … 1542 1552 | BelowSubstProperty 1543 1553 | AboveSubstProperty 1554 | PostSubstProperty 1544 1555 | HalantProperty 1545 1556 | PositioningProperties); … … 1599 1610 // blws always applies 1600 1611 // abvs always applies 1601 1602 // psts 1603 // ### this looks slightly different from before, but I believe it's correct 1604 if (reordered[len-1] != halant || base != len-2) 1605 properties[base] &= ~PostSubstProperty; 1606 for (i = base+1; i < len; ++i) 1607 properties[i] &= ~PostSubstProperty; 1608 1612 // psts always applies 1609 1613 // halant always applies 1610 1614 1611 1615 #ifdef INDIC_DEBUG 1612 {1613 IDEBUG("OT properties:");1614 for (int i = 0; i < len; ++i)1615 qDebug(" i: %s", ::propertiesToString(properties[i]).toLatin1().data());1616 }1616 // { 1617 // IDEBUG("OT properties:"); 1618 // for (int i = 0; i < len; ++i) 1619 // qDebug(" i: %s", ::propertiesToString(properties[i]).toLatin1().data()); 1620 // } 1617 1621 #endif 1618 1622 … … 1732 1736 (uc[0] == 0x0985 || uc[0] == 0x098f)) 1733 1737 break; 1738 // Sinhala uses the Halant as a component of certain matras. Allow these, but keep the state on Matra. 1739 if (script == HB_Script_Sinhala && state == Matra) { 1740 ++pos; 1741 continue; 1742 } 1743 if (script == HB_Script_Malayalam && state == Matra && uc[pos-1] == 0x0d41) { 1744 ++pos; 1745 continue; 1746 } 1734 1747 goto finish; 1735 1748 case Nukta: … … 1742 1755 // fall through 1743 1756 case VowelMark: 1744 if (state == Matra || state == IndependentVowel)1757 if (state == Matra || state == LengthMark || state == IndependentVowel) 1745 1758 break; 1746 1759 // fall through … … 1748 1761 if (state == Consonant || state == Nukta) 1749 1762 break; 1763 if (state == Matra) { 1764 // ### needs proper testing for correct two/three part matras 1765 break; 1766 } 1750 1767 // ### not sure if this is correct. If it is, does it apply only to Bengali or should 1751 1768 // it work for all Indic languages? … … 1763 1780 1764 1781 case LengthMark: 1782 if (state == Matra) { 1783 // ### needs proper testing for correct two/three part matras 1784 break; 1785 } 1765 1786 case IndependentVowel: 1766 1787 case Invalid: -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-open.c
r2 r561 1115 1115 return error; 1116 1116 1117 cd->loaded = TRUE; 1118 1117 1119 return HB_Err_Ok; 1118 1120 } -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-shape.h
r2 r561 162 162 * Buffer for output 163 163 */ 164 typedef struct _HB_GlyphBuf er HB_GlyphBuffer;164 typedef struct _HB_GlyphBuffer HB_GlyphBuffer; 165 165 struct _HB_GlyphBuffer { 166 166 int glyph_item_size; -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
r2 r561 638 638 { HB_BasicShape, 0 }, 639 639 // Khmer 640 { HB_KhmerShape, HB_KhmerAttributes } 640 { HB_KhmerShape, HB_KhmerAttributes }, 641 // N'Ko 642 { HB_ArabicShape, 0} 641 643 }; 642 644 … … 878 880 { HB_MAKE_TAG('r', 'u', 'n', 'r'), 0 }, 879 881 // Khmer 880 { HB_MAKE_TAG('k', 'h', 'm', 'r'), 1 } 882 { HB_MAKE_TAG('k', 'h', 'm', 'r'), 1 }, 883 // N'Ko 884 { HB_MAKE_TAG('n', 'k', 'o', ' '), 1 } 881 885 }; 882 886 enum { NumOTScripts = sizeof(ot_scripts)/sizeof(OTScripts) }; … … 936 940 return 0; 937 941 stream = (HB_Stream)malloc(sizeof(HB_StreamRec)); 942 if (!stream) 943 return 0; 938 944 stream->base = (HB_Byte*)malloc(length); 945 if (!stream->base) { 946 free(stream); 947 return 0; 948 } 939 949 error = tableFunc(font, tag, stream->base, &length); 940 950 if (error) { … … 951 961 { 952 962 HB_Face face = (HB_Face )malloc(sizeof(HB_FaceRec)); 963 if (!face) 964 return 0; 953 965 954 966 face->isSymbolFont = false; … … 962 974 face->tmpLogClusters = 0; 963 975 face->glyphs_substituted = false; 964 965 HB_Error error; 976 face->buffer = 0; 977 978 HB_Error error = HB_Err_Ok; 966 979 HB_Stream stream; 967 980 HB_Stream gdefStream; 968 981 969 982 gdefStream = getTableStream(font, tableFunc, TTAG_GDEF); 983 error = HB_Err_Not_Covered; 970 984 if (!gdefStream || (error = HB_Load_GDEF_Table(gdefStream, &face->gdef))) { 971 985 //DEBUG("error loading gdef table: %d", error); … … 975 989 //DEBUG() << "trying to load gsub table"; 976 990 stream = getTableStream(font, tableFunc, TTAG_GSUB); 991 error = HB_Err_Not_Covered; 977 992 if (!stream || (error = HB_Load_GSUB_Table(stream, &face->gsub, face->gdef, gdefStream))) { 978 993 face->gsub = 0; … … 986 1001 987 1002 stream = getTableStream(font, tableFunc, TTAG_GPOS); 1003 error = HB_Err_Not_Covered; 988 1004 if (!stream || (error = HB_Load_GPOS_Table(stream, &face->gpos, face->gdef, gdefStream))) { 989 1005 face->gpos = 0; … … 997 1013 face->supported_scripts[i] = checkScript(face, i); 998 1014 999 hb_buffer_new(&face->buffer); 1015 if (hb_buffer_new(&face->buffer) != HB_Err_Ok) { 1016 HB_FreeFace(face); 1017 return 0; 1018 } 1000 1019 1001 1020 return face; … … 1117 1136 HB_Bool HB_OpenTypeShape(HB_ShaperItem *item, const hb_uint32 *properties) 1118 1137 { 1138 HB_GlyphAttributes *tmpAttributes; 1139 unsigned int *tmpLogClusters; 1119 1140 1120 1141 HB_Face face = item->face; … … 1124 1145 hb_buffer_clear(face->buffer); 1125 1146 1126 face->tmpAttributes = (HB_GlyphAttributes *) realloc(face->tmpAttributes, face->length*sizeof(HB_GlyphAttributes)); 1127 face->tmpLogClusters = (unsigned int *) realloc(face->tmpLogClusters, face->length*sizeof(unsigned int)); 1147 tmpAttributes = (HB_GlyphAttributes *) realloc(face->tmpAttributes, face->length*sizeof(HB_GlyphAttributes)); 1148 if (!tmpAttributes) 1149 return false; 1150 face->tmpAttributes = tmpAttributes; 1151 1152 tmpLogClusters = (unsigned int *) realloc(face->tmpLogClusters, face->length*sizeof(unsigned int)); 1153 if (!tmpLogClusters) 1154 return false; 1155 face->tmpLogClusters = tmpLogClusters; 1156 1128 1157 for (int i = 0; i < face->length; ++i) { 1129 1158 hb_buffer_add_glyph(face->buffer, item->glyphs[i], properties ? properties[i] : 0, i); -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
r2 r561 63 63 HB_Script_Runic, 64 64 HB_Script_Khmer, 65 HB_Script_Nko, 65 66 HB_Script_Inherited, 66 67 HB_ScriptCount = HB_Script_Inherited … … 103 104 HB_Script_Phoenician = Common, 104 105 HB_Script_PhagsPa = Common, 105 HB_Script_Nko = Common106 106 */ 107 107 } HB_Script; … … 243 243 } HB_FontRec; 244 244 245 typedef struct { 246 const HB_UChar16 *string; 247 hb_uint32 stringLength; 248 HB_ScriptItem item; 249 HB_Font font; 250 HB_Face face; 251 int shaperFlags; /* HB_ShaperFlags */ 252 253 HB_Bool glyphIndicesPresent; /* set to true if the glyph indicies are already setup in the glyphs array */ 254 hb_uint32 initialGlyphCount; 255 256 hb_uint32 num_glyphs; /* in: available glyphs out: glyphs used/needed */ 257 HB_Glyph *glyphs; /* out parameter */ 258 HB_GlyphAttributes *attributes; /* out */ 259 HB_Fixed *advances; /* out */ 260 HB_FixedPoint *offsets; /* out */ 261 unsigned short *log_clusters; /* out */ 245 typedef struct HB_ShaperItem_ HB_ShaperItem; 246 247 struct HB_ShaperItem_ { 248 const HB_UChar16 *string; /* input: the Unicode UTF16 text to be shaped */ 249 hb_uint32 stringLength; /* input: the length of the input in 16-bit words */ 250 HB_ScriptItem item; /* input: the current run to be shaped: a run of text all in the same script that is a substring of <string> */ 251 HB_Font font; /* input: the font: scale, units and function pointers supplying glyph indices and metrics */ 252 HB_Face face; /* input: the shaper state; current script, access to the OpenType tables , etc. */ 253 int shaperFlags; /* input (unused) should be set to 0; intended to support flags defined in HB_ShaperFlag */ 254 HB_Bool glyphIndicesPresent; /* input: true if the <glyphs> array contains glyph indices ready to be shaped */ 255 hb_uint32 initialGlyphCount; /* input: if glyphIndicesPresent is true, the number of glyph indices in the <glyphs> array */ 256 257 hb_uint32 num_glyphs; /* input: capacity of output arrays <glyphs>, <attributes>, <advances>, <offsets>, and <log_clusters>; */ 258 /* output: required capacity (may be larger than actual capacity) */ 259 260 HB_Glyph *glyphs; /* output: <num_glyphs> indices of shaped glyphs */ 261 HB_GlyphAttributes *attributes; /* output: <num_glyphs> glyph attributes */ 262 HB_Fixed *advances; /* output: <num_glyphs> advances */ 263 HB_FixedPoint *offsets; /* output: <num_glyphs> offsets */ 264 unsigned short *log_clusters; /* output: for each output glyph, the index in the input of the start of its logical cluster */ 262 265 263 266 /* internal */ 264 HB_Bool kerning_applied; /* out: kerning applied byshaper */265 } HB_ShaperItem;267 HB_Bool kerning_applied; /* output: true if kerning was applied by the shaper */ 268 }; 266 269 267 270 HB_Bool HB_ShapeItem(HB_ShaperItem *item); -
trunk/src/3rdparty/harfbuzz/src/harfbuzz-stream.c
r2 r561 71 71 HB_UInt pos ) 72 72 { 73 HB_Error error = 0;73 HB_Error error = (HB_Error)0; 74 74 75 75 stream->pos = pos; -
trunk/src/3rdparty/harfbuzz/tests/shaping/main.cpp
r2 r561 179 179 void kannada(); 180 180 void malayalam(); 181 // sinhala missing181 void sinhala(); 182 182 183 183 void khmer(); 184 void nko(); 184 185 void linearB(); 185 186 }; … … 511 512 { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 }, 512 513 { 0x151, 0x276, 0x172, 0x144, 0x0 } }, 514 // test decomposed two parts matras 515 { { 0x995, 0x9c7, 0x9be, 0x0 }, 516 { 0x179, 0x151, 0x172, 0x0 } }, 517 { { 0x995, 0x9c7, 0x9d7, 0x0 }, 518 { 0x179, 0x151, 0x17e, 0x0 } }, 519 { { 0x9b0, 0x9cd, 0x9ad, 0x0 }, 520 { 0x168, 0x276, 0x0 } }, 521 { { 0x9f0, 0x9cd, 0x9ad, 0x0 }, 522 { 0x168, 0x276, 0x0 } }, 523 { { 0x9f1, 0x9cd, 0x9ad, 0x0 }, 524 { 0x191, 0x17d, 0x168, 0x0 } }, 513 525 514 526 { {0}, {0} } … … 639 651 const ShapeTable shape_table [] = { 640 652 { { 0x09a8, 0x09cd, 0x09af, 0x0 }, 641 { 0x0192, 0x0 } },653 { 0x01ca, 0x0 } }, 642 654 { { 0x09b8, 0x09cd, 0x09af, 0x0 }, 643 { 0x01d6, 0x0 } },655 { 0x020e, 0x0 } }, 644 656 { { 0x09b6, 0x09cd, 0x09af, 0x0 }, 645 { 0x01bc, 0x0 } },657 { 0x01f4, 0x0 } }, 646 658 { { 0x09b7, 0x09cd, 0x09af, 0x0 }, 647 { 0x01c6, 0x0 } },659 { 0x01fe, 0x0 } }, 648 660 { { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 }, 649 { 0xd3, 0x12f, 0x0 } }, 661 { 0x10b, 0x167, 0x0 } }, 662 { { 0x9b0, 0x9cd, 0x9ad, 0x0 }, 663 { 0xa1, 0x167, 0x0 } }, 664 { { 0x9f0, 0x9cd, 0x9ad, 0x0 }, 665 { 0xa1, 0x167, 0x0 } }, 666 { { 0x9f1, 0x9cd, 0x9ad, 0x0 }, 667 { 0x11c, 0xa1, 0x0 } }, 650 668 651 669 { {0}, {0} } … … 669 687 { 670 688 { 671 FT_Face face = loadFace("lohit .punjabi.1.1.ttf");689 FT_Face face = loadFace("lohit_pa.ttf"); 672 690 if (face) { 673 691 const ShapeTable shape_table [] = { … … 824 842 { { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 }, 825 843 { 0xe6, 0xb3, 0x9f, 0x0 } }, 826 { {0}, {0} } 827 844 { { 0xc15, 0xc46, 0xc56, 0x0 }, 845 { 0xe6, 0xb3, 0x0 } }, 846 { {0}, {0} } 828 847 }; 829 848 … … 868 887 { { 0x0cb0, 0x0ccd, 0x200d, 0x0c95, 0x0 }, 869 888 { 0x0050, 0x00a7, 0x0 } }, 870 871 889 { {0}, {0} } 872 890 }; … … 892 910 { { 0x0cb7, 0x0ccd, 0x0 }, 893 911 { 0x0163, 0x0 } }, 912 { { 0xc95, 0xcbf, 0xcd5, 0x0 }, 913 { 0x114, 0x73, 0x0 } }, 914 { { 0xc95, 0xcc6, 0xcd5, 0x0 }, 915 { 0x90, 0x6c, 0x73, 0x0 } }, 916 { { 0xc95, 0xcc6, 0xcd6, 0x0 }, 917 { 0x90, 0x6c, 0x74, 0x0 } }, 918 { { 0xc95, 0xcc6, 0xcc2, 0x0 }, 919 { 0x90, 0x6c, 0x69, 0x0 } }, 920 { { 0xc95, 0xcca, 0xcd5, 0x0 }, 921 { 0x90, 0x6c, 0x69, 0x73, 0x0 } }, 922 894 923 895 924 { {0}, {0} } … … 944 973 { { 0x0d30, 0x0d4d, 0x200d, 0x0 }, 945 974 { 0x009e, 0x0 } }, 946 975 { { 0xd15, 0xd46, 0xd3e, 0x0 }, 976 { 0x5e, 0x34, 0x58, 0x0 } }, 977 { { 0xd15, 0xd47, 0xd3e, 0x0 }, 978 { 0x5f, 0x34, 0x58, 0x0 } }, 979 { { 0xd15, 0xd46, 0xd57, 0x0 }, 980 { 0x5e, 0x34, 0x65, 0x0 } }, 981 { { 0xd15, 0xd57, 0x0 }, 982 { 0x34, 0x65, 0x0 } }, 983 { { 0xd1f, 0xd4d, 0xd1f, 0xd41, 0xd4d, 0x0 }, 984 { 0x69, 0x5b, 0x64, 0x0 } }, 947 985 948 986 { {0}, {0} } … … 961 999 } 962 1000 } 963 } 964 1001 1002 { 1003 FT_Face face = loadFace("Rachana.ttf"); 1004 if (face) { 1005 const ShapeTable shape_table [] = { 1006 { { 0xd37, 0xd4d, 0xd1f, 0xd4d, 0xd30, 0xd40, 0x0 }, 1007 { 0x385, 0xa3, 0x0 } }, 1008 { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 }, 1009 { 0x2ff, 0x0 } }, 1010 { { 0xd33, 0xd4d, 0xd33, 0x0 }, 1011 { 0x3f8, 0x0 } }, 1012 { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 }, 1013 { 0x2ff, 0x0 } }, 1014 1015 { {0}, {0} } 1016 }; 1017 1018 1019 const ShapeTable *s = shape_table; 1020 while (s->unicode[0]) { 1021 QVERIFY( shaping(face, s, HB_Script_Malayalam) ); 1022 ++s; 1023 } 1024 1025 FT_Done_Face(face); 1026 } else { 1027 QSKIP("couln't find Rachana.ttf", SkipAll); 1028 } 1029 } 1030 1031 } 1032 1033 void tst_QScriptEngine::sinhala() 1034 { 1035 { 1036 FT_Face face = loadFace("FM-MalithiUW46.ttf"); 1037 if (face) { 1038 const ShapeTable shape_table [] = { 1039 { { 0xd9a, 0xdd9, 0xdcf, 0x0 }, 1040 { 0x4a, 0x61, 0x42, 0x0 } }, 1041 { { 0xd9a, 0xdd9, 0xddf, 0x0 }, 1042 { 0x4a, 0x61, 0x50, 0x0 } }, 1043 { { 0xd9a, 0xdd9, 0xdca, 0x0 }, 1044 { 0x4a, 0x62, 0x0 } }, 1045 { { 0xd9a, 0xddc, 0xdca, 0x0 }, 1046 { 0x4a, 0x61, 0x42, 0x41, 0x0 } }, 1047 { { 0xd9a, 0xdda, 0x0 }, 1048 { 0x4a, 0x62, 0x0 } }, 1049 { { 0xd9a, 0xddd, 0x0 }, 1050 { 0x4a, 0x61, 0x42, 0x41, 0x0 } }, 1051 { {0}, {0} } 1052 }; 1053 1054 const ShapeTable *s = shape_table; 1055 while (s->unicode[0]) { 1056 QVERIFY( shaping(face, s, HB_Script_Sinhala) ); 1057 ++s; 1058 } 1059 1060 FT_Done_Face(face); 1061 } else { 1062 QSKIP("couln't find FM-MalithiUW46.ttf", SkipAll); 1063 } 1064 } 1065 } 965 1066 966 1067 … … 1006 1107 } 1007 1108 1109 void tst_QScriptEngine::nko() 1110 { 1111 { 1112 FT_Face face = loadFace("DejaVuSans.ttf"); 1113 if (face) { 1114 const ShapeTable shape_table [] = { 1115 { { 0x7ca, 0x0 }, 1116 { 0x5c1, 0x0 } }, 1117 { { 0x7ca, 0x7ca, 0x0 }, 1118 { 0x14db, 0x14d9, 0x0 } }, 1119 { { 0x7ca, 0x7fa, 0x7ca, 0x0 }, 1120 { 0x14db, 0x5ec, 0x14d9, 0x0 } }, 1121 { { 0x7ca, 0x7f3, 0x7ca, 0x0 }, 1122 { 0x14db, 0x5e7, 0x14d9, 0x0 } }, 1123 { { 0x7ca, 0x7f3, 0x7fa, 0x7ca, 0x0 }, 1124 { 0x14db, 0x5e7, 0x5ec, 0x14d9, 0x0 } }, 1125 { {0}, {0} } 1126 }; 1127 1128 1129 const ShapeTable *s = shape_table; 1130 while (s->unicode[0]) { 1131 QVERIFY( shaping(face, s, HB_Script_Nko) ); 1132 ++s; 1133 } 1134 1135 FT_Done_Face(face); 1136 } else { 1137 QSKIP("couln't find DejaVuSans.ttf", SkipAll); 1138 } 1139 } 1140 } 1141 1142 1008 1143 void tst_QScriptEngine::linearB() 1009 1144 { 1010 1145 { 1011 FT_Face face = loadFace(" PENUTURE.TTF");1146 FT_Face face = loadFace("penuture.ttf"); 1012 1147 if (face) { 1013 1148 const ShapeTable shape_table [] = {
Note:
See TracChangeset
for help on using the changeset viewer.