+ outpItems[item].a.fLogicalOrder = 1;
+ hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0,
+ string, cchString, maxGlyphs, logclust2, charProp2, glyphs2, glyphProp2, &outnGlyphs2);
+ winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
+ /* Cluster maps are hard. */
+ if (tags[item] != thaa_tag && tags[item] != syrc_tag)
+ {
+ for (x = 0; x < cchString; ++x)
+ {
+ unsigned int compare_idx = outpItems[item].a.fRTL ? cchString - x - 1 : x;
+ winetest_ok(logclust2[x] == logclust[compare_idx],
+ "Got unexpected logclust2[%u] %#x, expected %#x.\n",
+ x, logclust2[x], logclust[compare_idx]);
+ winetest_ok(charProp2[x].fCanGlyphAlone == charProp[compare_idx].fCanGlyphAlone,
+ "Got unexpected charProp2[%u].fCanGlyphAlone %#x, expected %#x.\n",
+ x, charProp2[x].fCanGlyphAlone, charProp[compare_idx].fCanGlyphAlone);
+ }
+ }
+ winetest_ok(outnGlyphs2 == outnGlyphs, "Got unexpected glyph count %u.\n", outnGlyphs2);
+ for (x = 0; x < outnGlyphs2; ++x)
+ {
+ unsigned int compare_idx = outpItems[item].a.fRTL ? outnGlyphs2 - x - 1 : x;
+ winetest_ok(glyphs2[x] == glyphs[compare_idx], "Got unexpected glyphs2[%u] %#x, expected %#x.\n",
+ x, glyphs2[x], glyphs[compare_idx]);
+ winetest_ok(glyphProp2[x].sva.uJustification == glyphProp[compare_idx].sva.uJustification,
+ "Got unexpected glyphProp2[%u].sva.uJustification %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.uJustification, glyphProp[compare_idx].sva.uJustification);
+ winetest_ok(glyphProp2[x].sva.fClusterStart == glyphProp[compare_idx].sva.fClusterStart,
+ "Got unexpected glyphProp2[%u].sva.fClusterStart %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.fClusterStart, glyphProp[compare_idx].sva.fClusterStart);
+ winetest_ok(glyphProp2[x].sva.fDiacritic == glyphProp[compare_idx].sva.fDiacritic,
+ "Got unexpected glyphProp2[%u].sva.fDiacritic %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.fDiacritic, glyphProp[compare_idx].sva.fDiacritic);
+ winetest_ok(glyphProp2[x].sva.fZeroWidth == glyphProp[compare_idx].sva.fZeroWidth,
+ "Got unexpected glyphProp2[%u].sva.fZeroWidth %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.fZeroWidth, glyphProp[compare_idx].sva.fZeroWidth);
+ }
+
+ /* Most scripts get this wrong. For example, when the font has the
+ * appropriate ligatures, "ttfffi" get rendered as "<ttf><ffi>", but
+ * "<RLO>iffftt" gets rendered as "t<ft><ff>i". Arabic gets it right,
+ * and there exist applications that depend on that. */
+ if (tags[item] == arab_tag && broken(script_count <= 75))
+ {
+ winetest_win_skip("Test broken on this platform, skipping.\n");
+ }
+ else if (tags[item] == arab_tag)
+ {
+ for (x = 0; x < cchString; ++x)
+ {
+ string2[x] = string[cchString - x - 1];
+ }
+ outpItems[item].a.fLogicalOrder = 0;
+ outpItems[item].a.fRTL = !outpItems[item].a.fRTL;
+ hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0,
+ string2, cchString, maxGlyphs, logclust2, charProp2, glyphs2, glyphProp2, &outnGlyphs2);
+ winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
+ for (x = 0; x < cchString; ++x)
+ {
+ unsigned int compare_idx = cchString - x - 1;
+ winetest_ok(logclust2[x] == logclust[compare_idx],
+ "Got unexpected logclust2[%u] %#x, expected %#x.\n",
+ x, logclust2[x], logclust[compare_idx]);
+ winetest_ok(charProp2[x].fCanGlyphAlone == charProp[compare_idx].fCanGlyphAlone,
+ "Got unexpected charProp2[%u].fCanGlyphAlone %#x, expected %#x.\n",
+ x, charProp2[x].fCanGlyphAlone, charProp[compare_idx].fCanGlyphAlone);
+ }
+ winetest_ok(outnGlyphs2 == outnGlyphs, "Got unexpected glyph count %u.\n", outnGlyphs2);
+ for (x = 0; x < outnGlyphs2; ++x)
+ {
+ winetest_ok(glyphs2[x] == glyphs[x], "Got unexpected glyphs2[%u] %#x, expected %#x.\n",
+ x, glyphs2[x], glyphs[x]);
+ winetest_ok(glyphProp2[x].sva.uJustification == glyphProp[x].sva.uJustification,
+ "Got unexpected glyphProp2[%u].sva.uJustification %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.uJustification, glyphProp[x].sva.uJustification);
+ winetest_ok(glyphProp2[x].sva.fClusterStart == glyphProp[x].sva.fClusterStart,
+ "Got unexpected glyphProp2[%u].sva.fClusterStart %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.fClusterStart, glyphProp[x].sva.fClusterStart);
+ winetest_ok(glyphProp2[x].sva.fDiacritic == glyphProp[x].sva.fDiacritic,
+ "Got unexpected glyphProp2[%u].sva.fDiacritic %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.fDiacritic, glyphProp[x].sva.fDiacritic);
+ winetest_ok(glyphProp2[x].sva.fZeroWidth == glyphProp[x].sva.fZeroWidth,
+ "Got unexpected glyphProp2[%u].sva.fZeroWidth %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.fZeroWidth, glyphProp[x].sva.fZeroWidth);
+ }
+ outpItems[item].a.fLogicalOrder = 1;
+ hr = pScriptShapeOpenType(hdc, &sc, &outpItems[item].a, tags[item], 0x00000000, NULL, NULL, 0,
+ string2, cchString, maxGlyphs, logclust2, charProp2, glyphs2, glyphProp2, &outnGlyphs2);
+ winetest_ok(hr == S_OK, "ScriptShapeOpenType failed (%x)\n",hr);
+ for (x = 0; x < cchString; ++x)
+ {
+ unsigned int compare_idx = outpItems[item].a.fRTL ? x : cchString - x - 1;
+ winetest_ok(logclust2[x] == logclust[compare_idx], "Got unexpected logclust2[%u] %#x, expected %#x.\n",
+ x, logclust2[x], logclust[compare_idx]);
+ winetest_ok(charProp2[x].fCanGlyphAlone == charProp[compare_idx].fCanGlyphAlone,
+ "Got unexpected charProp2[%u].fCanGlyphAlone %#x, expected %#x.\n",
+ x, charProp2[x].fCanGlyphAlone, charProp[compare_idx].fCanGlyphAlone);
+ }
+ winetest_ok(outnGlyphs2 == outnGlyphs, "Got unexpected glyph count %u.\n", outnGlyphs2);
+ for (x = 0; x < outnGlyphs2; ++x)
+ {
+ unsigned int compare_idx = outpItems[item].a.fRTL ? outnGlyphs2 - x - 1 : x;
+ winetest_ok(glyphs2[x] == glyphs[compare_idx], "Got unexpected glyphs2[%u] %#x, expected %#x.\n",
+ x, glyphs2[x], glyphs[compare_idx]);
+ winetest_ok(glyphProp2[x].sva.uJustification == glyphProp[compare_idx].sva.uJustification,
+ "Got unexpected glyphProp2[%u].sva.uJustification %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.uJustification, glyphProp[compare_idx].sva.uJustification);
+ winetest_ok(glyphProp2[x].sva.fClusterStart == glyphProp[compare_idx].sva.fClusterStart,
+ "Got unexpected glyphProp2[%u].sva.fClusterStart %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.fClusterStart, glyphProp[compare_idx].sva.fClusterStart);
+ winetest_ok(glyphProp2[x].sva.fDiacritic == glyphProp[compare_idx].sva.fDiacritic,
+ "Got unexpected glyphProp2[%u].sva.fDiacritic %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.fDiacritic, glyphProp[compare_idx].sva.fDiacritic);
+ winetest_ok(glyphProp2[x].sva.fZeroWidth == glyphProp[compare_idx].sva.fZeroWidth,
+ "Got unexpected glyphProp2[%u].sva.fZeroWidth %#x, expected %#x.\n",
+ x, glyphProp2[x].sva.fZeroWidth, glyphProp[compare_idx].sva.fZeroWidth);
+ }
+ }
+