15569331642446be05292e3e1f8a51218827168cdclaireho/*
25569331642446be05292e3e1f8a51218827168cdclaireho * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
35569331642446be05292e3e1f8a51218827168cdclaireho *
45569331642446be05292e3e1f8a51218827168cdclaireho * This is part of HarfBuzz, an OpenType Layout engine library.
55569331642446be05292e3e1f8a51218827168cdclaireho *
65569331642446be05292e3e1f8a51218827168cdclaireho * Permission is hereby granted, without written agreement and without
75569331642446be05292e3e1f8a51218827168cdclaireho * license or royalty fees, to use, copy, modify, and distribute this
85569331642446be05292e3e1f8a51218827168cdclaireho * software and its documentation for any purpose, provided that the
95569331642446be05292e3e1f8a51218827168cdclaireho * above copyright notice and the following two paragraphs appear in
105569331642446be05292e3e1f8a51218827168cdclaireho * all copies of this software.
115569331642446be05292e3e1f8a51218827168cdclaireho *
125569331642446be05292e3e1f8a51218827168cdclaireho * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
135569331642446be05292e3e1f8a51218827168cdclaireho * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
145569331642446be05292e3e1f8a51218827168cdclaireho * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
155569331642446be05292e3e1f8a51218827168cdclaireho * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
165569331642446be05292e3e1f8a51218827168cdclaireho * DAMAGE.
175569331642446be05292e3e1f8a51218827168cdclaireho *
185569331642446be05292e3e1f8a51218827168cdclaireho * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
195569331642446be05292e3e1f8a51218827168cdclaireho * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
205569331642446be05292e3e1f8a51218827168cdclaireho * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
215569331642446be05292e3e1f8a51218827168cdclaireho * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
225569331642446be05292e3e1f8a51218827168cdclaireho * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
235569331642446be05292e3e1f8a51218827168cdclaireho */
245569331642446be05292e3e1f8a51218827168cdclaireho
255569331642446be05292e3e1f8a51218827168cdclaireho#include <QtTest/QtTest>
265569331642446be05292e3e1f8a51218827168cdclaireho
275569331642446be05292e3e1f8a51218827168cdclaireho#include <ft2build.h>
285569331642446be05292e3e1f8a51218827168cdclaireho#include FT_FREETYPE_H
295569331642446be05292e3e1f8a51218827168cdclaireho#include FT_TRUETYPE_TABLES_H
305569331642446be05292e3e1f8a51218827168cdclaireho
315569331642446be05292e3e1f8a51218827168cdclaireho#include <harfbuzz-shaper.h>
325569331642446be05292e3e1f8a51218827168cdclaireho#include <harfbuzz-global.h>
335569331642446be05292e3e1f8a51218827168cdclaireho#include <harfbuzz-gpos.h>
345569331642446be05292e3e1f8a51218827168cdclaireho
355569331642446be05292e3e1f8a51218827168cdclairehostatic FT_Library freetype;
365569331642446be05292e3e1f8a51218827168cdclaireho
375569331642446be05292e3e1f8a51218827168cdclairehostatic FT_Face loadFace(const char *name)
385569331642446be05292e3e1f8a51218827168cdclaireho{
395569331642446be05292e3e1f8a51218827168cdclaireho    FT_Face face;
405569331642446be05292e3e1f8a51218827168cdclaireho    char path[256];
415569331642446be05292e3e1f8a51218827168cdclaireho
425569331642446be05292e3e1f8a51218827168cdclaireho    strcpy(path, SRCDIR);
435569331642446be05292e3e1f8a51218827168cdclaireho    strcat(path, "/fonts/");
445569331642446be05292e3e1f8a51218827168cdclaireho    strcat(path, name);
455569331642446be05292e3e1f8a51218827168cdclaireho
465569331642446be05292e3e1f8a51218827168cdclaireho    if (FT_New_Face(freetype, path, /*index*/0, &face))
475569331642446be05292e3e1f8a51218827168cdclaireho        return 0;
485569331642446be05292e3e1f8a51218827168cdclaireho    return face;
495569331642446be05292e3e1f8a51218827168cdclaireho}
505569331642446be05292e3e1f8a51218827168cdclaireho
515569331642446be05292e3e1f8a51218827168cdclairehostatic HB_UChar32 getChar(const HB_UChar16 *string, hb_uint32 length, hb_uint32 &i)
525569331642446be05292e3e1f8a51218827168cdclaireho{
535569331642446be05292e3e1f8a51218827168cdclaireho    HB_UChar32 ch;
545569331642446be05292e3e1f8a51218827168cdclaireho    if (HB_IsHighSurrogate(string[i])
555569331642446be05292e3e1f8a51218827168cdclaireho        && i < length - 1
565569331642446be05292e3e1f8a51218827168cdclaireho        && HB_IsLowSurrogate(string[i + 1])) {
575569331642446be05292e3e1f8a51218827168cdclaireho        ch = HB_SurrogateToUcs4(string[i], string[i + 1]);
585569331642446be05292e3e1f8a51218827168cdclaireho        ++i;
595569331642446be05292e3e1f8a51218827168cdclaireho    } else {
605569331642446be05292e3e1f8a51218827168cdclaireho        ch = string[i];
615569331642446be05292e3e1f8a51218827168cdclaireho    }
625569331642446be05292e3e1f8a51218827168cdclaireho    return ch;
635569331642446be05292e3e1f8a51218827168cdclaireho}
645569331642446be05292e3e1f8a51218827168cdclaireho
655569331642446be05292e3e1f8a51218827168cdclairehostatic HB_Bool hb_stringToGlyphs(HB_Font font, const HB_UChar16 *string, hb_uint32 length, HB_Glyph *glyphs, hb_uint32 *numGlyphs, HB_Bool /*rightToLeft*/)
665569331642446be05292e3e1f8a51218827168cdclaireho{
675569331642446be05292e3e1f8a51218827168cdclaireho    FT_Face face = (FT_Face)font->userData;
685569331642446be05292e3e1f8a51218827168cdclaireho    if (length > *numGlyphs)
695569331642446be05292e3e1f8a51218827168cdclaireho        return false;
705569331642446be05292e3e1f8a51218827168cdclaireho
715569331642446be05292e3e1f8a51218827168cdclaireho    int glyph_pos = 0;
725569331642446be05292e3e1f8a51218827168cdclaireho    for (hb_uint32 i = 0; i < length; ++i) {
735569331642446be05292e3e1f8a51218827168cdclaireho        glyphs[glyph_pos] = FT_Get_Char_Index(face, getChar(string, length, i));
745569331642446be05292e3e1f8a51218827168cdclaireho        ++glyph_pos;
755569331642446be05292e3e1f8a51218827168cdclaireho    }
765569331642446be05292e3e1f8a51218827168cdclaireho
775569331642446be05292e3e1f8a51218827168cdclaireho    *numGlyphs = glyph_pos;
785569331642446be05292e3e1f8a51218827168cdclaireho
795569331642446be05292e3e1f8a51218827168cdclaireho    return true;
805569331642446be05292e3e1f8a51218827168cdclaireho}
815569331642446be05292e3e1f8a51218827168cdclaireho
825569331642446be05292e3e1f8a51218827168cdclairehostatic void hb_getAdvances(HB_Font /*font*/, const HB_Glyph * /*glyphs*/, hb_uint32 numGlyphs, HB_Fixed *advances, int /*flags*/)
835569331642446be05292e3e1f8a51218827168cdclaireho{
845569331642446be05292e3e1f8a51218827168cdclaireho    for (hb_uint32 i = 0; i < numGlyphs; ++i)
855569331642446be05292e3e1f8a51218827168cdclaireho        advances[i] = 0; // ### not tested right now
865569331642446be05292e3e1f8a51218827168cdclaireho}
875569331642446be05292e3e1f8a51218827168cdclaireho
885569331642446be05292e3e1f8a51218827168cdclairehostatic HB_Bool hb_canRender(HB_Font font, const HB_UChar16 *string, hb_uint32 length)
895569331642446be05292e3e1f8a51218827168cdclaireho{
905569331642446be05292e3e1f8a51218827168cdclaireho    FT_Face face = (FT_Face)font->userData;
915569331642446be05292e3e1f8a51218827168cdclaireho
925569331642446be05292e3e1f8a51218827168cdclaireho    for (hb_uint32 i = 0; i < length; ++i)
935569331642446be05292e3e1f8a51218827168cdclaireho        if (!FT_Get_Char_Index(face, getChar(string, length, i)))
945569331642446be05292e3e1f8a51218827168cdclaireho            return false;
955569331642446be05292e3e1f8a51218827168cdclaireho
965569331642446be05292e3e1f8a51218827168cdclaireho    return true;
975569331642446be05292e3e1f8a51218827168cdclaireho}
985569331642446be05292e3e1f8a51218827168cdclaireho
995569331642446be05292e3e1f8a51218827168cdclairehostatic HB_Error hb_getSFntTable(void *font, HB_Tag tableTag, HB_Byte *buffer, HB_UInt *length)
1005569331642446be05292e3e1f8a51218827168cdclaireho{
1015569331642446be05292e3e1f8a51218827168cdclaireho    FT_Face face = (FT_Face)font;
1025569331642446be05292e3e1f8a51218827168cdclaireho    FT_ULong ftlen = *length;
1035569331642446be05292e3e1f8a51218827168cdclaireho    FT_Error error = 0;
1045569331642446be05292e3e1f8a51218827168cdclaireho
1055569331642446be05292e3e1f8a51218827168cdclaireho    if (!FT_IS_SFNT(face))
1065569331642446be05292e3e1f8a51218827168cdclaireho        return HB_Err_Invalid_Argument;
1075569331642446be05292e3e1f8a51218827168cdclaireho
1085569331642446be05292e3e1f8a51218827168cdclaireho    error = FT_Load_Sfnt_Table(face, tableTag, 0, buffer, &ftlen);
1095569331642446be05292e3e1f8a51218827168cdclaireho    *length = ftlen;
1105569331642446be05292e3e1f8a51218827168cdclaireho    return (HB_Error)error;
1115569331642446be05292e3e1f8a51218827168cdclaireho}
1125569331642446be05292e3e1f8a51218827168cdclaireho
1135569331642446be05292e3e1f8a51218827168cdclairehoHB_Error hb_getPointInOutline(HB_Font font, HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
1145569331642446be05292e3e1f8a51218827168cdclaireho{
1155569331642446be05292e3e1f8a51218827168cdclaireho    HB_Error error = HB_Err_Ok;
1165569331642446be05292e3e1f8a51218827168cdclaireho    FT_Face face = (FT_Face)font->userData;
1175569331642446be05292e3e1f8a51218827168cdclaireho
1185569331642446be05292e3e1f8a51218827168cdclaireho    int load_flags = (flags & HB_ShaperFlag_UseDesignMetrics) ? FT_LOAD_NO_HINTING : FT_LOAD_DEFAULT;
1195569331642446be05292e3e1f8a51218827168cdclaireho
1205569331642446be05292e3e1f8a51218827168cdclaireho    if ((error = (HB_Error)FT_Load_Glyph(face, glyph, load_flags)))
1215569331642446be05292e3e1f8a51218827168cdclaireho        return error;
1225569331642446be05292e3e1f8a51218827168cdclaireho
1235569331642446be05292e3e1f8a51218827168cdclaireho    if (face->glyph->format != ft_glyph_format_outline)
1245569331642446be05292e3e1f8a51218827168cdclaireho        return (HB_Error)HB_Err_Invalid_SubTable;
1255569331642446be05292e3e1f8a51218827168cdclaireho
1265569331642446be05292e3e1f8a51218827168cdclaireho    *nPoints = face->glyph->outline.n_points;
1275569331642446be05292e3e1f8a51218827168cdclaireho    if (!(*nPoints))
1285569331642446be05292e3e1f8a51218827168cdclaireho        return HB_Err_Ok;
1295569331642446be05292e3e1f8a51218827168cdclaireho
1305569331642446be05292e3e1f8a51218827168cdclaireho    if (point > *nPoints)
1315569331642446be05292e3e1f8a51218827168cdclaireho        return (HB_Error)HB_Err_Invalid_SubTable;
1325569331642446be05292e3e1f8a51218827168cdclaireho
1335569331642446be05292e3e1f8a51218827168cdclaireho    *xpos = face->glyph->outline.points[point].x;
1345569331642446be05292e3e1f8a51218827168cdclaireho    *ypos = face->glyph->outline.points[point].y;
1355569331642446be05292e3e1f8a51218827168cdclaireho
1365569331642446be05292e3e1f8a51218827168cdclaireho    return HB_Err_Ok;
1375569331642446be05292e3e1f8a51218827168cdclaireho}
1385569331642446be05292e3e1f8a51218827168cdclaireho
1395569331642446be05292e3e1f8a51218827168cdclairehovoid hb_getGlyphMetrics(HB_Font font, HB_Glyph glyph, HB_GlyphMetrics *metrics)
1405569331642446be05292e3e1f8a51218827168cdclaireho{
1415569331642446be05292e3e1f8a51218827168cdclaireho    // ###
1425569331642446be05292e3e1f8a51218827168cdclaireho    metrics->x = metrics->y = metrics->width = metrics->height = metrics->xOffset = metrics->yOffset = 0;
1435569331642446be05292e3e1f8a51218827168cdclaireho}
1445569331642446be05292e3e1f8a51218827168cdclaireho
1455569331642446be05292e3e1f8a51218827168cdclairehoHB_Fixed hb_getFontMetric(HB_Font font, HB_FontMetric metric)
1465569331642446be05292e3e1f8a51218827168cdclaireho{
1475569331642446be05292e3e1f8a51218827168cdclaireho    return 0; // ####
1485569331642446be05292e3e1f8a51218827168cdclaireho}
1495569331642446be05292e3e1f8a51218827168cdclaireho
1505569331642446be05292e3e1f8a51218827168cdclairehoconst HB_FontClass hb_fontClass = {
1515569331642446be05292e3e1f8a51218827168cdclaireho    hb_stringToGlyphs, hb_getAdvances, hb_canRender,
1525569331642446be05292e3e1f8a51218827168cdclaireho    hb_getPointInOutline, hb_getGlyphMetrics, hb_getFontMetric
1535569331642446be05292e3e1f8a51218827168cdclaireho};
1545569331642446be05292e3e1f8a51218827168cdclaireho
1555569331642446be05292e3e1f8a51218827168cdclaireho
1565569331642446be05292e3e1f8a51218827168cdclaireho//TESTED_CLASS=
1575569331642446be05292e3e1f8a51218827168cdclaireho//TESTED_FILES= gui/text/qscriptengine.cpp
1585569331642446be05292e3e1f8a51218827168cdclaireho
1595569331642446be05292e3e1f8a51218827168cdclairehoclass tst_QScriptEngine : public QObject
1605569331642446be05292e3e1f8a51218827168cdclaireho{
1615569331642446be05292e3e1f8a51218827168cdclairehoQ_OBJECT
1625569331642446be05292e3e1f8a51218827168cdclaireho
1635569331642446be05292e3e1f8a51218827168cdclairehopublic:
1645569331642446be05292e3e1f8a51218827168cdclaireho    tst_QScriptEngine();
1655569331642446be05292e3e1f8a51218827168cdclaireho    virtual ~tst_QScriptEngine();
1665569331642446be05292e3e1f8a51218827168cdclaireho
1675569331642446be05292e3e1f8a51218827168cdclaireho
1685569331642446be05292e3e1f8a51218827168cdclairehopublic slots:
1695569331642446be05292e3e1f8a51218827168cdclaireho    void initTestCase();
1705569331642446be05292e3e1f8a51218827168cdclaireho    void cleanupTestCase();
1715569331642446be05292e3e1f8a51218827168cdclairehoprivate slots:
1725569331642446be05292e3e1f8a51218827168cdclaireho    void devanagari();
1735569331642446be05292e3e1f8a51218827168cdclaireho    void bengali();
1745569331642446be05292e3e1f8a51218827168cdclaireho    void gurmukhi();
1755569331642446be05292e3e1f8a51218827168cdclaireho    // gujarati missing
1765569331642446be05292e3e1f8a51218827168cdclaireho    void oriya();
1775569331642446be05292e3e1f8a51218827168cdclaireho    void tamil();
1785569331642446be05292e3e1f8a51218827168cdclaireho    void telugu();
1795569331642446be05292e3e1f8a51218827168cdclaireho    void kannada();
1805569331642446be05292e3e1f8a51218827168cdclaireho    void malayalam();
1815569331642446be05292e3e1f8a51218827168cdclaireho    // sinhala missing
1825569331642446be05292e3e1f8a51218827168cdclaireho
1835569331642446be05292e3e1f8a51218827168cdclaireho    void khmer();
1845569331642446be05292e3e1f8a51218827168cdclaireho    void linearB();
1855569331642446be05292e3e1f8a51218827168cdclaireho};
1865569331642446be05292e3e1f8a51218827168cdclaireho
1875569331642446be05292e3e1f8a51218827168cdclairehotst_QScriptEngine::tst_QScriptEngine()
1885569331642446be05292e3e1f8a51218827168cdclaireho{
1895569331642446be05292e3e1f8a51218827168cdclaireho}
1905569331642446be05292e3e1f8a51218827168cdclaireho
1915569331642446be05292e3e1f8a51218827168cdclairehotst_QScriptEngine::~tst_QScriptEngine()
1925569331642446be05292e3e1f8a51218827168cdclaireho{
1935569331642446be05292e3e1f8a51218827168cdclaireho}
1945569331642446be05292e3e1f8a51218827168cdclaireho
1955569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::initTestCase()
1965569331642446be05292e3e1f8a51218827168cdclaireho{
1975569331642446be05292e3e1f8a51218827168cdclaireho    FT_Init_FreeType(&freetype);
1985569331642446be05292e3e1f8a51218827168cdclaireho}
1995569331642446be05292e3e1f8a51218827168cdclaireho
2005569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::cleanupTestCase()
2015569331642446be05292e3e1f8a51218827168cdclaireho{
2025569331642446be05292e3e1f8a51218827168cdclaireho    FT_Done_FreeType(freetype);
2035569331642446be05292e3e1f8a51218827168cdclaireho}
2045569331642446be05292e3e1f8a51218827168cdclaireho
2055569331642446be05292e3e1f8a51218827168cdclairehostruct ShapeTable {
2065569331642446be05292e3e1f8a51218827168cdclaireho    unsigned short unicode[16];
2075569331642446be05292e3e1f8a51218827168cdclaireho    unsigned short glyphs[16];
2085569331642446be05292e3e1f8a51218827168cdclaireho};
2095569331642446be05292e3e1f8a51218827168cdclaireho
2105569331642446be05292e3e1f8a51218827168cdclairehostatic bool shaping(FT_Face face, const ShapeTable *s, HB_Script script)
2115569331642446be05292e3e1f8a51218827168cdclaireho{
2125569331642446be05292e3e1f8a51218827168cdclaireho    QString str = QString::fromUtf16( s->unicode );
2135569331642446be05292e3e1f8a51218827168cdclaireho
2145569331642446be05292e3e1f8a51218827168cdclaireho    HB_Face hbFace = HB_NewFace(face, hb_getSFntTable);
2155569331642446be05292e3e1f8a51218827168cdclaireho
2165569331642446be05292e3e1f8a51218827168cdclaireho    HB_FontRec hbFont;
2175569331642446be05292e3e1f8a51218827168cdclaireho    hbFont.klass = &hb_fontClass;
2185569331642446be05292e3e1f8a51218827168cdclaireho    hbFont.userData = face;
2195569331642446be05292e3e1f8a51218827168cdclaireho    hbFont.x_ppem  = face->size->metrics.x_ppem;
2205569331642446be05292e3e1f8a51218827168cdclaireho    hbFont.y_ppem  = face->size->metrics.y_ppem;
2215569331642446be05292e3e1f8a51218827168cdclaireho    hbFont.x_scale = face->size->metrics.x_scale;
2225569331642446be05292e3e1f8a51218827168cdclaireho    hbFont.y_scale = face->size->metrics.y_scale;
2235569331642446be05292e3e1f8a51218827168cdclaireho
2245569331642446be05292e3e1f8a51218827168cdclaireho    HB_ShaperItem shaper_item;
2255569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.kerning_applied = false;
2265569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.string = reinterpret_cast<const HB_UChar16 *>(str.constData());
2275569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.stringLength = str.length();
2285569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.item.script = script;
2295569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.item.pos = 0;
2305569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.item.length = shaper_item.stringLength;
2315569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.item.bidiLevel = 0; // ###
2325569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.shaperFlags = 0;
2335569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.font = &hbFont;
2345569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.face = hbFace;
2355569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.num_glyphs = shaper_item.item.length;
2365569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.glyphIndicesPresent = false;
2375569331642446be05292e3e1f8a51218827168cdclaireho    shaper_item.initialGlyphCount = 0;
2385569331642446be05292e3e1f8a51218827168cdclaireho
2395569331642446be05292e3e1f8a51218827168cdclaireho    QVarLengthArray<HB_Glyph> hb_glyphs(shaper_item.num_glyphs);
2405569331642446be05292e3e1f8a51218827168cdclaireho    QVarLengthArray<HB_GlyphAttributes> hb_attributes(shaper_item.num_glyphs);
2415569331642446be05292e3e1f8a51218827168cdclaireho    QVarLengthArray<HB_Fixed> hb_advances(shaper_item.num_glyphs);
2425569331642446be05292e3e1f8a51218827168cdclaireho    QVarLengthArray<HB_FixedPoint> hb_offsets(shaper_item.num_glyphs);
2435569331642446be05292e3e1f8a51218827168cdclaireho    QVarLengthArray<unsigned short> hb_logClusters(shaper_item.num_glyphs);
2445569331642446be05292e3e1f8a51218827168cdclaireho
2455569331642446be05292e3e1f8a51218827168cdclaireho    while (1) {
2465569331642446be05292e3e1f8a51218827168cdclaireho        hb_glyphs.resize(shaper_item.num_glyphs);
2475569331642446be05292e3e1f8a51218827168cdclaireho        hb_attributes.resize(shaper_item.num_glyphs);
2485569331642446be05292e3e1f8a51218827168cdclaireho        hb_advances.resize(shaper_item.num_glyphs);
2495569331642446be05292e3e1f8a51218827168cdclaireho        hb_offsets.resize(shaper_item.num_glyphs);
2505569331642446be05292e3e1f8a51218827168cdclaireho        hb_logClusters.resize(shaper_item.num_glyphs);
2515569331642446be05292e3e1f8a51218827168cdclaireho
2525569331642446be05292e3e1f8a51218827168cdclaireho        memset(hb_glyphs.data(), 0, hb_glyphs.size() * sizeof(HB_Glyph));
2535569331642446be05292e3e1f8a51218827168cdclaireho        memset(hb_attributes.data(), 0, hb_attributes.size() * sizeof(HB_GlyphAttributes));
2545569331642446be05292e3e1f8a51218827168cdclaireho        memset(hb_advances.data(), 0, hb_advances.size() * sizeof(HB_Fixed));
2555569331642446be05292e3e1f8a51218827168cdclaireho        memset(hb_offsets.data(), 0, hb_offsets.size() * sizeof(HB_FixedPoint));
2565569331642446be05292e3e1f8a51218827168cdclaireho
2575569331642446be05292e3e1f8a51218827168cdclaireho        shaper_item.glyphs = hb_glyphs.data();
2585569331642446be05292e3e1f8a51218827168cdclaireho        shaper_item.attributes = hb_attributes.data();
2595569331642446be05292e3e1f8a51218827168cdclaireho        shaper_item.advances = hb_advances.data();
2605569331642446be05292e3e1f8a51218827168cdclaireho        shaper_item.offsets = hb_offsets.data();
2615569331642446be05292e3e1f8a51218827168cdclaireho        shaper_item.log_clusters = hb_logClusters.data();
2625569331642446be05292e3e1f8a51218827168cdclaireho
2635569331642446be05292e3e1f8a51218827168cdclaireho        if (HB_ShapeItem(&shaper_item))
2645569331642446be05292e3e1f8a51218827168cdclaireho            break;
2655569331642446be05292e3e1f8a51218827168cdclaireho
2665569331642446be05292e3e1f8a51218827168cdclaireho    }
2675569331642446be05292e3e1f8a51218827168cdclaireho
2685569331642446be05292e3e1f8a51218827168cdclaireho    HB_FreeFace(hbFace);
2695569331642446be05292e3e1f8a51218827168cdclaireho
2705569331642446be05292e3e1f8a51218827168cdclaireho    hb_uint32 nglyphs = 0;
2715569331642446be05292e3e1f8a51218827168cdclaireho    const unsigned short *g = s->glyphs;
2725569331642446be05292e3e1f8a51218827168cdclaireho    while ( *g ) {
2735569331642446be05292e3e1f8a51218827168cdclaireho	nglyphs++;
2745569331642446be05292e3e1f8a51218827168cdclaireho	g++;
2755569331642446be05292e3e1f8a51218827168cdclaireho    }
2765569331642446be05292e3e1f8a51218827168cdclaireho
2775569331642446be05292e3e1f8a51218827168cdclaireho    if( nglyphs != shaper_item.num_glyphs )
2785569331642446be05292e3e1f8a51218827168cdclaireho	goto error;
2795569331642446be05292e3e1f8a51218827168cdclaireho
2805569331642446be05292e3e1f8a51218827168cdclaireho    for (hb_uint32 i = 0; i < nglyphs; ++i) {
2815569331642446be05292e3e1f8a51218827168cdclaireho	if ((shaper_item.glyphs[i]&0xffffff) != s->glyphs[i])
2825569331642446be05292e3e1f8a51218827168cdclaireho	    goto error;
2835569331642446be05292e3e1f8a51218827168cdclaireho    }
2845569331642446be05292e3e1f8a51218827168cdclaireho    return true;
2855569331642446be05292e3e1f8a51218827168cdclaireho error:
2865569331642446be05292e3e1f8a51218827168cdclaireho    str = "";
2875569331642446be05292e3e1f8a51218827168cdclaireho    const unsigned short *uc = s->unicode;
2885569331642446be05292e3e1f8a51218827168cdclaireho    while (*uc) {
2895569331642446be05292e3e1f8a51218827168cdclaireho	str += QString("%1 ").arg(*uc, 4, 16);
2905569331642446be05292e3e1f8a51218827168cdclaireho	++uc;
2915569331642446be05292e3e1f8a51218827168cdclaireho    }
2925569331642446be05292e3e1f8a51218827168cdclaireho    qDebug("%s: shaping of string %s failed, nglyphs=%d, expected %d",
2935569331642446be05292e3e1f8a51218827168cdclaireho           face->family_name,
2945569331642446be05292e3e1f8a51218827168cdclaireho           str.toLatin1().constData(),
2955569331642446be05292e3e1f8a51218827168cdclaireho           shaper_item.num_glyphs, nglyphs);
2965569331642446be05292e3e1f8a51218827168cdclaireho
2975569331642446be05292e3e1f8a51218827168cdclaireho    str = "";
2985569331642446be05292e3e1f8a51218827168cdclaireho    hb_uint32 i = 0;
2995569331642446be05292e3e1f8a51218827168cdclaireho    while (i < shaper_item.num_glyphs) {
3005569331642446be05292e3e1f8a51218827168cdclaireho	str += QString("%1 ").arg(shaper_item.glyphs[i], 4, 16);
3015569331642446be05292e3e1f8a51218827168cdclaireho	++i;
3025569331642446be05292e3e1f8a51218827168cdclaireho    }
3035569331642446be05292e3e1f8a51218827168cdclaireho    qDebug("    glyph result = %s", str.toLatin1().constData());
3045569331642446be05292e3e1f8a51218827168cdclaireho    return false;
3055569331642446be05292e3e1f8a51218827168cdclaireho}
3065569331642446be05292e3e1f8a51218827168cdclaireho
3075569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::devanagari()
3085569331642446be05292e3e1f8a51218827168cdclaireho{
3095569331642446be05292e3e1f8a51218827168cdclaireho    {
3105569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("raghu.ttf");
3115569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
3125569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
3135569331642446be05292e3e1f8a51218827168cdclaireho		// Ka
3145569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x0 },
3155569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0080, 0x0 } },
3165569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant
3175569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x094d, 0x0 },
3185569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0080, 0x0051, 0x0 } },
3195569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ka
3205569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x094d, 0x0915, 0x0 },
3215569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00c8, 0x0080, 0x0 } },
3225569331642446be05292e3e1f8a51218827168cdclaireho		// Ka MatraI
3235569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x093f, 0x0 },
3245569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01d1, 0x0080, 0x0 } },
3255569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka
3265569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0930, 0x094d, 0x0915, 0x0 },
3275569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0080, 0x005b, 0x0 } },
3285569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka MatraI
3295569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0930, 0x094d, 0x0915, 0x093f, 0x0 },
3305569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01d1, 0x0080, 0x005b, 0x0 } },
3315569331642446be05292e3e1f8a51218827168cdclaireho		// MatraI
3325569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x093f, 0x0 },
3335569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01d4, 0x029c, 0x0 } },
3345569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Nukta
3355569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x093c, 0x0 },
3365569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00a4, 0x0 } },
3375569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ra
3385569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x094d, 0x0930, 0x0 },
3395569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0110, 0x0 } },
3405569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ra Halant Ka
3415569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x094d, 0x0930, 0x094d, 0x0915, 0x0 },
3425569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0158, 0x0080, 0x0 } },
3435569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0930, 0x094d, 0x200d, 0x0 },
3445569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00e2, 0x0 } },
3455569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x094d, 0x0930, 0x094d, 0x200d, 0x0 },
3465569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0158, 0x0 } },
3475569331642446be05292e3e1f8a51218827168cdclaireho
3485569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
3495569331642446be05292e3e1f8a51218827168cdclaireho	    };
3505569331642446be05292e3e1f8a51218827168cdclaireho
3515569331642446be05292e3e1f8a51218827168cdclaireho
3525569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
3535569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
3545569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Devanagari) );
3555569331642446be05292e3e1f8a51218827168cdclaireho		++s;
3565569331642446be05292e3e1f8a51218827168cdclaireho	    }
3575569331642446be05292e3e1f8a51218827168cdclaireho
3585569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
3595569331642446be05292e3e1f8a51218827168cdclaireho	} else {
3605569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find raghu.ttf", SkipAll);
3615569331642446be05292e3e1f8a51218827168cdclaireho	}
3625569331642446be05292e3e1f8a51218827168cdclaireho    }
3635569331642446be05292e3e1f8a51218827168cdclaireho
3645569331642446be05292e3e1f8a51218827168cdclaireho    {
3655569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("mangal.ttf");
3665569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
3675569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
3685569331642446be05292e3e1f8a51218827168cdclaireho		// Ka
3695569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x0 },
3705569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0080, 0x0 } },
3715569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant
3725569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x094d, 0x0 },
3735569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0080, 0x0051, 0x0 } },
3745569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ka
3755569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x094d, 0x0915, 0x0 },
3765569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00c8, 0x0080, 0x0 } },
3775569331642446be05292e3e1f8a51218827168cdclaireho		// Ka MatraI
3785569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x093f, 0x0 },
3795569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01d1, 0x0080, 0x0 } },
3805569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka
3815569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0930, 0x094d, 0x0915, 0x0 },
3825569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0080, 0x005b, 0x0 } },
3835569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka MatraI
3845569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0930, 0x094d, 0x0915, 0x093f, 0x0 },
3855569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01d1, 0x0080, 0x005b, 0x0 } },
3865569331642446be05292e3e1f8a51218827168cdclaireho		// MatraI
3875569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x093f, 0x0 },
3885569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01d4, 0x029c, 0x0 } },
3895569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Nukta
3905569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x093c, 0x0 },
3915569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00a4, 0x0 } },
3925569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ra
3935569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x094d, 0x0930, 0x0 },
3945569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0110, 0x0 } },
3955569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ra Halant Ka
3965569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0915, 0x094d, 0x0930, 0x094d, 0x0915, 0x0 },
3975569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0158, 0x0080, 0x0 } },
3985569331642446be05292e3e1f8a51218827168cdclaireho
3995569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x92b, 0x94d, 0x930, 0x0 },
4005569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x125, 0x0 } },
4015569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x92b, 0x93c, 0x94d, 0x930, 0x0 },
4025569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x149, 0x0 } },
4035569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
4045569331642446be05292e3e1f8a51218827168cdclaireho	    };
4055569331642446be05292e3e1f8a51218827168cdclaireho
4065569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
4075569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
4085569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Devanagari) );
4095569331642446be05292e3e1f8a51218827168cdclaireho		++s;
4105569331642446be05292e3e1f8a51218827168cdclaireho	    }
4115569331642446be05292e3e1f8a51218827168cdclaireho
4125569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
4135569331642446be05292e3e1f8a51218827168cdclaireho	} else {
4145569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couldn't find mangal.ttf", SkipAll);
4155569331642446be05292e3e1f8a51218827168cdclaireho	}
4165569331642446be05292e3e1f8a51218827168cdclaireho    }
4175569331642446be05292e3e1f8a51218827168cdclaireho}
4185569331642446be05292e3e1f8a51218827168cdclaireho
4195569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::bengali()
4205569331642446be05292e3e1f8a51218827168cdclaireho{
4215569331642446be05292e3e1f8a51218827168cdclaireho    {
4225569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("AkaashNormal.ttf");
4235569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
4245569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
4255569331642446be05292e3e1f8a51218827168cdclaireho		// Ka
4265569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x0 },
4275569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0151, 0x0 } },
4285569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant
4295569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09cd, 0x0 },
4305569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0151, 0x017d, 0x0 } },
4315569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ka
4325569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09cd, 0x0995, 0x0 },
4335569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x019b, 0x0 } },
4345569331642446be05292e3e1f8a51218827168cdclaireho		// Ka MatraI
4355569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09bf, 0x0 },
4365569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0173, 0x0151, 0x0 } },
4375569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka
4385569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b0, 0x09cd, 0x0995, 0x0 },
4395569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0151, 0x0276, 0x0 } },
4405569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka MatraI
4415569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b0, 0x09cd, 0x0995, 0x09bf, 0x0 },
4425569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0173, 0x0151, 0x0276, 0x0 } },
4435569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Nukta
4445569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09bc, 0x0 },
4455569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0151, 0x0171, 0x0 } },
4465569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ra
4475569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09cd, 0x09b0, 0x0 },
4485569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01f4, 0x0 } },
4495569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ra Halant Ka
4505569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09cd, 0x09b0, 0x09cd, 0x0995, 0x0 },
4515569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x025c, 0x0276, 0x0151, 0x0 } },
4525569331642446be05292e3e1f8a51218827168cdclaireho		// Ya + Halant
4535569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09af, 0x09cd, 0x0 },
4545569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x016a, 0x017d, 0x0 } },
4555569331642446be05292e3e1f8a51218827168cdclaireho		// Da Halant Ya -> Da Ya-Phala
4565569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a6, 0x09cd, 0x09af, 0x0 },
4575569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01e5, 0x0 } },
4585569331642446be05292e3e1f8a51218827168cdclaireho		// A Halant Ya -> A Ya-phala
4595569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0985, 0x09cd, 0x09af, 0x0 },
4605569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0145, 0x01cf, 0x0 } },
4615569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant Ka
4625569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x0995, 0x0 },
4635569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x026f, 0x0151, 0x0 } },
4645569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWNJ Ka
4655569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200c, 0x0995, 0x0 },
4665569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0164, 0x017d, 0x0151, 0x0 } },
4675569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWJ Ka
4685569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200d, 0x0995, 0x0 },
4695569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x026f, 0x0151, 0x0 } },
4705569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant ZWNJ Ka
4715569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09cd, 0x200c, 0x0995, 0x0 },
4725569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0151, 0x017d, 0x0151, 0x0 } },
4735569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant ZWJ Ka
4745569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09cd, 0x200d, 0x0995, 0x0 },
4755569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x025c, 0x0151, 0x0 } },
4765569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant Ra
4775569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x09b0, 0x0 },
4785569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0207, 0x0 } },
4795569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWNJ Ra
4805569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200c, 0x09b0, 0x0 },
4815569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0164, 0x017d, 0x016b, 0x0 } },
4825569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWJ Ra
4835569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200d, 0x09b0, 0x0 },
4845569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x026f, 0x016b, 0x0 } },
4855569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant Ba
4865569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x09ac, 0x0 },
4875569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x022f, 0x0 } },
4885569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWNJ Ba
4895569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200c, 0x09ac, 0x0 },
4905569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0164, 0x017d, 0x0167, 0x0 } },
4915569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWJ Ba
4925569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200d, 0x09ac, 0x0 },
4935569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x026f, 0x0167, 0x0 } },
4945569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant Dha
4955569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x09a7, 0x0 },
4965569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01d3, 0x0 } },
4975569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWNJ Dha
4985569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200c, 0x09a7, 0x0 },
4995569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0164, 0x017d, 0x0163, 0x0 } },
5005569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWJ Dha
5015569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200d, 0x09a7, 0x0 },
5025569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x026f, 0x0163, 0x0 } },
5035569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka MatraAU
5045569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b0, 0x09cd, 0x0995, 0x09cc, 0x0 },
5055569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0179, 0x0151, 0x0276, 0x017e, 0x0 } },
5065569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ba Halant Ba
5075569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b0, 0x09cd, 0x09ac, 0x09cd, 0x09ac, 0x0 },
5085569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0232, 0x0276, 0x0 } },
5095569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x982, 0x0 },
5105569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x151, 0x276, 0x172, 0x143, 0x0 } },
5115569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 },
5125569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x151, 0x276, 0x172, 0x144, 0x0 } },
5135569331642446be05292e3e1f8a51218827168cdclaireho
5145569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
5155569331642446be05292e3e1f8a51218827168cdclaireho	    };
5165569331642446be05292e3e1f8a51218827168cdclaireho
5175569331642446be05292e3e1f8a51218827168cdclaireho
5185569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
5195569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
5205569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Bengali) );
5215569331642446be05292e3e1f8a51218827168cdclaireho		++s;
5225569331642446be05292e3e1f8a51218827168cdclaireho	    }
5235569331642446be05292e3e1f8a51218827168cdclaireho
5245569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
5255569331642446be05292e3e1f8a51218827168cdclaireho	} else {
5265569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find AkaashNormal.ttf", SkipAll);
5275569331642446be05292e3e1f8a51218827168cdclaireho	}
5285569331642446be05292e3e1f8a51218827168cdclaireho    }
5295569331642446be05292e3e1f8a51218827168cdclaireho    {
5305569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("MuktiNarrow.ttf");
5315569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
5325569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
5335569331642446be05292e3e1f8a51218827168cdclaireho		// Ka
5345569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x0 },
5355569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0073, 0x0 } },
5365569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant
5375569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09cd, 0x0 },
5385569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00b9, 0x0 } },
5395569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ka
5405569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09cd, 0x0995, 0x0 },
5415569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0109, 0x0 } },
5425569331642446be05292e3e1f8a51218827168cdclaireho		// Ka MatraI
5435569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09bf, 0x0 },
5445569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0095, 0x0073, 0x0 } },
5455569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka
5465569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b0, 0x09cd, 0x0995, 0x0 },
5475569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0073, 0x00e1, 0x0 } },
5485569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka MatraI
5495569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b0, 0x09cd, 0x0995, 0x09bf, 0x0 },
5505569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0095, 0x0073, 0x00e1, 0x0 } },
5515569331642446be05292e3e1f8a51218827168cdclaireho		// MatraI
5525569331642446be05292e3e1f8a51218827168cdclaireho 		{ { 0x09bf, 0x0 },
5535569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0095, 0x01c8, 0x0 } },
5545569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Nukta
5555569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09bc, 0x0 },
5565569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0073, 0x0093, 0x0 } },
5575569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ra
5585569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0995, 0x09cd, 0x09b0, 0x0 },
5595569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00e5, 0x0 } },
5605569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant Ra Halant Ka
5615569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x995, 0x9cd, 0x9b0, 0x9cd, 0x995, 0x0 },
5625569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x234, 0x24e, 0x73, 0x0 } },
5635569331642446be05292e3e1f8a51218827168cdclaireho		// Ya + Halant
5645569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09af, 0x09cd, 0x0 },
5655569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00d2, 0x0 } },
5665569331642446be05292e3e1f8a51218827168cdclaireho		// Da Halant Ya -> Da Ya-Phala
5675569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a6, 0x09cd, 0x09af, 0x0 },
5685569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0084, 0x00e2, 0x0 } },
5695569331642446be05292e3e1f8a51218827168cdclaireho		// A Halant Ya -> A Ya-phala
5705569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0985, 0x09cd, 0x09af, 0x0 },
5715569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0067, 0x00e2, 0x0 } },
5725569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant Ka
5735569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x0995, 0x0 },
5745569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0188, 0x0 } },
5755569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWNJ Ka
5765569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9a8, 0x9cd, 0x200c, 0x995, 0x0 },
5775569331642446be05292e3e1f8a51218827168cdclaireho                  { 0xcc, 0x73, 0x0 } },
5785569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWJ Ka
5795569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9a8, 0x9cd, 0x200d, 0x995, 0x0 },
5805569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x247, 0x73, 0x0 } },
5815569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant ZWNJ Ka
5825569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9a8, 0x9cd, 0x200d, 0x995, 0x0 },
5835569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x247, 0x73, 0x0 } },
5845569331642446be05292e3e1f8a51218827168cdclaireho		// Ka Halant ZWJ Ka
5855569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9a8, 0x9cd, 0x200d, 0x995, 0x0 },
5865569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x247, 0x73, 0x0 } },
5875569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant Ra
5885569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x09b0, 0x0 },
5895569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00f8, 0x0 } },
5905569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWNJ Ra
5915569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200c, 0x09b0, 0x0 },
5925569331642446be05292e3e1f8a51218827168cdclaireho		  { 0xcc, 0x8d, 0x0 } },
5935569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWJ Ra
5945569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9a8, 0x9cd, 0x200d, 0x9b0, 0x0 },
5955569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x247, 0x8d, 0x0 } },
5965569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant Ba
5975569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x09ac, 0x0 },
5985569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0139, 0x0 } },
5995569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWNJ Ba
6005569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9a8, 0x9cd, 0x200c, 0x9ac, 0x0 },
6015569331642446be05292e3e1f8a51218827168cdclaireho                  { 0xcc, 0x89, 0x0 } },
6025569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWJ Ba
6035569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9a8, 0x9cd, 0x200d, 0x9ac, 0x0 },
6045569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x247, 0x89, 0x0 } },
6055569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant Dha
6065569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x09a7, 0x0 },
6075569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0145, 0x0 } },
6085569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWNJ Dha
6095569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200c, 0x09a7, 0x0 },
6105569331642446be05292e3e1f8a51218827168cdclaireho		  { 0xcc, 0x85, 0x0 } },
6115569331642446be05292e3e1f8a51218827168cdclaireho		// Na Halant ZWJ Dha
6125569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x200d, 0x09a7, 0x0 },
6135569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x247, 0x85, 0x0 } },
6145569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ka MatraAU
6155569331642446be05292e3e1f8a51218827168cdclaireho                { { 0x9b0, 0x9cd, 0x995, 0x9cc, 0x0 },
6165569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x232, 0x73, 0xe1, 0xa0, 0x0 } },
6175569331642446be05292e3e1f8a51218827168cdclaireho		// Ra Halant Ba Halant Ba
6185569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b0, 0x09cd, 0x09ac, 0x09cd, 0x09ac, 0x0 },
6195569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x013b, 0x00e1, 0x0 } },
6205569331642446be05292e3e1f8a51218827168cdclaireho
6215569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
6225569331642446be05292e3e1f8a51218827168cdclaireho	    };
6235569331642446be05292e3e1f8a51218827168cdclaireho
6245569331642446be05292e3e1f8a51218827168cdclaireho
6255569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
6265569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
6275569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Bengali) );
6285569331642446be05292e3e1f8a51218827168cdclaireho		++s;
6295569331642446be05292e3e1f8a51218827168cdclaireho	    }
6305569331642446be05292e3e1f8a51218827168cdclaireho
6315569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
6325569331642446be05292e3e1f8a51218827168cdclaireho	} else {
6335569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find MuktiNarrow.ttf", SkipAll);
6345569331642446be05292e3e1f8a51218827168cdclaireho	}
6355569331642446be05292e3e1f8a51218827168cdclaireho    }
6365569331642446be05292e3e1f8a51218827168cdclaireho    {
6375569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("LikhanNormal.ttf");
6385569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
6395569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
6405569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09a8, 0x09cd, 0x09af, 0x0 },
6415569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0192, 0x0 } },
6425569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b8, 0x09cd, 0x09af, 0x0 },
6435569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01d6, 0x0 } },
6445569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b6, 0x09cd, 0x09af, 0x0 },
6455569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01bc, 0x0 } },
6465569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b7, 0x09cd, 0x09af, 0x0 },
6475569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x01c6, 0x0 } },
6485569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 },
6495569331642446be05292e3e1f8a51218827168cdclaireho		  { 0xd3, 0x12f, 0x0 } },
6505569331642446be05292e3e1f8a51218827168cdclaireho
6515569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
6525569331642446be05292e3e1f8a51218827168cdclaireho	    };
6535569331642446be05292e3e1f8a51218827168cdclaireho
6545569331642446be05292e3e1f8a51218827168cdclaireho
6555569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
6565569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
6575569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Bengali) );
6585569331642446be05292e3e1f8a51218827168cdclaireho		++s;
6595569331642446be05292e3e1f8a51218827168cdclaireho	    }
6605569331642446be05292e3e1f8a51218827168cdclaireho
6615569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
6625569331642446be05292e3e1f8a51218827168cdclaireho	} else {
6635569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find LikhanNormal.ttf", SkipAll);
6645569331642446be05292e3e1f8a51218827168cdclaireho	}
6655569331642446be05292e3e1f8a51218827168cdclaireho    }
6665569331642446be05292e3e1f8a51218827168cdclaireho}
6675569331642446be05292e3e1f8a51218827168cdclaireho
6685569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::gurmukhi()
6695569331642446be05292e3e1f8a51218827168cdclaireho{
6705569331642446be05292e3e1f8a51218827168cdclaireho    {
6715569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("lohit.punjabi.1.1.ttf");
6725569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
6735569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
6745569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0xA15, 0xA4D, 0xa39, 0x0 },
6755569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x3b, 0x8b, 0x0 } },
6765569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
6775569331642446be05292e3e1f8a51218827168cdclaireho	    };
6785569331642446be05292e3e1f8a51218827168cdclaireho
6795569331642446be05292e3e1f8a51218827168cdclaireho
6805569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
6815569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
6825569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Gurmukhi) );
6835569331642446be05292e3e1f8a51218827168cdclaireho		++s;
6845569331642446be05292e3e1f8a51218827168cdclaireho	    }
6855569331642446be05292e3e1f8a51218827168cdclaireho
6865569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
6875569331642446be05292e3e1f8a51218827168cdclaireho	} else {
6885569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find lohit.punjabi.1.1.ttf", SkipAll);
6895569331642446be05292e3e1f8a51218827168cdclaireho	}
6905569331642446be05292e3e1f8a51218827168cdclaireho    }
6915569331642446be05292e3e1f8a51218827168cdclaireho}
6925569331642446be05292e3e1f8a51218827168cdclaireho
6935569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::oriya()
6945569331642446be05292e3e1f8a51218827168cdclaireho{
6955569331642446be05292e3e1f8a51218827168cdclaireho    {
6965569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("utkalm.ttf");
6975569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
6985569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
6995569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xb15, 0xb4d, 0xb24, 0xb4d, 0xb30, 0x0 },
7005569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x150, 0x125, 0x0 } },
7015569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xb24, 0xb4d, 0xb24, 0xb4d, 0xb2c, 0x0 },
7025569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x151, 0x120, 0x0 } },
7035569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xb28, 0xb4d, 0xb24, 0xb4d, 0xb2c, 0x0 },
7045569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x152, 0x120, 0x0 } },
7055569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xb28, 0xb4d, 0xb24, 0xb4d, 0xb2c, 0x0 },
7065569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x152, 0x120, 0x0 } },
7075569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xb28, 0xb4d, 0xb24, 0xb4d, 0xb30, 0x0 },
7085569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x176, 0x0 } },
7095569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xb38, 0xb4d, 0xb24, 0xb4d, 0xb30, 0x0 },
7105569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x177, 0x0 } },
7115569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xb28, 0xb4d, 0xb24, 0xb4d, 0xb30, 0xb4d, 0xb2f, 0x0 },
7125569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x176, 0x124, 0x0 } },
7135569331642446be05292e3e1f8a51218827168cdclaireho                { {0}, {0} }
7145569331642446be05292e3e1f8a51218827168cdclaireho
7155569331642446be05292e3e1f8a51218827168cdclaireho            };
7165569331642446be05292e3e1f8a51218827168cdclaireho
7175569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
7185569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
7195569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Oriya) );
7205569331642446be05292e3e1f8a51218827168cdclaireho		++s;
7215569331642446be05292e3e1f8a51218827168cdclaireho	    }
7225569331642446be05292e3e1f8a51218827168cdclaireho
7235569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
7245569331642446be05292e3e1f8a51218827168cdclaireho	} else {
7255569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find utkalm.ttf", SkipAll);
7265569331642446be05292e3e1f8a51218827168cdclaireho	}
7275569331642446be05292e3e1f8a51218827168cdclaireho    }
7285569331642446be05292e3e1f8a51218827168cdclaireho}
7295569331642446be05292e3e1f8a51218827168cdclaireho
7305569331642446be05292e3e1f8a51218827168cdclaireho
7315569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::tamil()
7325569331642446be05292e3e1f8a51218827168cdclaireho{
7335569331642446be05292e3e1f8a51218827168cdclaireho    {
7345569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("akruti1.ttf");
7355569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
7365569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
7375569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b95, 0x0bc2, 0x0 },
7385569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x004e, 0x0 } },
7395569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0bae, 0x0bc2, 0x0 },
7405569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x009e, 0x0 } },
7415569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b9a, 0x0bc2, 0x0 },
7425569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0058, 0x0 } },
7435569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b99, 0x0bc2, 0x0 },
7445569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0053, 0x0 } },
7455569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0bb0, 0x0bc2, 0x0 },
7465569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00a8, 0x0 } },
7475569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0ba4, 0x0bc2, 0x0 },
7485569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x008e, 0x0 } },
7495569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b9f, 0x0bc2, 0x0 },
7505569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0062, 0x0 } },
7515569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b95, 0x0bc6, 0x0 },
7525569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x000a, 0x0031, 0x0 } },
7535569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b95, 0x0bca, 0x0 },
7545569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x000a, 0x0031, 0x0007, 0x0 } },
7555569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b95, 0x0bc6, 0x0bbe, 0x0 },
7565569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x000a, 0x0031, 0x007, 0x0 } },
7575569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b95, 0x0bcd, 0x0bb7, 0x0 },
7585569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0049, 0x0 } },
7595569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b95, 0x0bcd, 0x0bb7, 0x0bca, 0x0 },
7605569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x000a, 0x0049, 0x007, 0x0 } },
7615569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b95, 0x0bcd, 0x0bb7, 0x0bc6, 0x0bbe, 0x0 },
7625569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x000a, 0x0049, 0x007, 0x0 } },
7635569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b9f, 0x0bbf, 0x0 },
7645569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x005f, 0x0 } },
7655569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b9f, 0x0bc0, 0x0 },
7665569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0060, 0x0 } },
7675569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0bb2, 0x0bc0, 0x0 },
7685569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00ab, 0x0 } },
7695569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0bb2, 0x0bbf, 0x0 },
7705569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00aa, 0x0 } },
7715569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0bb0, 0x0bcd, 0x0 },
7725569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00a4, 0x0 } },
7735569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0bb0, 0x0bbf, 0x0 },
7745569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00a5, 0x0 } },
7755569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0bb0, 0x0bc0, 0x0 },
7765569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00a6, 0x0 } },
7775569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b83, 0x0 },
7785569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0025, 0x0 } },
7795569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0b83, 0x0b95, 0x0 },
7805569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0025, 0x0031, 0x0 } },
7815569331642446be05292e3e1f8a51218827168cdclaireho
7825569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
7835569331642446be05292e3e1f8a51218827168cdclaireho	    };
7845569331642446be05292e3e1f8a51218827168cdclaireho
7855569331642446be05292e3e1f8a51218827168cdclaireho
7865569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
7875569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
7885569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Tamil) );
7895569331642446be05292e3e1f8a51218827168cdclaireho		++s;
7905569331642446be05292e3e1f8a51218827168cdclaireho	    }
7915569331642446be05292e3e1f8a51218827168cdclaireho
7925569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
7935569331642446be05292e3e1f8a51218827168cdclaireho	} else {
7945569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find akruti1.ttf", SkipAll);
7955569331642446be05292e3e1f8a51218827168cdclaireho	}
7965569331642446be05292e3e1f8a51218827168cdclaireho    }
7975569331642446be05292e3e1f8a51218827168cdclaireho}
7985569331642446be05292e3e1f8a51218827168cdclaireho
7995569331642446be05292e3e1f8a51218827168cdclaireho
8005569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::telugu()
8015569331642446be05292e3e1f8a51218827168cdclaireho{
8025569331642446be05292e3e1f8a51218827168cdclaireho    {
8035569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("Pothana2000.ttf");
8045569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
8055569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
8065569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0x0 },
8075569331642446be05292e3e1f8a51218827168cdclaireho                  { 0xbb, 0x0 } },
8085569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0xc37, 0x0 },
8095569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x4b, 0x0 } },
8105569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0xc37, 0xc4d, 0x0 },
8115569331642446be05292e3e1f8a51218827168cdclaireho                  { 0xe0, 0x0 } },
8125569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0xc37, 0xc4d, 0xc23, 0x0 },
8135569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x4b, 0x91, 0x0 } },
8145569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0xc30, 0x0 },
8155569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x5a, 0xb2, 0x0 } },
8165569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0xc30, 0xc4d, 0x0 },
8175569331642446be05292e3e1f8a51218827168cdclaireho                  { 0xbb, 0xb2, 0x0 } },
8185569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0xc30, 0xc4d, 0xc15, 0x0 },
8195569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x5a, 0xb2, 0x83, 0x0 } },
8205569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0xc30, 0xc3f, 0x0 },
8215569331642446be05292e3e1f8a51218827168cdclaireho                  { 0xe2, 0xb2, 0x0 } },
8225569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0xc15, 0xc48, 0x0 },
8235569331642446be05292e3e1f8a51218827168cdclaireho                  { 0xe6, 0xb3, 0x83, 0x0 } },
8245569331642446be05292e3e1f8a51218827168cdclaireho                { { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 },
8255569331642446be05292e3e1f8a51218827168cdclaireho                  { 0xe6, 0xb3, 0x9f, 0x0 } },
8265569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
8275569331642446be05292e3e1f8a51218827168cdclaireho
8285569331642446be05292e3e1f8a51218827168cdclaireho            };
8295569331642446be05292e3e1f8a51218827168cdclaireho
8305569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
8315569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
8325569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Telugu) );
8335569331642446be05292e3e1f8a51218827168cdclaireho		++s;
8345569331642446be05292e3e1f8a51218827168cdclaireho	    }
8355569331642446be05292e3e1f8a51218827168cdclaireho
8365569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
8375569331642446be05292e3e1f8a51218827168cdclaireho	} else {
8385569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find Pothana2000.ttf", SkipAll);
8395569331642446be05292e3e1f8a51218827168cdclaireho	}
8405569331642446be05292e3e1f8a51218827168cdclaireho    }
8415569331642446be05292e3e1f8a51218827168cdclaireho}
8425569331642446be05292e3e1f8a51218827168cdclaireho
8435569331642446be05292e3e1f8a51218827168cdclaireho
8445569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::kannada()
8455569331642446be05292e3e1f8a51218827168cdclaireho{
8465569331642446be05292e3e1f8a51218827168cdclaireho    {
8475569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("Sampige.ttf");
8485569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
8495569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
8505569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0ca8, 0x0ccd, 0x0ca8, 0x0 },
8515569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0049, 0x00ba, 0x0 } },
8525569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0ca8, 0x0ccd, 0x0ca1, 0x0 },
8535569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0049, 0x00b3, 0x0 } },
8545569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0caf, 0x0cc2, 0x0 },
8555569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x004f, 0x005d, 0x0 } },
8565569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0ce0, 0x0 },
8575569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x006a, 0x0 } },
8585569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0ce6, 0x0ce7, 0x0ce8, 0x0 },
8595569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x006b, 0x006c, 0x006d, 0x0 } },
8605569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0cb5, 0x0ccb, 0x0 },
8615569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x015f, 0x0067, 0x0 } },
8625569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0cb0, 0x0ccd, 0x0cae, 0x0 },
8635569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x004e, 0x0082, 0x0 } },
8645569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0cb0, 0x0ccd, 0x0c95, 0x0 },
8655569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0036, 0x0082, 0x0 } },
8665569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0c95, 0x0ccd, 0x0cb0, 0x0 },
8675569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0036, 0x00c1, 0x0 } },
8685569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0cb0, 0x0ccd, 0x200d, 0x0c95, 0x0 },
8695569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0050, 0x00a7, 0x0 } },
8705569331642446be05292e3e1f8a51218827168cdclaireho
8715569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
8725569331642446be05292e3e1f8a51218827168cdclaireho	    };
8735569331642446be05292e3e1f8a51218827168cdclaireho
8745569331642446be05292e3e1f8a51218827168cdclaireho
8755569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
8765569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
8775569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Kannada) );
8785569331642446be05292e3e1f8a51218827168cdclaireho		++s;
8795569331642446be05292e3e1f8a51218827168cdclaireho	    }
8805569331642446be05292e3e1f8a51218827168cdclaireho
8815569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
8825569331642446be05292e3e1f8a51218827168cdclaireho	} else {
8835569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find Sampige.ttf", SkipAll);
8845569331642446be05292e3e1f8a51218827168cdclaireho	}
8855569331642446be05292e3e1f8a51218827168cdclaireho    }
8865569331642446be05292e3e1f8a51218827168cdclaireho    {
8875569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("tunga.ttf");
8885569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
8895569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
8905569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0cb7, 0x0cc6, 0x0 },
8915569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x00b0, 0x006c, 0x0 } },
8925569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0cb7, 0x0ccd, 0x0 },
8935569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0163, 0x0 } },
8945569331642446be05292e3e1f8a51218827168cdclaireho
8955569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
8965569331642446be05292e3e1f8a51218827168cdclaireho	    };
8975569331642446be05292e3e1f8a51218827168cdclaireho
8985569331642446be05292e3e1f8a51218827168cdclaireho
8995569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
9005569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
9015569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Kannada) );
9025569331642446be05292e3e1f8a51218827168cdclaireho		++s;
9035569331642446be05292e3e1f8a51218827168cdclaireho	    }
9045569331642446be05292e3e1f8a51218827168cdclaireho
9055569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
9065569331642446be05292e3e1f8a51218827168cdclaireho	} else {
9075569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find tunga.ttf", SkipAll);
9085569331642446be05292e3e1f8a51218827168cdclaireho	}
9095569331642446be05292e3e1f8a51218827168cdclaireho    }
9105569331642446be05292e3e1f8a51218827168cdclaireho}
9115569331642446be05292e3e1f8a51218827168cdclaireho
9125569331642446be05292e3e1f8a51218827168cdclaireho
9135569331642446be05292e3e1f8a51218827168cdclaireho
9145569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::malayalam()
9155569331642446be05292e3e1f8a51218827168cdclaireho{
9165569331642446be05292e3e1f8a51218827168cdclaireho    {
9175569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("AkrutiMal2Normal.ttf");
9185569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
9195569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
9205569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d15, 0x0d46, 0x0 },
9215569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x005e, 0x0034, 0x0 } },
9225569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d15, 0x0d47, 0x0 },
9235569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x005f, 0x0034, 0x0 } },
9245569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d15, 0x0d4b, 0x0 },
9255569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x005f, 0x0034, 0x0058, 0x0 } },
9265569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d15, 0x0d48, 0x0 },
9275569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0060, 0x0034, 0x0 } },
9285569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d15, 0x0d4a, 0x0 },
9295569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x005e, 0x0034, 0x0058, 0x0 } },
9305569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d30, 0x0d4d, 0x0d15, 0x0 },
9315569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x009e, 0x0034, 0x0 } },
9325569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d15, 0x0d4d, 0x0d35, 0x0 },
9335569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0034, 0x007a, 0x0 } },
9345569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d15, 0x0d4d, 0x0d2f, 0x0 },
9355569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0034, 0x00a2, 0x0 } },
9365569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d1f, 0x0d4d, 0x0d1f, 0x0 },
9375569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0069, 0x0 } },
9385569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d26, 0x0d4d, 0x0d26, 0x0 },
9395569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x0074, 0x0 } },
9405569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d30, 0x0d4d, 0x0 },
9415569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x009e, 0x0 } },
9425569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d30, 0x0d4d, 0x200c, 0x0 },
9435569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x009e, 0x0 } },
9445569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x0d30, 0x0d4d, 0x200d, 0x0 },
9455569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x009e, 0x0 } },
9465569331642446be05292e3e1f8a51218827168cdclaireho
9475569331642446be05292e3e1f8a51218827168cdclaireho
9485569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
9495569331642446be05292e3e1f8a51218827168cdclaireho	    };
9505569331642446be05292e3e1f8a51218827168cdclaireho
9515569331642446be05292e3e1f8a51218827168cdclaireho
9525569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
9535569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
9545569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Malayalam) );
9555569331642446be05292e3e1f8a51218827168cdclaireho		++s;
9565569331642446be05292e3e1f8a51218827168cdclaireho	    }
9575569331642446be05292e3e1f8a51218827168cdclaireho
9585569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
9595569331642446be05292e3e1f8a51218827168cdclaireho	} else {
9605569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find AkrutiMal2Normal.ttf", SkipAll);
9615569331642446be05292e3e1f8a51218827168cdclaireho	}
9625569331642446be05292e3e1f8a51218827168cdclaireho    }
9635569331642446be05292e3e1f8a51218827168cdclaireho}
9645569331642446be05292e3e1f8a51218827168cdclaireho
9655569331642446be05292e3e1f8a51218827168cdclaireho
9665569331642446be05292e3e1f8a51218827168cdclaireho
9675569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::khmer()
9685569331642446be05292e3e1f8a51218827168cdclaireho{
9695569331642446be05292e3e1f8a51218827168cdclaireho    {
9705569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("KhmerOS.ttf");
9715569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
9725569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
9735569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x179a, 0x17cd, 0x0 },
9745569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x24c, 0x27f, 0x0 } },
9755569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x179f, 0x17c5, 0x0 },
9765569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x273, 0x203, 0x0 } },
9775569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x1790, 0x17d2, 0x1784, 0x17c3, 0x0 },
9785569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x275, 0x242, 0x182, 0x0 } },
9795569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x179a, 0x0 },
9805569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x24c, 0x0 } },
9815569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x1781, 0x17d2, 0x1798, 0x17c2, 0x0 },
9825569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x274, 0x233, 0x197, 0x0 } },
9835569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x1798, 0x17b6, 0x0 },
9845569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x1cb, 0x0 } },
9855569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x179a, 0x17b8, 0x0 },
9865569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x24c, 0x26a, 0x0 } },
9875569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x1787, 0x17b6, 0x0 },
9885569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x1ba, 0x0 } },
9895569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0x1798, 0x17d2, 0x1796, 0x17bb, 0x0 },
9905569331642446be05292e3e1f8a51218827168cdclaireho		  { 0x24a, 0x195, 0x26d, 0x0 } },
9915569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
9925569331642446be05292e3e1f8a51218827168cdclaireho	    };
9935569331642446be05292e3e1f8a51218827168cdclaireho
9945569331642446be05292e3e1f8a51218827168cdclaireho
9955569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
9965569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
9975569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Khmer) );
9985569331642446be05292e3e1f8a51218827168cdclaireho		++s;
9995569331642446be05292e3e1f8a51218827168cdclaireho	    }
10005569331642446be05292e3e1f8a51218827168cdclaireho
10015569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
10025569331642446be05292e3e1f8a51218827168cdclaireho	} else {
10035569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find KhmerOS.ttf", SkipAll);
10045569331642446be05292e3e1f8a51218827168cdclaireho	}
10055569331642446be05292e3e1f8a51218827168cdclaireho    }
10065569331642446be05292e3e1f8a51218827168cdclaireho}
10075569331642446be05292e3e1f8a51218827168cdclaireho
10085569331642446be05292e3e1f8a51218827168cdclairehovoid tst_QScriptEngine::linearB()
10095569331642446be05292e3e1f8a51218827168cdclaireho{
10105569331642446be05292e3e1f8a51218827168cdclaireho    {
10115569331642446be05292e3e1f8a51218827168cdclaireho        FT_Face face = loadFace("PENUTURE.TTF");
10125569331642446be05292e3e1f8a51218827168cdclaireho        if (face) {
10135569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable shape_table [] = {
10145569331642446be05292e3e1f8a51218827168cdclaireho		{ { 0xd800, 0xdc01, 0xd800, 0xdc02, 0xd800, 0xdc03,  0 },
10155569331642446be05292e3e1f8a51218827168cdclaireho                  { 0x5, 0x6, 0x7, 0 } },
10165569331642446be05292e3e1f8a51218827168cdclaireho		{ {0}, {0} }
10175569331642446be05292e3e1f8a51218827168cdclaireho	    };
10185569331642446be05292e3e1f8a51218827168cdclaireho
10195569331642446be05292e3e1f8a51218827168cdclaireho
10205569331642446be05292e3e1f8a51218827168cdclaireho	    const ShapeTable *s = shape_table;
10215569331642446be05292e3e1f8a51218827168cdclaireho	    while (s->unicode[0]) {
10225569331642446be05292e3e1f8a51218827168cdclaireho		QVERIFY( shaping(face, s, HB_Script_Common) );
10235569331642446be05292e3e1f8a51218827168cdclaireho		++s;
10245569331642446be05292e3e1f8a51218827168cdclaireho	    }
10255569331642446be05292e3e1f8a51218827168cdclaireho
10265569331642446be05292e3e1f8a51218827168cdclaireho            FT_Done_Face(face);
10275569331642446be05292e3e1f8a51218827168cdclaireho	} else {
10285569331642446be05292e3e1f8a51218827168cdclaireho	    QSKIP("couln't find PENUTURE.TTF", SkipAll);
10295569331642446be05292e3e1f8a51218827168cdclaireho	}
10305569331642446be05292e3e1f8a51218827168cdclaireho    }
10315569331642446be05292e3e1f8a51218827168cdclaireho}
10325569331642446be05292e3e1f8a51218827168cdclaireho
10335569331642446be05292e3e1f8a51218827168cdclaireho
10345569331642446be05292e3e1f8a51218827168cdclairehoQTEST_MAIN(tst_QScriptEngine)
10355569331642446be05292e3e1f8a51218827168cdclaireho#include "main.moc"
1036