45 IDWriteTextAnalyzer_QueryInterface(analyzer,
riid, &
ret);
46 IDWriteTextAnalyzer_Release(analyzer);
62#define MS_GDEF_TAG DWRITE_MAKE_OPENTYPE_TAG('G','D','E','F')
65#define GET_BE_WORD(x) (x)
66#define GET_BE_DWORD(x) (x)
67#define GET_LE_WORD(x) RtlUshortByteSwap(x)
68#define GET_LE_DWORD(x) RtlUlongByteSwap(x)
70#define GET_BE_WORD(x) RtlUshortByteSwap(x)
71#define GET_BE_DWORD(x) RtlUlongByteSwap(x)
72#define GET_LE_WORD(x) (x)
73#define GET_LE_DWORD(x) (x)
108 return "ScriptAnalysis";
140#define NUM_CALL_SEQUENCES 1
179 for (
i = 0;
i <
n;
i++)
180 seq[
i] =
calloc(1,
sizeof(*seq[
i]));
205 add_call(seq, sequence_index, &end_of_sequence);
221 switch (actual->
kind)
239 ok_(
file,
line) (0,
"%s: call %s was expected, but got call %s instead\n",
248 ok_(
file,
line) (0,
"%s: call %s was expected, but got call %s instead\n",
262 ok_(
file,
line) (0,
"%s: the call sequence is not complete: expected %s - actual %s\n",
269 ok_(
file,
line) (0,
"%s: the call sequence is not complete: expected %s - actual %s\n",
284#define ok_sequence(seq, index, exp, contx, todo) \
285 ok_sequence_(seq, index, (exp), (contx), (todo), __FILE__, __LINE__)
314 entry.sa.pos = position;
329#define BREAKPOINT_COUNT 20
338 ok(0,
"SetLineBreakpoints: reported pos=%u, len=%u overflows expected length %d\n", position,
length,
BREAKPOINT_COUNT);
345#define BIDI_LEVELS_COUNT 10
368 ok(0,
"unexpected\n");
398 ok(0,
"QueryInterface not expected\n");
404 ok(0,
"AddRef not expected\n");
410 ok(0,
"Release not expected\n");
440 if (position >=
source->text_length)
448 *text_len =
source->text_length - position;
457 ok(0,
"unexpected\n");
479 ok(0,
"unexpected\n");
504 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
507 memset(&logfont, 0,
sizeof(logfont));
514 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
517 hr = IDWriteFont_CreateFontFace(
font, &fontface);
520 IDWriteFont_Release(
font);
521 IDWriteGdiInterop_Release(interop);
542 ok(
res != 0,
"couldn't find resource\n");
551#define DELETE_FONTFILE(filename) _delete_testfontfile(filename, __LINE__)
570 IDWriteFontFile_Release(
file);
589 {
't',
'e',
's',
't',0}, -1, 1,
593 {
' ',
' ',
' ',
' ',
'!',
'$',
'[',
'^',
'{',
'~',0}, -1, 1,
597 {
' ',
' ',
' ',
'1',
'2',
' ',0}, -1, 1,
607 {0x064a,0x064f,0x0633,0x0627,0x0648,0x0650,0x064a,0x0661,0}, -1, 1,
612 {0x0627,0x0644,0x0635,0x0651,0x0650,0x062d,0x0629,0x064f,
' ',0x062a,0x064e,
613 0x0627,0x062c,0x064c,
' ',0x0639,0x064e,0x0644,0x0649,
' ',
614 0x0631,0x064f,0x0624,0x0648,0x0633,0x0650,
' ',0x0627,0x0644,
615 0x0623,0x0635,0x0650,0x062d,0x0651,0x064e,0x0627,0x0621,0x0650,0x06f0,0x06f5,0}, -1, 1,
620 {
'1',
'2',
'3',
'-',
'5',
'2',0x064a,0x064f,0x0633,0x0627,0x0648,0x0650,0x064a,
'7',
'1',
'.',0}, -1, 1,
625 {
'A',
'B',
'C',
'-',
'D',
'E',
'F',
' ',0x0621,0x0623,0x0624,0}, -1, 2,
632 {
' ',0x0621,0x0623,0x0624,
'A',
'B',
'C',
'-',
'D',
'E',
'F',0}, -1, 2,
639 {
'A',
'B',
'C',
'-',
'D',
'E',
'F',0x0621,0x0623,0x0624,
' ',0}, -1, 2,
646 {0x80,0x90,0x9f,0xa0,0xc0,0xb8,0xbf,0xc0,0xff,0}, -1, 2,
653 {0x100,0x120,0x130,0x140,0x150,0x160,0x170,0x17f,0}, -1, 1,
658 {0x180,0x190,0x1bf,0x1c0,0x1c3,0x1c4,0x1cc,0x1dc,0x1ff,0x217,0x21b,0x24f,0}, -1, 1,
663 {0x250,0x260,0x270,0x290,0x2af,0}, -1, 1,
668 {0x2b0,0x2ba,0x2d7,0x2dd,0x2ef,0x2ff,0}, -1, 1,
673 {0x300,0x320,0x340,0x345,0x350,0x36f,0}, -1, 1,
678 {0x370,0x388,0x3d8,0x3e1,0x3e2,0x3fa,0x3ff,0}, -1, 3,
686 {0x400,0x40f,0x410,0x44f,0x450,0x45f,0x460,0x481,0x48a,0x4f0,0x4fa,0x4ff,0x500,0x510,0x520,0}, -1, 1,
691 {0x531,0x540,0x559,0x55f,0x570,0x589,0x58a,0}, -1, 1,
696 {0x5e9,0x5dc,0x5d5,0x5dd,0}, -1, 1,
701 {
'p',
'a',
'r',
't',
' ',
'o',
'n',
'e',
' ',0x5d7,0x5dc,0x5e7,
' ',0x5e9,0x5ea,0x5d9,0x5d9,0x5dd,
' ',
'p',
'a',
'r',
't',
' ',
't',
'h',
'r',
'e',
'e',0}, -1, 3,
708 {0x710,0x712,0x712,0x714,
'.',0}, -1, 1,
713 {0x750,0x760,0x76d,
'.',0}, -1, 1,
718 {0x780,0x78e,0x798,0x7a6,0x7b0,
'.',0}, -1, 1,
723 {0x7c0,0x7ca,0x7e8,0x7eb,0x7f6,
'.',0}, -1, 1,
728 {0x780,0x798,0x7a5,0x7a6,0x7b0,
'.',0}, -1, 1,
733 {0x926,0x947,0x935,0x928,0x93e,0x917,0x930,0x940,
'.',0}, -1, 1,
738 {0x9ac,0x9be,0x982,0x9b2,0x9be,
'.',0}, -1, 1,
743 {0xa17,0xa41,0xa30,0xa2e,0xa41,0xa16,0xa40,
'.',0}, -1, 1,
748 {0xa97,0xac1,0xa9c,0xab0,0xabe,0xaa4,0xac0,
'.',0}, -1, 1,
753 {0xb13,0xb21,0xb3c,0xb3f,0xb06,
'.',0}, -1, 1,
758 {0xba4,0xbae,0xbbf,0xbb4,0xbcd,
'.',0}, -1, 1,
763 {0xc24,0xc46,0xc32,0xc41,0xc17,0xc41,
'.',0}, -1, 1,
768 {0xc95,0xca8,0xccd,0xca8,0xca1,
'.',0}, -1, 1,
773 {0xd2e,0xd32,0xd2f,0xd3e,0xd33,0xd02,
'.',0}, -1, 1,
778 {0xd82,0xd85,0xd9a,0xdcf,
'.',0}, -1, 1,
783 {0x0e04,0x0e27,0x0e32,0x0e21,0x0e1e,0x0e22,0x0e32,0x0e22,0x0e32,0x0e21,
784 0x0e2d,0x0e22,0x0e39,0x0e48,0x0e17,0x0e35,0x0e48,0x0e44,0x0e2b,0x0e19,
785 0x0e04,0x0e27,0x0e32,0x0e21,0x0e2a, 0x0e33,0x0e40,0x0e23,0x0e47,0x0e08,
786 0x0e2d,0x0e22,0x0e39,0x0e48,0x0e17,0x0e35,0x0e48,0x0e19,0x0e31,0x0e48,0x0e19,
'.',0}, -1, 1,
791 {0xead,0xeb1,0xe81,0xeaa,0xead,0xe99,0xea5,0xeb2,0xea7,
'.',0}, -1, 1,
796 {0xf04,0xf05,0xf0e,0x020,0xf51,0xf7c,0xf53,0xf0b,0xf5a,0xf53,0xf0b,
797 0xf51,0xf44,0xf0b,0xf54,0xf7c,0xf0d,
'.',0}, -1, 1,
802 {0x1019,0x103c,0x1014,0x103a,0x1019,0x102c,0x1021,0x1000,0x1039,0x1001,0x101b,0x102c,
'.',0}, -1, 1,
807 {0x10a0,0x10d0,0x10da,0x10f1,0x10fb,0x2d00,
'.',0}, -1, 1,
812 {0x1100,0x1110,0x1160,0x1170,0x11a8,
'.',0}, -1, 1,
817 {0x130d,0x12d5,0x12dd,0}, -1, 1,
822 {0x13e3,0x13b3,0x13a9,0x0020,0x13a6,0x13ec,0x13c2,0x13af,0x13cd,0x13d7,0}, -1, 1,
827 {0x1403,0x14c4,0x1483,0x144e,0x1450,0x1466,0}, -1, 1,
832 {0x169b,0x1691,0x168c,0x1690,0x168b,0x169c,0}, -1, 1,
837 {0x16a0,0x16a1,0x16a2,0x16a3,0x16a4,0x16a5,0}, -1, 1,
842 {0x1781,0x17c1,0x1798,0x179a,0x1797,0x17b6,0x179f,0x17b6,0x19e0,0}, -1, 1,
847 {0x182e,0x1823,0x1829,0x182d,0x1823,0x182f,0x0020,0x182a,0x1822,0x1834,0x1822,0x182d,0x180c,0}, -1, 1,
852 {0x1900,0x1910,0x1920,0x1930,0}, -1, 1,
857 {0x1956,0x196d,0x1970,0x1956,0x196c,0x1973,0x1951,0x1968,0x1952,0x1970,0}, -1, 1,
862 {0x1992,0x19c4,0}, -1, 1,
867 {0x1a00,0x1a10,0}, -1, 1,
872 {0x1a20,0x1a40,0x1a50,0}, -1, 1,
877 {0x1b00,0x1b05,0x1b20,0}, -1, 1,
882 {0x1b80,0x1b85,0x1ba0,0}, -1, 1,
887 {0x1bc0,0x1be5,0x1bfc,0}, -1, 1,
892 {0x1c00,0x1c20,0x1c40,0}, -1, 1,
897 {0x1c50,0x1c5a,0x1c77,0}, -1, 1,
902 {0x1cc0,0x1cc5,0x1cc7,0}, -1, 1,
907 {0x1d00,0x1d40,0x1d70,0}, -1, 1,
912 {0x1dc0,0x300,0x1ddf,0}, -1, 1,
917 {0x1e00,0x1d00,0x2c60,0}, -1, 1,
922 {0x3f0,0x1f00,0}, -1, 1,
927 {0x1dc0,0x2000,0}, -1, 1,
932 {0x2070,0x2086,0x2000,0}, -1, 1,
937 {0x20a0,0x20b8,0x2000,0x20d0,0x2100,0x2150,0x2190,0x2200,0x2300,0x2400,0x2440,0x2460,0x2500,0x2580,0x25a0,0x2600,
938 0x2700,0x27c0,0x27f0,0x2900,0x2980,0x2a00,0x2b00,0}, -1, 1,
943 {0x2800,0x2070,0x2000,0}, -1, 1,
948 {0x2c00,0x2c12,0}, -1, 1,
953 {0x2c80,0x3e2,0x1f00,0}, -1, 2,
959 {0x2d30,0x2d4a,0}, -1, 1,
964 {
LRE,
PDF,
'a',
'b',
'c',
'\r',0}, -1, 3,
971 {
LRE,
PDF,
'r',
'!',0x200b,
'\r',0}, -1, 3,
978 {0x300,0x300,0}, -1, 1,
983 {0x300,0x300,
'a',0}, -1, 1,
988 {0x300,
'+',0x627,0x300,
'a',0}, -1, 2,
993 {
'a',0x300,
'+',0x627,0x300,
')',
'a',0}, -1, 3,
1000 {0x627,
'(',
'a',
')',
'a',0}, -1, 2,
1005 {0x627,
'[',
'a',
']',0x627,0}, -1, 3,
1013 {0x25cc,0x300,0}, -1, 1,
1018 {0x25cc,0x300,0x5c4,0}, -1, 1,
1023 {0x25cc,0x300,
'a',0}, -1, 1,
1028 {0xd805,0xde80,0}, -1, 1,
1033 {0xd834,0xdd73,0}, -1, 1,
1038 {0xdb40,0xdc20,0}, -1, 1,
1070 for (
i = 0;
i <
test->item_count;
i++)
1075 call.
sa.pos =
test->sa[
i].pos;
1076 call.
sa.len =
test->sa[
i].len;
1077 call.
sa.shapes =
test->sa[
i].shapes;
1082 add_call(seq, 0, &end_of_sequence);
1093 ok(!!analyzer,
"Failed to create analyzer instance.\n");
1095 hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, &
analysissource.IDWriteTextAnalysisSource_iface, 0,
1101 IDWriteTextAnalyzer_Release(analyzer);
1111 ok(!!analyzer,
"Failed to create analyzer instance.\n");
1121 hr = IDWriteTextAnalyzer_AnalyzeScript(analyzer, &
analysissource.IDWriteTextAnalysisSource_iface, 0,
1130 IDWriteTextAnalyzer_Release(analyzer);
1140 { {
'A',
'-',
'B',
' ',
'C',0x58a,
'D',0x2010,
'E',0x2012,
'F',0x2013,
'\t',0xc,0xb,0x2028,0x2029,0x200b,0},
1163 { {
'A',0xad,
'B',0x5be,
'C',0xf0b,
'D',0x1361,
'E',0x17d8,
'F',0x17da,
'G',0},
1181 { {0x5f35,
'G',0x300c,0},
1193 static const char *conditions[] = {
"N",
"CB",
"NB",
"B"};
1201 "%s: got [%s, %s] (%s, %s), expected [%s, %s] (%s, %s)\n",
1207 conditions[
test->bp[
i].breakConditionBefore],
1208 conditions[
test->bp[
i].breakConditionAfter],
1209 test->bp[
i].isWhitespace ?
"WS" :
"0",
1210 test->bp[
i].isSoftHyphen ?
"SHY" :
"0");
1212 ok(!
g_actual_bp[
i].isWhitespace,
"%s: soft hyphen marked as a whitespace\n",
1228 ok(!!analyzer,
"Failed to create analyzer instance.\n");
1231 hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &
analysissource.IDWriteTextAnalysisSource_iface, 0, 0,
1243 ok(0,
"test %u: increase BREAKPOINT_COUNT to at least %u\n",
i,
len);
1250 hr = IDWriteTextAnalyzer_AnalyzeLineBreakpoints(analyzer, &
analysissource.IDWriteTextAnalysisSource_iface,
1259 IDWriteTextAnalyzer_Release(analyzer);
1272 win_skip(
"GetScriptProperties() is not supported.\n");
1277 hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer,
sa, &
props);
1281 hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer,
sa,
NULL);
1284 hr = IDWriteTextAnalyzer1_GetScriptProperties(analyzer,
sa, &
props);
1287 IDWriteTextAnalyzer1_Release(analyzer);
1298 { {0}, 1,
FALSE, 1 },
1299 { {0}, 0,
TRUE, 0 },
1300 { {0x610,0}, 0,
TRUE, 0 },
1301 { {
'A',
'B',
'C',
'D',0}, 3,
TRUE, 3 },
1302 { {
'A',
'B',
'C',
'D',0}, 5,
TRUE, 4 },
1303 { {
'A',
'B',
'C',
'D',0}, 10,
TRUE, 4 },
1304 { {
'A',0x610,
'C',
'D',0}, 1,
TRUE, 1 },
1305 { {
'A',0x610,
'C',
'D',0}, 2,
FALSE, 2 },
1306 { {0x610,
'A',
'C',
'D',0}, 1,
FALSE, 1 },
1307 { {0x610,
'A',
'C',
'D',0}, 2,
FALSE, 1 },
1308 { {0x610,0x610,
'C',
'D',0}, 2,
FALSE, 2 },
1309 { {0xd800,
'A',
'B',0}, 1,
FALSE, 1 },
1310 { {0xd800,
'A',
'B',0}, 2,
FALSE, 1 },
1311 { {0xdc00,
'A',
'B',0}, 2,
FALSE, 1 },
1312 { {0x202a,
'A',0x202c,0}, 3,
FALSE, 1 },
1313 { {0x200e,
'A',0}, 2,
FALSE, 1 },
1314 { {0x200f,
'A',0}, 2,
FALSE, 1 },
1315 { {0x202d,
'A',0}, 2,
FALSE, 1 },
1316 { {0x202e,
'A',0}, 2,
FALSE, 1 },
1333 win_skip(
"GetTextComplexity() is not supported.\n");
1341 hr = IDWriteTextAnalyzer1_GetTextComplexity(analyzer,
L"ABC", 3,
NULL,
NULL, &
len,
NULL);
1370 ok(
hr ==
S_OK,
"%d: Unexpected hr %#lx.\n",
i,
hr);
1371 ok(
len ==
ptr->len_read,
"%d: read length: got %d, expected %d\n",
i,
len,
ptr->len_read);
1379 IDWriteFontFace_Release(fontface);
1380 IDWriteTextAnalyzer1_Release(analyzer);
1391 IDWriteNumberSubstitution_Release(substitution);
1395 FALSE, &substitution);
1396 ok(
hr ==
S_OK,
"Failed to create number substitution, hr %#lx.\n",
hr);
1397 IDWriteNumberSubstitution_Release(substitution);
1404 hr = IDWriteFactory_CreateNumberSubstitution(
factory, -1,
NULL,
FALSE, &substitution);
1412 FALSE, &substitution);
1416 FALSE, &substitution);
1420 FALSE, &substitution);
1426 ok(
hr ==
S_OK,
"Failed to create number substitution, hr %#lx.\n",
hr);
1427 IDWriteNumberSubstitution_Release(substitution);
1436 hr = IDWriteFontFace_GetGlyphIndices(fontface, &codepoint, 1, glyphs++);
1447 IDWriteFontFace_GetMetrics(fontface, &fontmetrics);
1452 hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, glyphs +
i, 1, &
metrics,
FALSE);
1555 hr = IDWriteLocalizedStrings_FindLocaleName(
strings,
L"en-us", &
index, &exists);
1563 ok(
hr ==
S_OK,
"Failed to get name string, hr %#lx.\n",
hr);
1586 IDWriteFontFace_ReleaseFontTable(fontface, gdef.
context);
1590 if (
FAILED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void **)&fontface1)))
1592 IDWriteFontFace_ReleaseFontTable(fontface, gdef.
context);
1596 hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 0,
NULL, &
count);
1601 hr = IDWriteFontFace1_GetUnicodeRanges(fontface1,
count, ranges, &
count);
1602 ok(
hr ==
S_OK,
"Failed to get ranges, hr %#lx.\n",
hr);
1606 if (ranges[
i].
first > 0xffff)
1613 UINT16 glyphs[10], clustermap[10], glyph;
1614 unsigned int actual_count, glyph_class;
1618 hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &
ch, 1, &glyph);
1619 ok(
hr ==
S_OK,
"Failed to get glyph index, hr %#lx.\n",
hr);
1627 memset(glyph_props, 0,
sizeof(glyph_props));
1630 ok(
hr ==
S_OK,
"Failed to shape, hr %#lx.\n",
hr);
1631 if (actual_count > 1)
1636 switch (glyph_class)
1639 ok(glyph_props[0].isDiacritic && glyph_props[0].isZeroWidthSpace,
1640 "%#x -> %u: unexpected glyph properties %u/%u. Class %u. Font %s - %s.\n",
1641 text[0], glyphs[0], glyph_props[0].isDiacritic, glyph_props[0].isZeroWidthSpace,
1648 if (glyph_props[0].isDiacritic)
1649 ok(glyph_props[0].isZeroWidthSpace,
1650 "%#x -> %u: unexpected glyph properties %u/%u. Class %u. Font %s - %s.\n",
text[0], glyphs[0],
1651 glyph_props[0].isDiacritic, glyph_props[0].isZeroWidthSpace, glyph_class,
1658 IDWriteFontFace_ReleaseFontTable(fontface, gdef.
context);
1659 IDWriteFontFace1_Release(fontface1);
1664 static const WCHAR test1W[] = {
'<',
'B',
' ',
'C',0};
1665 static const WCHAR test2W[] = {
'<',
'B',
'\t',
'C',0};
1666 static const WCHAR test3W[] = {0x202a,0x202c,0};
1669 UINT32 maxglyphcount, actual_count;
1670 FLOAT advances[10], advances2[10];
1683 ok(!!analyzer,
"Failed to create analyzer instance.\n");
1691 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs1, shapingprops, &actual_count);
1697 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs1, shapingprops, &actual_count);
1706 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs1, shapingprops, &actual_count);
1708 ok(actual_count == 4,
"got %d\n", actual_count);
1709 ok(
sa.script == 999,
"got %u\n",
sa.script);
1715 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs1, shapingprops, &actual_count);
1717 ok(actual_count == 4,
"got %d\n", actual_count);
1721 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs2, shapingprops, &actual_count);
1723 ok(actual_count == 4,
"got %d\n", actual_count);
1724 ok(glyphs1[2] != glyphs2[2],
"got %d\n", glyphs1[2]);
1730 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs1, shapingprops, &actual_count);
1732 ok(actual_count == 4,
"got %d\n", actual_count);
1736 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs2, shapingprops, &actual_count);
1738 ok(actual_count == 4,
"got %d\n", actual_count);
1739 ok(glyphs1[0] != glyphs2[0],
"got %d\n", glyphs1[0]);
1747 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs1, shapingprops, &actual_count);
1749 ok(actual_count == 2,
"got %d\n", actual_count);
1750 ok(glyphs1[0] == glyphs2[0],
"got %u, expected %u\n", glyphs1[0], glyphs2[0]);
1751 ok(glyphs1[1] == glyphs2[1],
"got %u, expected %u\n", glyphs1[1], glyphs2[1]);
1752 ok(shapingprops[0].isClusterStart == 1,
"got %d\n", shapingprops[0].isClusterStart);
1753 ok(shapingprops[0].isZeroWidthSpace == 0,
"got %d\n", shapingprops[0].isZeroWidthSpace);
1754 ok(shapingprops[1].isClusterStart == 1,
"got %d\n", shapingprops[1].isClusterStart);
1755 ok(shapingprops[1].isZeroWidthSpace == 0,
"got %d\n", shapingprops[1].isZeroWidthSpace);
1756 ok(clustermap[0] == 0,
"got %d\n", clustermap[0]);
1757 ok(clustermap[1] == 1,
"got %d\n", clustermap[1]);
1759 memset(advances, 0,
sizeof(advances));
1760 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, test3W, clustermap,
props,
lstrlenW(test3W),
1761 glyphs1, shapingprops, actual_count, fontface, 10.0,
FALSE,
FALSE, &
sa,
NULL,
NULL,
1764 ok(advances[0] == advances2[0],
"got %.2f, expected %.2f\n", advances[0], advances2[0]);
1765 ok(advances[1] == advances2[1],
"got %.2f, expected %.2f\n", advances[1], advances2[1]);
1770 ok(
sa.script != 0,
"got %d\n",
sa.script);
1773 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs1, shapingprops, &actual_count);
1775 ok(actual_count == 2,
"got %d\n", actual_count);
1776 ok(glyphs1[0] == glyphs2[0],
"got %u, expected %u\n", glyphs1[0], glyphs2[0]);
1777 ok(glyphs1[1] == glyphs2[1],
"got %u, expected %u\n", glyphs1[1], glyphs2[1]);
1778 ok(shapingprops[0].isClusterStart == 1,
"got %d\n", shapingprops[0].isClusterStart);
1779 ok(shapingprops[0].isZeroWidthSpace == 0,
"got %d\n", shapingprops[0].isZeroWidthSpace);
1780 ok(shapingprops[1].isClusterStart == 1,
"got %d\n", shapingprops[1].isClusterStart);
1781 ok(shapingprops[1].isZeroWidthSpace == 0,
"got %d\n", shapingprops[1].isZeroWidthSpace);
1782 ok(clustermap[0] == 0,
"got %d\n", clustermap[0]);
1783 ok(clustermap[1] == 1,
"got %d\n", clustermap[1]);
1785 memset(advances, 0,
sizeof(advances));
1786 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer, test3W, clustermap,
props,
lstrlenW(test3W),
1787 glyphs1, shapingprops, actual_count, fontface, 10.0,
FALSE,
FALSE, &
sa,
NULL,
NULL,
1790 ok(advances[0] == advances2[0],
"got %.2f, expected %.2f\n", advances[0], advances2[0]);
1791 ok(advances[1] == advances2[1],
"got %.2f, expected %.2f\n", advances[1], advances2[1]);
1799 NULL,
NULL,
NULL, 0, maxglyphcount, clustermap,
props, glyphs1, shapingprops, &actual_count);
1801 ok(actual_count == 4,
"got %d\n", actual_count);
1802 ok(
sa.script == 0,
"got %u\n",
sa.script);
1803 ok(!shapingprops[0].isZeroWidthSpace,
"got %d\n", shapingprops[0].isZeroWidthSpace);
1805 IDWriteFontFace_Release(fontface);
1808 hr = IDWriteFactory_GetSystemFontCollection(
factory, &syscoll,
FALSE);
1809 ok(
hr ==
S_OK,
"Failed to get system collection, hr %#lx.\n",
hr);
1811 for (
i = 0;
i < IDWriteFontCollection_GetFontFamilyCount(syscoll); ++
i)
1817 hr = IDWriteFontCollection_GetFontFamily(syscoll,
i, &family);
1818 ok(
hr ==
S_OK,
"Failed to get font family, hr %#lx.\n",
hr);
1820 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
1821 ok(
hr ==
S_OK,
"Failed to get family names, hr %#lx.\n",
hr);
1823 IDWriteLocalizedStrings_Release(
names);
1825 for (
j = 0;
j < IDWriteFontFamily_GetFontCount(family); ++
j)
1830 hr = IDWriteFontFamily_GetFont(family,
j, &
font);
1831 ok(
hr ==
S_OK,
"Failed to get font instance, hr %#lx.\n",
hr);
1833 hr = IDWriteFont_CreateFontFace(
font, &fontface);
1834 ok(
hr ==
S_OK,
"Failed to create fontface, hr %#lx.\n",
hr);
1837 ok(
hr ==
S_OK,
"Failed to get face names, hr %#lx.\n",
hr);
1839 IDWriteLocalizedStrings_Release(
names);
1843 IDWriteFontFace_Release(fontface);
1844 IDWriteFont_Release(
font);
1847 IDWriteFontFamily_Release(family);
1850 IDWriteFontCollection_Release(syscoll);
1852 IDWriteTextAnalyzer_Release(analyzer);
1857 static const WCHAR arabicW[] = {0x064a,0x064f,0x0633,0};
1868 win_skip(
"GetTypographicFeatures() is not supported.\n");
1876 hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer, fontface,
sa,
NULL, 0, &
count,
NULL);
1883 hr = IDWriteTextAnalyzer2_GetTypographicFeatures(analyzer, fontface,
sa,
L"cadabra", 0, &
count,
NULL);
1903 IDWriteFontFace_Release(fontface);
1904 IDWriteTextAnalyzer2_Release(analyzer);
1911 static const WCHAR aW[] = {
'A',
'D',0};
1912 UINT16 clustermap[2], glyphs[2];
1923 ok(!!analyzer,
"Failed to create analyzer instance.\n");
1937 advances[0] = advances[1] = 1.0;
1939 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
aW, clustermap, textprops,
1940 len, glyphs, glyphprops, 0, fontface, 0.0,
FALSE,
FALSE, &
sa,
NULL,
NULL,
1943 ok(advances[0] == 1.0,
"got %.2f\n", advances[0]);
1944 ok(
offsets[0].advanceOffset == 2.0 &&
offsets[0].ascenderOffset == 2.0,
"got %.2f,%.2f\n",
1948 advances[0] = advances[1] = 1.0;
1950 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
aW, clustermap, textprops,
1951 len, glyphs, glyphprops,
len, fontface, 0.0,
FALSE,
FALSE, &
sa,
NULL,
NULL,
1954 ok(advances[0] == 0.0,
"got %.2f\n", advances[0]);
1955 ok(
offsets[0].advanceOffset == 0.0 &&
offsets[0].ascenderOffset == 0.0,
"got %.2f,%.2f\n",
1958 advances[0] = advances[1] = 1.0;
1960 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
aW, clustermap, textprops,
1961 len, glyphs, glyphprops,
len, fontface, 2048.0,
FALSE,
FALSE, &
sa,
NULL,
NULL,
1964 ok(advances[0] == 1000.0,
"got %.2f\n", advances[0]);
1965 ok(
offsets[0].advanceOffset == 0.0 &&
offsets[0].ascenderOffset == 0.0,
"got %.2f,%.2f\n",
1968 advances[0] = advances[1] = 1.0;
1970 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
aW, clustermap, textprops,
1971 len, glyphs, glyphprops,
len, fontface, 1024.0,
FALSE,
FALSE, &
sa,
NULL,
NULL,
1974 ok(advances[0] == 500.0,
"got %.2f\n", advances[0]);
1975 ok(advances[1] == 500.0,
"got %.2f\n", advances[1]);
1976 ok(
offsets[0].advanceOffset == 0.0 &&
offsets[0].ascenderOffset == 0.0,
"got %.2f,%.2f\n",
1979 advances[0] = advances[1] = 1.0;
1981 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
aW, clustermap, textprops,
1982 len, glyphs, glyphprops,
len, fontface, 20.48,
FALSE,
FALSE, &
sa,
NULL,
NULL,
1985 ok(advances[0] == 10.0,
"got %.2f\n", advances[0]);
1986 ok(advances[1] == 10.0,
"got %.2f\n", advances[1]);
1987 ok(
offsets[0].advanceOffset == 0.0 &&
offsets[0].ascenderOffset == 0.0,
"got %.2f,%.2f\n",
1991 advances[0] = advances[1] = 1.0;
1992 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
aW,
NULL, textprops,
1993 len, glyphs, glyphprops,
len, fontface, 1024.0,
FALSE,
FALSE, &
sa,
NULL,
NULL,
1996 ok(advances[0] == 500.0,
"got %.2f\n", advances[0]);
1997 ok(advances[1] == 500.0,
"got %.2f\n", advances[1]);
2000 advances[0] = advances[1] = 1.0;
2002 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
aW, clustermap, textprops,
2003 len, glyphs, glyphprops,
len, fontface, -10.24,
FALSE,
FALSE, &
sa,
NULL,
NULL,
2006 ok(advances[0] == -5.0,
"got %.2f\n", advances[0]);
2007 ok(
offsets[0].advanceOffset == 0.0 &&
offsets[0].ascenderOffset == 0.0,
"got %.2f,%.2f\n",
2012 advances[0] = advances[1] = 1.0f;
2014 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
aW, clustermap, textprops,
2015 len, glyphs, glyphprops,
len, fontface, 2048.0f,
FALSE,
FALSE, &
sa,
NULL,
NULL,
2018 ok(advances[0] == 1000.0f,
"got %.2f\n", advances[0]);
2019 ok(advances[1] == 1000.0f,
"got %.2f\n", advances[1]);
2020 ok(
offsets[0].advanceOffset == 0.0f &&
offsets[0].ascenderOffset == 0.0f,
"got %.2f,%.2f\n",
2025 advances[0] = advances[1] = 1.0f;
2028 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
aW, clustermap, textprops,
2029 len, glyphs, glyphprops,
len, fontface, 2048.0f,
FALSE,
FALSE, &
sa,
NULL,
NULL,
2032 ok(advances[0] == 0.0f,
"got %.2f\n", advances[0]);
2033 ok(advances[1] == 1000.0f,
"got %.2f\n", advances[1]);
2034 ok(
offsets[0].advanceOffset == 0.0f &&
offsets[0].ascenderOffset == 0.0f,
"got %.2f,%.2f\n",
2037 IDWriteTextAnalyzer_Release(analyzer);
2038 IDWriteFontFace_Release(fontface);
2059#define P_Z { 0, 0, 0, 1, 0 }
2061#define P_D { 0, 0, 1, 0, 0 }
2063#define P_D_Z { 0, 0, 1, 1, 0 }
2065 { 0.0, 0.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 } },
2066 { 0.0, 0.0, 2.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 } },
2067 { 1.0, 0.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 11.0, 12.0 }, { 3.0, 4.0 } },
2068 { 1.0, 1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 12.0, 13.0 }, { 3.0, 4.0 } },
2069 { 1.0, -1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 3.0, 4.0 } },
2070 { 0.0, -10.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 1.0 }, { 2.0, 3.0 } },
2071 { -5.0, -4.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 5.0 }, { -1.0, -0.5 } },
2072 { -5.0, -5.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 5.0 }, { -0.5, 0.0 } },
2073 { 2.0, 0.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 7.0, 7.0 }, { 6.0, 6.5 } },
2074 { 2.0, 1.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 8.0, 8.0 }, { 6.0, 6.5 } },
2075 { 2.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 7.0, 7.0 }, { 4.0, 5.0 } },
2076 { 1.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 6.0 }, { 3.0, 4.0 } },
2077 { -10.0, 1.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 6.0 }, { -3.0, -3.0 } },
2078 { 0.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 5.0 }, { 2.0, 3.0 } },
2079 { 1.0, -10.0, -5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 0.0 }, { 2.0, 3.0 } },
2080 { -10.0, 1.0, 5.0, { 8.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 6.0 }, { -1.0, -3.0 } },
2082 { 0.0f, 0.0f, 0.0f, { 10.0f, 11.0f }, { 2.0f, 3.0f }, { 10.0f, 11.0f }, { 2.0f, 3.0f },
TRUE },
2083 { 1.0f, 0.0f, 0.0f, { 10.0f, 11.0f }, { 2.0f, 3.5f }, { 11.0f, 11.0f }, { 3.0f, 3.5f },
TRUE },
2084 { 1.0f, 1.0f, 0.0f, { 10.0f, 11.0f }, { 2.0f, 3.0f }, { 11.0f, 12.0f }, { 3.0f, 3.0f },
TRUE },
2085 { 1.0, -1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 11.0, 10.0 }, { 3.0, 3.0 },
TRUE },
2086 { 0.0, -10.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 1.0 }, { 2.0, 3.0 },
TRUE },
2087 { 0.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 1.0 }, { 2.0, 3.0 },
TRUE },
2088 { 1.0, -10.0, -5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 0.0 }, { 2.0, 3.0 },
TRUE },
2089 { -5.0, -10.0, 4.0, { 10.0, 11.0, 12.0 }, { 2.0, 3.0, 4.0 }, { 5.0, 11.0, 2.0 }, { -3.0, 3.0, 4.0 },
TRUE },
2090 { -10.0, -10.0, 4.0, { 10.0, 11.0, 12.0 }, { 2.0, 3.0, 4.0 }, { 0.0, 11.0, 2.0 }, { -8.0, 3.0, 4.0 },
TRUE },
2091 { -10.0, -10.0, 5.0, { 10.0, 1.0, 12.0 }, { 2.0, 3.0, 4.0 }, { 1.0, 1.0, 3.0 }, { -7.0, 3.0, 4.0 },
TRUE },
2092 { -10.0, 1.0, 5.0, { 10.0, 1.0, 2.0 }, { 2.0, 3.0, 4.0 }, { 2.0, 1.0, 3.0 }, { -6.0, 3.0, 4.0 },
TRUE },
2093 { 1.0, -10.0, 5.0, { 2.0, 1.0, 10.0 }, { 2.0, 3.0, 4.0 }, { 3.0, 1.0, 2.0 }, { 3.0, 3.0, 4.0 },
TRUE },
2094 { -10.0, -10.0, 5.0, { 11.0, 1.0, 11.0 }, { 2.0, 3.0, 4.0 }, { 2.0, 1.0, 2.0 }, { -7.0, 3.0, 4.0 },
TRUE },
2096 { 1.0, 0.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 12.0 }, { 2.0, 4.0 },
FALSE, {
P_Z,
P_S } },
2097 { 1.0, 1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 13.0 }, { 2.0, 4.0 },
FALSE, {
P_Z,
P_S } },
2098 { 1.0, -1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 3.0, 3.0 },
FALSE, {
P_S,
P_Z } },
2099 { 0.0, -10.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 1.0 }, { 2.0, 3.0 },
FALSE, {
P_Z,
P_S } },
2100 { -5.0, -4.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 11.0 }, { -1.0, 3.0 },
FALSE, {
P_S,
P_Z } },
2101 { -5.0, -5.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
FALSE, {
P_Z,
P_Z } },
2102 { 2.0, 0.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 7.0, 2.0 }, { 6.0, 3.0 },
FALSE, {
P_S,
P_Z } },
2103 { 2.0, 1.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 8.0, 2.0 }, { 6.0, 3.0 },
FALSE, {
P_S,
P_Z } },
2104 { 2.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
FALSE, {
P_Z,
P_Z } },
2105 { 1.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 11.0 }, { 3.0, 3.0 },
FALSE, {
P_S,
P_Z } },
2106 { -10.0, 1.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
FALSE, {
P_Z,
P_Z } },
2107 { 0.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 11.0 }, { 2.0, 3.0 },
FALSE, {
P_S,
P_Z } },
2108 { 1.0, -10.0, -5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 0.0 }, { 2.0, 3.0 },
FALSE, {
P_Z,
P_S } },
2109 { -10.0, 1.0, 5.0, { 8.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 11.0 }, { -1.0, 3.0 },
FALSE, {
P_S,
P_Z } },
2111 { 1.0, 0.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 11.0, 12.0 }, { 3.0, 4.0 },
FALSE, {
P_D,
P_S } },
2112 { 1.0, 1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 12.0, 13.0 }, { 3.0, 4.0 },
FALSE, {
P_D,
P_S } },
2113 { 1.0, -1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 3.0, 4.0 },
FALSE, {
P_S,
P_D } },
2114 { 0.0, -10.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 1.0 }, { 2.0, 3.0 },
FALSE, {
P_D,
P_S } },
2115 { -5.0, -4.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 5.0 }, { -1.0, -0.5 },
FALSE, {
P_S,
P_D } },
2116 { -5.0, -5.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 5.0 }, { -0.5, 0.0 },
FALSE, {
P_D,
P_D } },
2117 { 2.0, 0.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 7.0, 7.0 }, { 6.0, 6.5 },
FALSE, {
P_S,
P_D } },
2118 { 2.0, 1.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 8.0, 8.0 }, { 6.0, 6.5 },
FALSE, {
P_S,
P_D } },
2119 { 2.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 7.0, 7.0 }, { 4.0, 5.0 },
FALSE, {
P_D,
P_D } },
2120 { 1.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 6.0 }, { 3.0, 4.0 },
FALSE, {
P_S,
P_D } },
2121 { -10.0, 1.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 6.0 }, { -3.0, -3.0 },
FALSE, {
P_D,
P_D } },
2122 { 0.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 5.0 }, { 2.0, 3.0 },
FALSE, {
P_S,
P_D } },
2123 { 1.0, -10.0, -5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 0.0 }, { 2.0, 3.0 },
FALSE, {
P_D,
P_S } },
2124 { -10.0, 1.0, 5.0, { 8.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 6.0 }, { -1.0, -3.0 },
FALSE, {
P_S,
P_D } },
2126 { 1.0, 0.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 12.0 }, { 3.0, 4.0 },
TRUE, {
P_Z,
P_S } },
2127 { 1.0, 1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 13.0 }, { 3.0, 4.0 },
TRUE, {
P_Z,
P_S } },
2128 { 1.0, -1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 3.0, 4.0 },
TRUE, {
P_S,
P_Z } },
2129 { 0.0, -10.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 1.0 }, { 2.0, 3.0 },
TRUE, {
P_Z,
P_S } },
2130 { -5.0, -4.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 1.0, 11.0 }, { -3.0, 7.0 },
TRUE, {
P_S,
P_Z } },
2131 { -5.0, -5.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
TRUE, {
P_Z,
P_Z } },
2132 { 0.0, 0.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 3.0, 2.0 }, { 3.0, 2.0 },
TRUE, {
P_S,
P_Z } },
2133 { 0.0, 0.0, 5.0, { 1.0, 2.0, 1.0 }, { 2.0, 3.0, 5.0 }, { 1.5, 2.0, 1.5 }, { 2.5, 3.0, 5.0 },
TRUE, {
P_S,
P_Z,
P_S } },
2134 { 0.0, 0.0, 5.0, { 1.0, 2.0, 1.0 }, { 2.0, 3.0, 5.0 }, { 1.5, 2.5, 1.0 }, { 2.5, 3.0, 4.5 },
TRUE, {
P_S,
P_S,
P_Z } },
2135 { 0.0, 0.0, 5.0, { 1.0, 2.0, 1.0 }, { 2.0, 3.0, 5.0 }, { 2.0, 2.0, 1.0 }, { 2.5, 2.5, 4.5 },
TRUE, {
P_S,
P_Z,
P_Z } },
2136 { 0.0, 0.0, 5.0, { 1.0, 2.0, 1.0 }, { 2.0, 3.0, 5.0 }, { 1.0, 2.0, 1.0 }, { 2.0, 3.0, 5.0 },
TRUE, {
P_Z,
P_Z,
P_Z } },
2137 { 2.0, 1.0, 1.0, { 1.0, 2.0, 3.0 }, { 2.0, 3.0, 4.0 }, { 3.0, 2.0, 4.0 }, { 4.0, 3.0, 4.0 },
TRUE, {
P_S,
P_Z,
P_S } },
2138 { 0.0, 0.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 3.0, 2.0 }, { 3.0, 2.0 },
TRUE, {
P_S,
P_Z } },
2139 { 0.0, 0.0, 5.0, { 1.0, 2.0, 6.0 }, { 2.0, 3.0, 4.0 }, { 1.0, 2.0, 6.0 }, { 2.0, 3.0, 4.0 },
TRUE, {
P_S,
P_Z,
P_S } },
2140 { 2.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
TRUE, {
P_Z,
P_Z } },
2141 { 1.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 1.0, 11.0 }, { 3.0, 13.0 },
TRUE, {
P_S,
P_Z } },
2142 { -10.0, 1.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
TRUE, {
P_Z,
P_Z } },
2143 { 0.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 11.0 }, { 2.0, 13.0 },
TRUE, {
P_S,
P_Z } },
2144 { 1.0, -10.0, -5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 0.0 }, { 2.0, 3.0 },
TRUE, {
P_Z,
P_S } },
2145 { -10.0, 1.0, 5.0, { 8.0, 11.0 }, { 2.0, 3.0 }, { -1.0, 11.0 }, { -8.0, 2.0 },
TRUE, {
P_S,
P_Z } },
2147 { 1.0, 0.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 11.0, 11.0 }, { 3.0, 3.0 },
TRUE, {
P_D,
P_S } },
2148 { 1.0, 1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 11.0, 12.0 }, { 3.0, 3.0 },
TRUE, {
P_D,
P_S } },
2149 { 1.0, -1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 11.0, 10.0 }, { 3.0, 3.0 },
TRUE, {
P_S,
P_D } },
2150 { 0.0, -10.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 1.0 }, { 2.0, 3.0 },
TRUE, {
P_D,
P_S } },
2151 { -5.0, -4.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 7.0 }, { -3.0, 3.0 },
TRUE, {
P_S,
P_D } },
2152 { -5.0, -5.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 6.0 }, { -3.0, 3.0 },
TRUE, {
P_D,
P_D } },
2153 { 2.0, 0.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 4.0, 3.0 }, { 5.0, 3.0 },
TRUE, {
P_S,
P_D } },
2154 { 2.0, 1.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 4.0, 4.0 }, { 5.0, 3.0 },
TRUE, {
P_S,
P_D } },
2155 { 2.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 12.0, 1.0 }, { 4.0, 3.0 },
TRUE, {
P_D,
P_D } },
2156 { 1.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 11.0, 1.0 }, { 3.0, 3.0 },
TRUE, {
P_S,
P_D } },
2157 { -10.0, 1.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 12.0 }, { -8.0, 3.0 },
TRUE, {
P_D,
P_D } },
2158 { 0.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 1.0 }, { 2.0, 3.0 },
TRUE, {
P_S,
P_D } },
2159 { 1.0, -10.0, -5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 0.0 }, { 2.0, 3.0 },
TRUE, {
P_D,
P_S } },
2160 { -10.0, 1.0, 5.0, { 8.0, 11.0 }, { 2.0, 3.0 }, { -2.0, 12.0 }, { -8.0, 3.0 },
TRUE, {
P_S,
P_D } },
2162 { 1.0, 0.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 12.0 }, { 2.0, 4.0 },
FALSE, {
P_D_Z,
P_S } },
2163 { 1.0, 1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 13.0 }, { 2.0, 4.0 },
FALSE, {
P_D_Z,
P_S } },
2164 { 1.0, -1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 3.0, 3.0 },
FALSE, {
P_S,
P_D_Z } },
2165 { 0.0, -10.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 1.0 }, { 2.0, 3.0 },
FALSE, {
P_D_Z,
P_S } },
2166 { -5.0, -4.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 11.0 }, { -1.0, 3.0 },
FALSE, {
P_S,
P_D_Z } },
2167 { -5.0, -5.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
FALSE, {
P_D_Z,
P_D_Z } },
2168 { 2.0, 0.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 7.0, 2.0 }, { 6.0, 3.0 },
FALSE, {
P_S,
P_D_Z } },
2169 { 2.0, 1.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 8.0, 2.0 }, { 6.0, 3.0 },
FALSE, {
P_S,
P_D_Z } },
2170 { 2.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
FALSE, {
P_D_Z,
P_D_Z } },
2171 { 1.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 11.0 }, { 3.0, 3.0 },
FALSE, {
P_S,
P_D_Z } },
2172 { -10.0, 1.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
FALSE, {
P_D_Z,
P_D_Z } },
2173 { 0.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 5.0, 11.0 }, { 2.0, 3.0 },
FALSE, {
P_S,
P_D_Z } },
2174 { 1.0, -10.0, -5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 0.0 }, { 2.0, 3.0 },
FALSE, {
P_D_Z,
P_S } },
2175 { -10.0, 1.0, 5.0, { 8.0, 11.0 }, { 2.0, 3.0 }, { 6.0, 11.0 }, { -1.0, 3.0 },
FALSE, {
P_S,
P_D_Z } },
2177 { 1.0, 0.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 12.0 }, { 3.0, 4.0 },
TRUE, {
P_D_Z,
P_S } },
2178 { 1.0, 1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 13.0 }, { 3.0, 4.0 },
TRUE, {
P_D_Z,
P_S } },
2179 { 1.0, -1.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 3.0, 4.0 },
TRUE, {
P_S,
P_D_Z } },
2180 { 0.0, -10.0, 0.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 1.0 }, { 2.0, 3.0 },
TRUE, {
P_D_Z,
P_S } },
2181 { -5.0, -4.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 1.0, 11.0 }, { -3.0, 7.0 },
TRUE, {
P_S,
P_D_Z } },
2182 { -5.0, -5.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
TRUE, {
P_D_Z,
P_D_Z } },
2183 { 2.0, 0.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 5.0, 2.0 }, { 5.0, 2.0 },
TRUE, {
P_S,
P_D_Z } },
2184 { 2.0, 1.0, 5.0, { 1.0, 2.0 }, { 2.0, 3.0 }, { 6.0, 2.0 }, { 5.0, 1.0 },
TRUE, {
P_S,
P_D_Z } },
2185 { 2.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
TRUE, {
P_D_Z,
P_D_Z } },
2186 { 1.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 1.0, 11.0 }, { 3.0, 13.0 },
TRUE, {
P_S,
P_D_Z } },
2187 { -10.0, 1.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 10.0, 11.0 }, { 2.0, 3.0 },
TRUE, {
P_D_Z,
P_D_Z } },
2188 { 0.0, -10.0, 5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 11.0 }, { 2.0, 13.0 },
TRUE, {
P_S,
P_D_Z } },
2189 { 1.0, -10.0, -5.0, { 10.0, 11.0 }, { 2.0, 3.0 }, { 0.0, 0.0 }, { 2.0, 3.0 },
TRUE, {
P_D_Z,
P_S } },
2190 { -10.0, 1.0, 5.0, { 8.0, 11.0 }, { 2.0, 3.0 }, { -1.0, 11.0 }, { -8.0, 2.0 },
TRUE, {
P_S,
P_D_Z } },
2209 win_skip(
"ApplyCharacterSpacing() is not supported.\n");
2225 offsets[0].ascenderOffset = 23.0;
2226 offsets[1].ascenderOffset = 32.0;
2227 offsets[2].ascenderOffset = 31.0;
2231 glyph_count =
ptr->advances[2] > 0.0 ? 3 : 2;
2232 if (
ptr->single_cluster)
2236 props[0].isClusterStart = 1;
2243 props[0].isClusterStart =
props[1].isClusterStart = 1;
2248 hr = IDWriteTextAnalyzer1_ApplyCharacterSpacing(analyzer,
2263 ok(
ptr->modified_advances[0] ==
advances[0],
"Got advance[0] %.2f, expected %.2f.\n",
advances[0],
ptr->modified_advances[0]);
2264 ok(
ptr->modified_advances[1] ==
advances[1],
"Got advance[1] %.2f, expected %.2f.\n",
advances[1],
ptr->modified_advances[1]);
2265 if (glyph_count > 2)
2266 ok(
ptr->modified_advances[2] ==
advances[2],
"Got advance[2] %.2f, expected %.2f.\n",
advances[2],
ptr->modified_advances[2]);
2268 ok(
ptr->modified_offsets[0] ==
offsets[0].advanceOffset,
"Got offset[0] %.2f, expected %.2f.\n",
2269 offsets[0].advanceOffset,
ptr->modified_offsets[0]);
2270 ok(
ptr->modified_offsets[1] ==
offsets[1].advanceOffset,
"Got offset[1] %.2f, expected %.2f.\n",
2271 offsets[1].advanceOffset,
ptr->modified_offsets[1]);
2272 if (glyph_count > 2)
2273 ok(
ptr->modified_offsets[2] ==
offsets[2].advanceOffset,
"Got offset[2] %.2f, expected %.2f.\n",
2274 offsets[2].advanceOffset,
ptr->modified_offsets[2]);
2276 ok(
offsets[0].ascenderOffset == 23.0,
"Unexpected ascenderOffset %.2f.\n",
offsets[0].ascenderOffset);
2277 ok(
offsets[1].ascenderOffset == 32.0,
"Unexpected ascenderOffset %.2f.\n",
offsets[1].ascenderOffset);
2278 ok(
offsets[2].ascenderOffset == 31.0,
"Unexpected ascenderOffset %.2f.\n",
offsets[2].ascenderOffset);
2281 ok(
ptr->modified_advances[0] ==
advances[0],
"Got advance[0] %.2f, expected %.2f.\n",
advances[0],
ptr->modified_advances[0]);
2282 ok(
ptr->modified_advances[1] ==
advances[1],
"Got advance[1] %.2f, expected %.2f.\n",
advances[1],
ptr->modified_advances[1]);
2283 ok(
ptr->offsets[0] ==
offsets[0].advanceOffset,
"Got offset[0] %.2f, expected %.2f.\n",
2284 offsets[0].advanceOffset,
ptr->modified_offsets[0]);
2285 ok(
ptr->offsets[1] ==
offsets[1].advanceOffset,
"Got offset[1] %.2f, expected %.2f.\n",
2286 offsets[1].advanceOffset,
ptr->modified_offsets[1]);
2287 ok(
offsets[0].ascenderOffset == 23.0,
"Unexpected ascenderOffset %.2f.\n",
offsets[0].ascenderOffset);
2288 ok(
offsets[1].ascenderOffset == 32.0,
"Unexpected ascenderOffset %.2f.\n",
offsets[1].ascenderOffset);
2298 offsets[0].ascenderOffset = 23.0f;
2299 offsets[1].ascenderOffset = 32.0f;
2300 offsets[2].ascenderOffset = 31.0f;
2302 hr = IDWriteTextAnalyzer1_ApplyCharacterSpacing(analyzer,
2318 ok(
ptr->modified_advances[0] ==
advances[0],
"Got advance[0] %.2f, expected %.2f.\n",
advances[0],
ptr->modified_advances[0]);
2319 ok(
ptr->modified_advances[1] ==
advances[1],
"Got advance[1] %.2f, expected %.2f.\n",
advances[1],
ptr->modified_advances[1]);
2320 if (glyph_count > 2)
2321 ok(
ptr->modified_advances[2] ==
advances[2],
"Got advance[2] %.2f, expected %.2f.\n",
advances[2],
ptr->modified_advances[2]);
2323 ok(
ptr->modified_offsets[0] ==
offsets[0].advanceOffset,
"Got offset[0] %.2f, expected %.2f.\n",
2324 offsets[0].advanceOffset,
ptr->modified_offsets[0]);
2325 ok(
ptr->modified_offsets[1] ==
offsets[1].advanceOffset,
"Got offset[1] %.2f, expected %.2f.\n",
2326 offsets[1].advanceOffset,
ptr->modified_offsets[1]);
2327 if (glyph_count > 2)
2328 ok(
ptr->modified_offsets[2] ==
offsets[2].advanceOffset,
"Got offset[2] %.2f, expected %.2f.\n",
2329 offsets[2].advanceOffset,
ptr->modified_offsets[2]);
2331 ok(
offsets[0].ascenderOffset == 23.0f,
"Unexpected ascenderOffset %.2f.\n",
offsets[0].ascenderOffset);
2332 ok(
offsets[1].ascenderOffset == 32.0f,
"Unexpected ascenderOffset %.2f.\n",
offsets[1].ascenderOffset);
2333 ok(
offsets[2].ascenderOffset == 31.0f,
"Unexpected ascenderOffset %.2f.\n",
offsets[2].ascenderOffset);
2340 ok(
ptr->offsets[0] ==
offsets[0].advanceOffset,
"Got offset[0] %.2f, expected %.2f.\n",
2341 offsets[0].advanceOffset,
ptr->modified_offsets[0]);
2342 ok(
ptr->offsets[1] ==
offsets[1].advanceOffset,
"Got offset[1] %.2f, expected %.2f.\n",
2343 offsets[1].advanceOffset,
ptr->modified_offsets[1]);
2344 ok(
offsets[0].ascenderOffset == 23.0f,
"Unexpected ascenderOffset %.2f.\n",
offsets[0].ascenderOffset);
2345 ok(
offsets[1].ascenderOffset == 32.0f,
"Unexpected ascenderOffset %.2f.\n",
offsets[1].ascenderOffset);
2351 IDWriteTextAnalyzer1_Release(analyzer);
2373 static char buff[64];
2374 sprintf(
buff,
"{%.2f, %.2f, %.2f, %.2f, %.2f, %.2f}",
m->m11,
m->m12,
2375 m->m21,
m->m22,
m->dx,
m->dy);
2383 FLOAT originx, originy;
2391 win_skip(
"GetGlyphOrientationTransform() is not supported.\n");
2397 hr = IDWriteTextAnalyzer1_GetGlyphOrientationTransform(analyzer,
2400 ok(
m.m11 == 0.0,
"got %.2f\n",
m.m11);
2405 hr = IDWriteTextAnalyzer1_GetGlyphOrientationTransform(analyzer,
ot_tests[
i].
angle,
2411 IDWriteTextAnalyzer1_Release(analyzer);
2416 win_skip(
"IDWriteTextAnalyzer2::GetGlyphOrientationTransform() is not supported.\n");
2422 hr = IDWriteTextAnalyzer2_GetGlyphOrientationTransform(analyzer2,
2425 ok(
m.m11 == 0.0,
"got %.2f\n",
m.m11);
2436 hr = IDWriteTextAnalyzer2_GetGlyphOrientationTransform(analyzer2,
ot_tests[
i].
angle,
2442 hr = IDWriteTextAnalyzer2_GetGlyphOrientationTransform(analyzer2,
ot_tests[
i].
angle,
2475 m_exp.
dx = originx + originy;
2476 m_exp.
dy = originy - originx;
2479 m_exp.
dx = originx + originx;
2480 m_exp.
dy = originy + originy;
2483 m_exp.
dx = originx - originy;
2484 m_exp.
dy = originy + originx;
2493 IDWriteTextAnalyzer2_Release(analyzer2);
2508 win_skip(
"GetBaseline() is not supported.\n");
2522 ok(!exists,
"Unexpected flag %d.\n", exists);
2530 ok(!exists,
"Unexpected flag %d.\n", exists);
2538 ok(!exists,
"Unexpected flag %d.\n", exists);
2546 ok(!exists,
"Unexpected flag %d.\n", exists);
2554 ok(!exists,
"Unexpected flag %d.\n", exists);
2556 IDWriteFontFace_Release(fontface);
2557 IDWriteTextAnalyzer1_Release(analyzer);
2562 int x = *(
int *)&
left;
2570 return abs(
x -
y) <= 8;
2590 ok(!!analyzer,
"Failed to create analyzer instance.\n");
2594 IDWriteFontFace_GetMetrics(fontface, &fontmetrics);
2597 hr = IDWriteTextAnalyzer_GetGlyphs(analyzer,
L"A", 1, fontface,
FALSE,
FALSE, &
sa,
NULL,
NULL,
NULL,
NULL, 0, 1,
2598 clustermap, textprops, glyphs, glyphprops, &
count);
2599 ok(
hr ==
S_OK,
"Failed to get glyphs, hr %#lx.\n",
hr);
2602 for (emsize = 12.0f; emsize <= 20.0f; emsize += 1.0f)
2607 hr = IDWriteTextAnalyzer_GetGlyphPlacements(analyzer,
L"A", clustermap, textprops, 1, glyphs, glyphprops,
2608 count, fontface, emsize,
FALSE,
FALSE, &
sa,
NULL,
NULL,
NULL, 0, &
advance,
offsets);
2609 ok(
hr ==
S_OK,
"Failed to get glyph placements, hr %#lx.\n",
hr);
2614 hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(fontface, emsize, ppdip,
NULL,
FALSE,
2619 hr = IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(analyzer,
L"A", clustermap, textprops, 1, glyphs,
2620 glyphprops,
count, fontface, emsize, ppdip,
NULL,
FALSE,
FALSE,
FALSE, &
sa,
NULL,
NULL,
NULL, 0,
2622 ok(
hr ==
S_OK,
"Failed to get glyph placements, hr %#lx.\n",
hr);
2623 ok(compatadvance ==
expected,
"%.0f: got advance %f, expected %f, natural %f\n", emsize,
2628 hr = IDWriteFontFace_GetGdiCompatibleGlyphMetrics(fontface, emsize, ppdip,
NULL,
FALSE,
2633 hr = IDWriteTextAnalyzer_GetGdiCompatibleGlyphPlacements(analyzer,
L"A", clustermap, textprops, 1, glyphs,
2634 glyphprops,
count, fontface, emsize, ppdip,
NULL,
FALSE,
FALSE,
FALSE, &
sa,
NULL,
NULL,
NULL, 0,
2636 ok(
hr ==
S_OK,
"Failed to get glyph placements, hr %#lx.\n",
hr);
2637 ok(
float_eq(compatadvance,
expected),
"%.0f: got advance %f, expected %f, natural %f\n", emsize,
2641 IDWriteFontFace_Release(fontface);
2642 IDWriteTextAnalyzer_Release(analyzer);
2656 { 0x645, 0x6cc, 0x200c, 0x6a9, 0x646, 0x645, 0 },
2658 { 1, 1, 1, 1, 1, 1 },
2659 { 1, 1, 1, 1, 1, 1 }
2662 { 0x645, 0x6cc, 0x200c, 0x6a9, 0x646, 0x645, 0 },
2664 { 0, 0, 0, 0, 0, 0 },
2665 { 1, 1, 1, 1, 1, 1 }
2668 { 0x200c, 0x645, 0x6cc, 0x6a9, 0x646, 0x645, 0 },
2670 { 1, 1, 1, 1, 1, 1 },
2671 { 1, 1, 1, 1, 1, 1 }
2674 { 0x200c, 0x645, 0x6cc, 0x6a9, 0x646, 0x645, 0 },
2676 { 0, 0, 0, 0, 0, 0 },
2677 { 0, 1, 1, 1, 1, 1 }
2680 {
'A', 0x200c,
'B', 0 },
2686 {
'A', 0x200c,
'B', 0 },
2692 {
LRE,
PDF,
'a',
'b', 0 },
2698 {
'a',
LRE,
PDF,
'b', 0 },
2704 {
RLE,
PDF,
'a',
'b', 0 },
2710 {
'a',
RLE,
PDF,
'b', 0 },
2716 {
'a',
RLE,
PDF,
'b', 0 },
2722 {
LRE,
PDF,
'a',
'b', 0 },
2728 {
PDF,
'a',
'b', 0 },
2734 {
LRE,
'a',
'b',
PDF, 0 },
2741 {
LRI,
'a',
'b',
PDI, 0 },
2748 {
RLI,
'a',
'b',
PDI, 0 },
2761 unsigned int i, failcount = 0;
2774 for (
i = 0;
i <
len;
i++) {
2775 if (
test->explicit[
i] !=
explicit[
i]) {
2779 ok(0,
"\tat %u, explicit level %u, expected %u\n",
i,
explicit[
i],
test->explicit[
i]);
2782 ok(0,
"\tat %u, explicit level %u, expected %u\n",
i,
explicit[
i],
test->explicit[
i]);
2797 for (
i = 0;
i <
len;
i++) {
2802 ok(0,
"\tat %u, resolved level %u, expected %u\n",
i,
resolved[
i],
test->resolved[
i]);
2805 ok(0,
"\tat %u, resolved level %u, expected %u\n",
i,
resolved[
i],
test->resolved[
i]);
2811 ok(1,
"test %u: marked as \"todo_wine\" but succeeds\n", seq);
2822 ok(!!analyzer,
"Failed to create analyzer instance.\n");
2832 ok(0,
"test %u: increase BIDI_LEVELS_COUNT to at least %u\n",
i,
len);
2840 hr = IDWriteTextAnalyzer_AnalyzeBidi(analyzer, &
analysissource.IDWriteTextAnalysisSource_iface, 0,
2842 ok(
hr ==
S_OK,
"%u: unexpected hr %#lx.\n",
i,
hr);
2849 IDWriteTextAnalyzer_Release(analyzer);
2865 unsigned short justification[10];
2918 UINT16 clustermap[16], glyphs[16];
2927 ok(!!analyzer,
"Failed to create analyzer instance.\n");
2943 FALSE,
sa.script ==
Script_Arabic, &
sa,
L"en-US",
NULL,
NULL,
NULL, 0,
ARRAY_SIZE(glyphs), clustermap,
2944 text_props, glyphs, glyph_props, &glyph_count);
2947 for (
j = 0;
j < glyph_count; ++
j)
2950 ok(glyph_props[
j].justification ==
tests[
i].justification[
j],
"Unexpected justification value %u.\n",
2951 glyph_props[
j].justification);
2958 IDWriteFontFace_Release(fontface);
2969 win_skip(
"failed to create factory\n");
2991 IDWriteFactory_Release(
factory);
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
static struct sockaddr_in sa
static const GUID * classes[]
HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnknown **ret)
#define INVALID_HANDLE_VALUE
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
@ DWRITE_SCRIPT_SHAPES_NO_VISUAL
@ DWRITE_SCRIPT_SHAPES_DEFAULT
@ DWRITE_BREAK_CONDITION_MUST_BREAK
@ DWRITE_BREAK_CONDITION_CAN_BREAK
@ DWRITE_BREAK_CONDITION_MAY_NOT_BREAK
@ DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE
@ DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL
@ DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL
@ DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL
@ DWRITE_FONT_FACE_TYPE_TRUETYPE
@ DWRITE_FONT_SIMULATIONS_NONE
@ DWRITE_FACTORY_TYPE_ISOLATED
@ DWRITE_READING_DIRECTION_RIGHT_TO_LEFT
@ DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
@ DWRITE_BASELINE_DEFAULT
@ DWRITE_BASELINE_CENTRAL
DWRITE_GLYPH_ORIENTATION_ANGLE
@ DWRITE_GLYPH_ORIENTATION_ANGLE_180_DEGREES
@ DWRITE_GLYPH_ORIENTATION_ANGLE_90_DEGREES
@ DWRITE_GLYPH_ORIENTATION_ANGLE_0_DEGREES
@ DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES
@ SCRIPT_JUSTIFY_ARABIC_HA
@ SCRIPT_JUSTIFY_ARABIC_SEEN
@ SCRIPT_JUSTIFY_ARABIC_BLANK
@ SCRIPT_JUSTIFY_ARABIC_NORMAL
@ SCRIPT_JUSTIFY_ARABIC_SEEN_M
@ SCRIPT_JUSTIFY_ARABIC_BARA
@ SCRIPT_JUSTIFY_CHARACTER
@ SCRIPT_JUSTIFY_ARABIC_ALEF
@ SCRIPT_JUSTIFY_ARABIC_KASHIDA
static const FxOffsetAndName offsets[]
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble r
GLuint GLuint GLsizei GLenum const GLvoid * indices
GLsizei const GLchar *const * strings
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
const char * winetest_platform
#define todo_wine_if(is_todo)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
#define memcpy(s1, s2, n)
static struct test_info tests[]
static void test_GetTypographicFeatures(void)
static IDWriteTextAnalysisSinkVtbl analysissinkvtbl2
static struct sa_test sa_tests[]
static const struct textcomplexity_test textcomplexity_tests[]
static void test_GetGdiCompatibleGlyphPlacements(void)
static WORD table_read_be_word(const struct dwrite_fonttable *table, unsigned int offset)
static void test_AnalyzeBidi(void)
static const struct orientation_transf_test ot_tests[]
static DWRITE_READING_DIRECTION WINAPI analysissource_GetParagraphReadingDirection(IDWriteTextAnalysisSource *iface)
static ULONG WINAPI analysissource_Release(IDWriteTextAnalysisSource *iface)
static void _delete_testfontfile(const WCHAR *filename, int line)
static HRESULT WINAPI analysissink_SetBidiLevel(IDWriteTextAnalysisSink *iface, UINT32 position, UINT32 length, UINT8 explicitLevel, UINT8 resolvedLevel)
static unsigned int get_glyph_class(const struct dwrite_fonttable *table, UINT16 glyph)
static HRESULT WINAPI analysissource_GetNumberSubstitution(IDWriteTextAnalysisSource *iface, UINT32 position, UINT32 *text_len, IDWriteNumberSubstitution **substitution)
#define BIDI_LEVELS_COUNT
static void test_AnalyzeLineBreakpoints(void)
static const struct bidi_test bidi_tests[]
static BOOL float_eq(FLOAT left, FLOAT right)
static void test_ApplyCharacterSpacing(void)
static void * create_text_analyzer(REFIID riid)
static HRESULT WINAPI analysissink_SetScriptAnalysis2(IDWriteTextAnalysisSink *iface, UINT32 position, UINT32 length, DWRITE_SCRIPT_ANALYSIS const *sa)
static void test_uint(UINT32 actual, UINT32 expected, const char *name, const struct testcontext *ctxt)
#define DELETE_FONTFILE(filename)
static DWRITE_SCRIPT_ANALYSIS g_sa
static void add_call(struct call_sequence **seq, int sequence_index, const struct call_entry *call)
static const struct spacing_test spacing_tests[]
static HRESULT WINAPI analysissink_SetNumberSubstitution(IDWriteTextAnalysisSink *iface, UINT32 position, UINT32 length, IDWriteNumberSubstitution *substitution)
static IDWriteFontFace * create_testfontface(const WCHAR *filename)
static WCHAR * create_testfontfile(const WCHAR *filename)
static void get_fontface_advances(IDWriteFontFace *fontface, FLOAT emsize, const UINT16 *glyphs, FLOAT *advances, UINT32 count)
static void test_GetGlyphs(void)
static void init_call_sequences(struct call_sequence **seq, int n)
static void init_expected_sa(struct call_sequence **seq, const struct sa_test *test)
@ GDEF_CLASS_UNCLASSIFIED
static ULONG WINAPI analysissource_AddRef(IDWriteTextAnalysisSource *iface)
static HRESULT WINAPI analysissink_SetLineBreakpoints(IDWriteTextAnalysisSink *iface, UINT32 position, UINT32 length, DWRITE_LINE_BREAKPOINT const *breakpoints)
static IDWriteTextAnalysisSourceVtbl analysissourcevtbl
static void test_numbersubstitution(void)
static void test_glyph_justification_property(void)
static void test_AnalyzeScript(void)
static DWRITE_LINE_BREAKPOINT g_actual_bp[BREAKPOINT_COUNT]
static void compare_breakpoints(const struct linebreaks_test *test, DWRITE_LINE_BREAKPOINT *actual)
static UINT8 g_resolved_levels[BIDI_LEVELS_COUNT]
#define ok_sequence(seq, index, exp, contx, todo)
static IDWriteTextAnalysisSink analysissink
static void ok_sequence_(struct call_sequence **seq, int sequence_index, const struct call_entry *expected, const char *context, BOOL todo, const char *file, int line)
static UINT8 g_explicit_levels[BIDI_LEVELS_COUNT]
static void test_GetGlyphOrientationTransform(void)
static HRESULT WINAPI analysissource_GetTextAtPosition(IDWriteTextAnalysisSource *iface, UINT32 position, WCHAR const **text, UINT32 *text_len)
static void test_GetScriptProperties(void)
static void init_textsource(struct testanalysissource *source, const WCHAR *text, INT text_length, DWRITE_READING_DIRECTION direction)
#define NUM_CALL_SEQUENCES
static ULONG WINAPI analysissink_Release(IDWriteTextAnalysisSink *iface)
static void get_enus_string(IDWriteLocalizedStrings *strings, WCHAR *buff, unsigned int size)
static HRESULT WINAPI analysissource_QueryInterface(IDWriteTextAnalysisSource *iface, REFIID riid, void **obj)
static IDWriteFontFace * create_fontface(void)
static HRESULT WINAPI analysissink_SetScriptAnalysis(IDWriteTextAnalysisSink *iface, UINT32 position, UINT32 length, DWRITE_SCRIPT_ANALYSIS const *sa)
static struct testanalysissource analysissource
static IDWriteTextAnalysisSink analysissink2
static void compare_bidi_levels(unsigned int seq, const struct bidi_test *test, UINT32 len, UINT8 *explicit, UINT8 *resolved)
static const char * dbgstr_matrix(const DWRITE_MATRIX *m)
static void test_GetGlyphPlacements(void)
static struct call_sequence * expected_seq[1]
static HRESULT WINAPI analysissource_GetLocaleName(IDWriteTextAnalysisSource *iface, UINT32 position, UINT32 *text_len, WCHAR const **locale)
static ULONG WINAPI analysissink_AddRef(IDWriteTextAnalysisSink *iface)
static const char * get_analysis_kind_name(enum analysis_kind kind)
static struct call_sequence * sequences[NUM_CALL_SEQUENCES]
static IDWriteTextAnalysisSinkVtbl analysissinkvtbl
static void test_GetTextComplexity(void)
static const struct linebreaks_test linebreaks_tests[]
static HRESULT WINAPI analysissource_GetTextBeforePosition(IDWriteTextAnalysisSource *iface, UINT32 position, WCHAR const **text, UINT32 *text_len)
static void get_fontface_glyphs(IDWriteFontFace *fontface, const WCHAR *str, UINT16 *glyphs)
static const void * table_read_ensure(const struct dwrite_fonttable *table, unsigned int offset, unsigned int size)
static HRESULT WINAPI analysissink_QueryInterface(IDWriteTextAnalysisSink *iface, REFIID riid, void **obj)
static void test_glyph_props(IDWriteTextAnalyzer *analyzer, const WCHAR *family, const WCHAR *face, IDWriteFontFace *fontface)
static void test_GetBaseline(void)
static struct testanalysissource * impl_from_IDWriteTextAnalysisSource(IDWriteTextAnalysisSource *iface)
static void get_script_analysis(const WCHAR *str, DWRITE_SCRIPT_ANALYSIS *sa)
static int gdef_class_compare_format2(const void *g, const void *r)
static const WCHAR pathW[]
#define cmp(status, error)
#define MAKEINTRESOURCE(i)
#define IsEqualIID(riid1, riid2)
static const char *static const char const char DWORD void DWORD *static const char const char DWORD void DWORD *static const char DWORD DWORD void * buff
UINT8 breakConditionBefore
UINT8 breakConditionAfter
WCHAR lfFaceName[LF_FACESIZE]
DWRITE_READING_DIRECTION direction
UINT8 resolved[BIDI_LEVELS_COUNT]
const WCHAR text[BIDI_LEVELS_COUNT]
struct script_analysis sa
struct call_entry * sequence
const WCHAR text[BREAKPOINT_COUNT+1]
DWRITE_LINE_BREAKPOINT bp[BREAKPOINT_COUNT]
DWRITE_GLYPH_ORIENTATION_ANGLE angle
struct script_analysis sa[10]
DWRITE_SCRIPT_SHAPES shapes
FLOAT modified_advances[3]
DWRITE_SHAPING_GLYPH_PROPERTIES props[3]
FLOAT modified_offsets[3]
IDWriteTextAnalysisSource IDWriteTextAnalysisSource_iface
DWRITE_READING_DIRECTION direction
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
static const WCHAR props[]
DWORD WINAPI GetLastError(void)
#define E_NOT_SUFFICIENT_BUFFER