tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    96     void oriya();
    96     void oriya();
    97     void tamil();
    97     void tamil();
    98     void telugu();
    98     void telugu();
    99     void kannada();
    99     void kannada();
   100     void malayalam();
   100     void malayalam();
   101     // sinhala missing
   101     void sinhala();
   102 
   102 
   103     void khmer();
   103     void khmer();
   104     void linearB();
   104     void linearB();
   105 };
   105 };
   106 
   106 
   377 		  { 0x0232, 0x0276, 0x0 } },
   377 		  { 0x0232, 0x0276, 0x0 } },
   378                 { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x982, 0x0 },
   378                 { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x982, 0x0 },
   379                   { 0x151, 0x276, 0x172, 0x143, 0x0 } },
   379                   { 0x151, 0x276, 0x172, 0x143, 0x0 } },
   380                 { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 },
   380                 { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 },
   381                   { 0x151, 0x276, 0x172, 0x144, 0x0 } }, 
   381                   { 0x151, 0x276, 0x172, 0x144, 0x0 } }, 
   382 
   382                 // test decomposed two parts matras
       
   383                 { { 0x995, 0x9c7, 0x9be, 0x0 },
       
   384                   { 0x179, 0x151, 0x172, 0x0 } },
       
   385                 { { 0x995, 0x9c7, 0x9d7, 0x0 },
       
   386                   { 0x179, 0x151, 0x17e, 0x0 } },
   383 		{ {0}, {0} }
   387 		{ {0}, {0} }
   384 	    };
   388 	    };
   385 
   389 
   386 
   390 
   387 	    const ShapeTable *s = shape_table;
   391 	    const ShapeTable *s = shape_table;
   500     }
   504     }
   501     {
   505     {
   502         if (QFontDatabase().families(QFontDatabase::Bengali).contains("Likhan")) {
   506         if (QFontDatabase().families(QFontDatabase::Bengali).contains("Likhan")) {
   503             QFont f("Likhan");
   507             QFont f("Likhan");
   504 	    const ShapeTable shape_table [] = {
   508 	    const ShapeTable shape_table [] = {
   505 		{ { 0x09a8, 0x09cd, 0x09af, 0x0 },
   509                 { { 0x9a8, 0x9cd, 0x9af, 0x0 },
   506 		  { 0x0192, 0x0 } },
   510                   { 0x1ca, 0x0 } },
   507 		{ { 0x09b8, 0x09cd, 0x09af, 0x0 },
   511 		{ { 0x09b8, 0x09cd, 0x09af, 0x0 },
   508 		  { 0x01d6, 0x0 } },
   512                   { 0x020e, 0x0 } },
   509 		{ { 0x09b6, 0x09cd, 0x09af, 0x0 },
   513 		{ { 0x09b6, 0x09cd, 0x09af, 0x0 },
   510 		  { 0x01bc, 0x0 } },
   514                   { 0x01f4, 0x0 } },
   511 		{ { 0x09b7, 0x09cd, 0x09af, 0x0 },
   515 		{ { 0x09b7, 0x09cd, 0x09af, 0x0 },
   512 		  { 0x01c6, 0x0 } },
   516                   { 0x01fe, 0x0 } },
   513 		{ { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 },
   517 		{ { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 },
   514 		  { 0xd3, 0x12f, 0x0 } },
   518                   { 0x10b, 0x167, 0x0 } },
   515 
   519 
   516 		{ {0}, {0} }
   520 		{ {0}, {0} }
   517 	    };
   521 	    };
   518 
   522 
   519 
   523 
   645 		  { 0x00a6, 0x0 } },
   649 		  { 0x00a6, 0x0 } },
   646 		{ { 0x0b83, 0x0 },
   650 		{ { 0x0b83, 0x0 },
   647 		  { 0x0025, 0x0 } },
   651 		  { 0x0025, 0x0 } },
   648 		{ { 0x0b83, 0x0b95, 0x0 },
   652 		{ { 0x0b83, 0x0b95, 0x0 },
   649 		  { 0x0025, 0x0031, 0x0 } },
   653 		  { 0x0025, 0x0031, 0x0 } },
       
   654                 { { 0xb95, 0xbc6, 0xbbe, 0x0 },
       
   655                   { 0xa, 0x31, 0x7, 0x0 } },
       
   656                 { { 0xb95, 0xbc7, 0xbbe, 0x0 },
       
   657                   { 0xb, 0x31, 0x7, 0x0 } },
       
   658                 { { 0xb95, 0xbc6, 0xbd7, 0x0 },
       
   659                   { 0xa, 0x31, 0x40, 0x0 } },
   650 
   660 
   651 		{ {0}, {0} }
   661 		{ {0}, {0} }
   652 	    };
   662 	    };
   653 
   663 
   654 
   664 
   692                   { 0xe2, 0xb2, 0x0 } }, 
   702                   { 0xe2, 0xb2, 0x0 } }, 
   693                 { { 0xc15, 0xc4d, 0xc15, 0xc48, 0x0 },
   703                 { { 0xc15, 0xc4d, 0xc15, 0xc48, 0x0 },
   694                   { 0xe6, 0xb3, 0x83, 0x0 } },
   704                   { 0xe6, 0xb3, 0x83, 0x0 } },
   695                 { { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 },
   705                 { { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 },
   696                   { 0xe6, 0xb3, 0x9f, 0x0 } }, 
   706                   { 0xe6, 0xb3, 0x9f, 0x0 } }, 
   697 		{ {0}, {0} }
   707                 { { 0xc15, 0xc46, 0xc56, 0x0 },
       
   708                   { 0xe6, 0xb3, 0x0 } },
       
   709                 { {0}, {0} }
   698 
   710 
   699             };
   711             };
   700 
   712 
   701 	    const ShapeTable *s = shape_table;
   713 	    const ShapeTable *s = shape_table;
   702 	    while (s->unicode[0]) {
   714 	    while (s->unicode[0]) {
   760 	    const ShapeTable shape_table [] = {
   772 	    const ShapeTable shape_table [] = {
   761 		{ { 0x0cb7, 0x0cc6, 0x0 },
   773 		{ { 0x0cb7, 0x0cc6, 0x0 },
   762 		  { 0x00b0, 0x006c, 0x0 } },
   774 		  { 0x00b0, 0x006c, 0x0 } },
   763 		{ { 0x0cb7, 0x0ccd, 0x0 },
   775 		{ { 0x0cb7, 0x0ccd, 0x0 },
   764 		  { 0x0163, 0x0 } },
   776 		  { 0x0163, 0x0 } },
   765 
   777                 { { 0xc95, 0xcbf, 0xcd5, 0x0 },
       
   778                   { 0x114, 0x73, 0x0 } },
       
   779                 { { 0xc95, 0xcc6, 0xcd5, 0x0 },
       
   780                   { 0x90, 0x6c, 0x73, 0x0 } },
       
   781                 { { 0xc95, 0xcc6, 0xcd6, 0x0 },
       
   782                   { 0x90, 0x6c, 0x74, 0x0 } },
       
   783                 { { 0xc95, 0xcc6, 0xcc2, 0x0 },
       
   784                   { 0x90, 0x6c, 0x69, 0x0 } },
       
   785                 { { 0xc95, 0xcca, 0xcd5, 0x0 },
       
   786                   { 0x90, 0x6c, 0x69, 0x73, 0x0 } },
   766 		{ {0}, {0} }
   787 		{ {0}, {0} }
   767 	    };
   788 	    };
   768 
   789 
   769 
   790 
   770 	    const ShapeTable *s = shape_table;
   791 	    const ShapeTable *s = shape_table;
   814 		  { 0x009e, 0x0 } },
   835 		  { 0x009e, 0x0 } },
   815 		{ { 0x0d30, 0x0d4d, 0x200c, 0x0 },
   836 		{ { 0x0d30, 0x0d4d, 0x200c, 0x0 },
   816 		  { 0x009e, 0x0 } },
   837 		  { 0x009e, 0x0 } },
   817 		{ { 0x0d30, 0x0d4d, 0x200d, 0x0 },
   838 		{ { 0x0d30, 0x0d4d, 0x200d, 0x0 },
   818 		  { 0x009e, 0x0 } },
   839 		  { 0x009e, 0x0 } },
   819 
   840                 { { 0xd15, 0xd46, 0xd3e, 0x0 },
   820 
   841                   { 0x5e, 0x34, 0x58, 0x0 } },
       
   842                 { { 0xd15, 0xd47, 0xd3e, 0x0 },
       
   843                   { 0x5f, 0x34, 0x58, 0x0 } },
       
   844                 { { 0xd15, 0xd46, 0xd57, 0x0 },
       
   845                   { 0x5e, 0x34, 0x65, 0x0 } },
       
   846                 { { 0xd15, 0xd57, 0x0 },
       
   847                   { 0x34, 0x65, 0x0 } },
   821 		{ {0}, {0} }
   848 		{ {0}, {0} }
   822 	    };
   849 	    };
   823 
   850 
   824 
   851 
   825 	    const ShapeTable *s = shape_table;
   852 	    const ShapeTable *s = shape_table;
   829 	    }
   856 	    }
   830 	} else {
   857 	} else {
   831 	    QSKIP("couln't find AkrutiMal2", SkipAll);
   858 	    QSKIP("couln't find AkrutiMal2", SkipAll);
   832 	}
   859 	}
   833     }
   860     }
       
   861     {
       
   862         if (QFontDatabase().families(QFontDatabase::Malayalam).contains("Rachana")) {
       
   863             QFont f("Rachana");
       
   864             const ShapeTable shape_table [] = {
       
   865                 { { 0xd37, 0xd4d, 0xd1f, 0xd4d, 0xd30, 0xd40, 0x0 },
       
   866                   { 0x385, 0xa3, 0x0 } },
       
   867                 { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 },
       
   868                   { 0x2ff, 0x0 } },
       
   869                 { { 0xd33, 0xd4d, 0xd33, 0x0 },
       
   870                   { 0x3f8, 0x0 } },
       
   871                 { { 0xd2f, 0xd4d, 0xd15, 0xd4d, 0xd15, 0xd41, 0x0 },
       
   872                   { 0x2ff, 0x0 } },
       
   873 
       
   874                 { {0}, {0} }
       
   875             };
       
   876 
       
   877 
       
   878             const ShapeTable *s = shape_table;
       
   879             while (s->unicode[0]) {
       
   880                 QVERIFY( shaping(f, s) );
       
   881                 ++s;
       
   882             }
       
   883         } else {
       
   884             QSKIP("couln't find Rachana", SkipAll);
       
   885         }
       
   886     }
       
   887 
   834 #else
   888 #else
   835     QSKIP("X11 specific test", SkipAll);
   889     QSKIP("X11 specific test", SkipAll);
   836 #endif
   890 #endif
   837 }
   891 }
   838 
   892 
       
   893 void tst_QTextScriptEngine::sinhala()
       
   894 {
       
   895 #if defined(Q_WS_X11)
       
   896     {
       
   897         if (QFontDatabase().families(QFontDatabase::Sinhala).contains("Malithi Web")) {
       
   898             QFont f("Malithi Web");
       
   899             const ShapeTable shape_table [] = {
       
   900                 { { 0xd9a, 0xdd9, 0xdcf, 0x0 },
       
   901                   { 0x4a, 0x61, 0x42, 0x0 } },
       
   902                 { { 0xd9a, 0xdd9, 0xddf, 0x0 },
       
   903                   { 0x4a, 0x61, 0x50, 0x0 } },
       
   904                 { { 0xd9a, 0xdd9, 0xdca, 0x0 },
       
   905                   { 0x4a, 0x62, 0x0 } },
       
   906                 { { 0xd9a, 0xddc, 0xdca, 0x0 },
       
   907                   { 0x4a, 0x61, 0x42, 0x41, 0x0 } },
       
   908                 { { 0xd9a, 0xdda, 0x0 },
       
   909                   { 0x4a, 0x62, 0x0 } },
       
   910                 { { 0xd9a, 0xddd, 0x0 },
       
   911                   { 0x4a, 0x61, 0x42, 0x41, 0x0 } },
       
   912                 { {0}, {0} }
       
   913             };
       
   914 
       
   915 
       
   916             const ShapeTable *s = shape_table;
       
   917             while (s->unicode[0]) {
       
   918                 QVERIFY( shaping(f, s) );
       
   919                 ++s;
       
   920             }
       
   921         } else {
       
   922             QSKIP("couln't find Malithi Web", SkipAll);
       
   923         }
       
   924     }
       
   925 #else
       
   926     QSKIP("X11 specific test", SkipAll);
       
   927 #endif
       
   928 }
   839 
   929 
   840 
   930 
   841 void tst_QTextScriptEngine::khmer()
   931 void tst_QTextScriptEngine::khmer()
   842 {
   932 {
   843 #if defined(Q_WS_X11)
   933 #if defined(Q_WS_X11)