35#define MS_CMAP_TAG DWRITE_MAKE_OPENTYPE_TAG('c','m','a','p')
36#define MS_VDMX_TAG DWRITE_MAKE_OPENTYPE_TAG('V','D','M','X')
37#define MS_GASP_TAG DWRITE_MAKE_OPENTYPE_TAG('g','a','s','p')
38#define MS_CPAL_TAG DWRITE_MAKE_OPENTYPE_TAG('C','P','A','L')
39#define MS_OS2_TAG DWRITE_MAKE_OPENTYPE_TAG('O','S','/','2')
40#define MS_HEAD_TAG DWRITE_MAKE_OPENTYPE_TAG('h','e','a','d')
41#define MS_HHEA_TAG DWRITE_MAKE_OPENTYPE_TAG('h','h','e','a')
42#define MS_POST_TAG DWRITE_MAKE_OPENTYPE_TAG('p','o','s','t')
43#define MS_GSUB_TAG DWRITE_MAKE_OPENTYPE_TAG('G','S','U','B')
44#define MS_KERN_TAG DWRITE_MAKE_OPENTYPE_TAG('k','e','r','n')
45#define MS_GLYF_TAG DWRITE_MAKE_OPENTYPE_TAG('g','l','y','f')
46#define MS_CFF__TAG DWRITE_MAKE_OPENTYPE_TAG('C','F','F',' ')
47#define MS_CFF2_TAG DWRITE_MAKE_OPENTYPE_TAG('C','F','F','2')
48#define MS_COLR_TAG DWRITE_MAKE_OPENTYPE_TAG('C','O','L','R')
49#define MS_SVG__TAG DWRITE_MAKE_OPENTYPE_TAG('S','V','G',' ')
50#define MS_SBIX_TAG DWRITE_MAKE_OPENTYPE_TAG('s','b','i','x')
51#define MS_MAXP_TAG DWRITE_MAKE_OPENTYPE_TAG('m','a','x','p')
52#define MS_CBLC_TAG DWRITE_MAKE_OPENTYPE_TAG('C','B','L','C')
55#define MS_PNG__TAG DWRITE_MAKE_OPENTYPE_TAG('p','n','g',' ')
56#define MS_JPG__TAG DWRITE_MAKE_OPENTYPE_TAG('j','p','g',' ')
57#define MS_TIFF_TAG DWRITE_MAKE_OPENTYPE_TAG('t','i','f','f')
59#define MS_WOFF_TAG DWRITE_MAKE_OPENTYPE_TAG('w','O','F','F')
60#define MS_WOF2_TAG DWRITE_MAKE_OPENTYPE_TAG('w','O','F','2')
63#define GET_BE_WORD(x) (x)
64#define GET_BE_DWORD(x) (x)
65#define GET_LE_WORD(x) RtlUshortByteSwap(x)
66#define GET_LE_DWORD(x) RtlUlongByteSwap(x)
68#define GET_BE_WORD(x) RtlUshortByteSwap(x)
69#define GET_BE_DWORD(x) RtlUlongByteSwap(x)
70#define GET_LE_WORD(x) (x)
71#define GET_LE_DWORD(x) (x)
74#define DEFINE_EXPECT(func) \
75 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
77#define SET_EXPECT(func) \
78 do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
80#define CHECK_EXPECT2(func) \
82 ok(expect_ ##func, "unexpected call " #func "\n"); \
83 called_ ## func = TRUE; \
86#define CHECK_EXPECT(func) \
88 CHECK_EXPECT2(func); \
89 expect_ ## func = FALSE; \
92#define CHECK_CALLED(func) \
94 ok(called_ ## func, "expected " #func "\n"); \
95 expect_ ## func = called_ ## func = FALSE; \
98#define CLEAR_CALLED(func) \
99 expect_ ## func = called_ ## func = FALSE
103#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
107 IUnknown_AddRef(
obj);
108 rc = IUnknown_Release(
obj);
109 ok_(__FILE__,
line)(rc ==
ref,
"expected refcount %ld, got %ld\n",
ref, rc);
112#define EXPECT_REF_BROKEN(obj,ref,brokenref) _expect_ref_broken((IUnknown*)obj, ref, brokenref, __LINE__)
116 IUnknown_AddRef(
obj);
117 rc = IUnknown_Release(
obj);
118 ok_(__FILE__,
line)(rc ==
ref ||
broken(rc == brokenref),
"expected refcount %ld, got %ld\n",
ref, rc);
239 SHORT minLeftSideBearing;
240 SHORT minRightSideBearing;
242 SHORT caretSlopeRise;
246 SHORT metricDataFormat;
270 WORD LookupListIndex[1];
300 WORD ExtensionLookupType;
301 DWORD ExtensionOffset;
475 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
478 memset(&logfont, 0,
sizeof(logfont));
485 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
488 hr = IDWriteFont_CreateFontFace(
font, &fontface);
491 IDWriteFont_Release(
font);
492 IDWriteGdiInterop_Release(interop);
513 if (!exists)
goto not_found;
522 IDWriteFontFamily_Release(family);
551 ok(
res != 0,
"couldn't find resource\n" );
560#define DELETE_FONTFILE(filename) _delete_testfontfile(filename, __LINE__)
579 if (
SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace5, (
void **)&fontface5))) {
580 ret = IDWriteFontFace5_HasVariations(fontface5);
581 IDWriteFontFace5_Release(fontface5);
587#define check_familymodel(a,b) _check_familymodel(a,b,__LINE__)
595 model = IDWriteFontCollection2_GetFontFamilyModel(
collection);
596 ok_(__FILE__,
line)(model == expected_model,
"Unexpected family model %d, expected %d.\n", model, expected_model);
620 IDWriteFontFileEnumerator_AddRef(iface);
638 IDWriteFontFile_Release(enumerator->
font_file);
647 IDWriteFontFile_AddRef(
This->font_file);
656 if (
This->index > 1) {
679 if (!(enumerator =
calloc(1,
sizeof(*enumerator))))
684 enumerator->
index = 0;
708 IDWriteFontCollectionLoader_AddRef(iface);
731 hr = IDWriteFactory_CreateCustomFontFileReference(
factory, collectionKey, collectionKeySize,
This->loader, &font_file);
732 ok(
hr ==
S_OK,
"Failed to create custom file reference, hr %#lx.\n",
hr);
737 IDWriteFontFile_Release(font_file);
768 IDWriteFontFileStream_AddRef(iface);
796 *fragment_context =
NULL;
799 *fragment_start =
NULL;
848 *iface = &
object->IDWriteFontFileStream_iface;
882 ok(
mem !=
NULL,
"Failed to lock font resource\n");
910 ID2D1SimplifiedGeometrySink_AddRef(iface);
936 ok(0,
"unexpected SetSegmentFlags() - flags %d\n",
flags);
965 ok(0,
"unexpected Close()\n");
985 ok(0,
"unexpected call\n");
991 ok(0,
"unexpected call\n");
997 ok(0,
"unexpected call\n");
1002 ok(0,
"unexpected call\n");
1057 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
1062 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop,
NULL,
NULL);
1064 font = (
void*)0xdeadbeef;
1065 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop,
NULL, &
font);
1069 memset(&logfont, 0,
sizeof(logfont));
1076 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
1085 ok(
r,
"got %d\n",
r);
1090 hr = IDWriteFont_HasCharacter(
font, 0xd800, &exists);
1092 ok(exists ==
FALSE,
"got %d\n", exists);
1095 hr = IDWriteFont_HasCharacter(
font, 0x20, &exists);
1097 ok(exists ==
TRUE,
"got %d\n", exists);
1107 ret = IDWriteFont_IsSymbolFont(
font);
1110 IDWriteFont_Release(
font);
1115 memset(&logfont, 0,
sizeof(logfont));
1121 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
1128 IDWriteFont_Release(
font);
1132 memset(&logfont, 0,
sizeof(logfont));
1139 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
1146 IDWriteFont_Release(
font);
1149 memset(&logfont, 0,
sizeof(logfont));
1155 font = (
void*)0xdeadbeef;
1156 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
1161 memset(&logfont, 0,
sizeof(logfont));
1167 font = (
void*)0xdeadbeef;
1168 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
1173 memset(&logfont, 0,
sizeof(logfont));
1178 font = (
void*)0xdeadbeef;
1179 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
1184 hr = IDWriteGdiInterop_QueryInterface(interop, &IID_IDWriteGdiInterop1, (
void**)&interop1);
1186 memset(&logfont, 0,
sizeof(logfont));
1193 hr = IDWriteGdiInterop1_CreateFontFromLOGFONT(interop1, &logfont,
NULL, &
font);
1196 IDWriteFont_Release(
font);
1197 IDWriteGdiInterop1_Release(interop1);
1200 win_skip(
"IDWriteGdiInterop1 is not supported, skipping CreateFontFromLOGFONT() tests.\n");
1202 ref = IDWriteGdiInterop_Release(interop);
1203 ok(
ref == 0,
"interop is not released, %lu\n",
ref);
1205 ok(
ref == 0,
"factory is not released, %lu\n",
ref);
1234 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
1238 hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop,
NULL, 0, 0, &
target);
1251 hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop,
NULL, 0, 0, &
target2);
1254 IDWriteBitmapRenderTarget_Release(
target2);
1256 hdc = IDWriteBitmapRenderTarget_GetMemoryDC(
target);
1269 ok(
ds.dsBm.bmWidth == 1,
"got %d\n",
ds.dsBm.bmWidth);
1270 ok(
ds.dsBm.bmHeight == 1,
"got %d\n",
ds.dsBm.bmHeight);
1271 ok(
ds.dsBm.bmPlanes == 1,
"got %d\n",
ds.dsBm.bmPlanes);
1272 ok(
ds.dsBm.bmBitsPixel == 1,
"got %d\n",
ds.dsBm.bmBitsPixel);
1273 ok(!
ds.dsBm.bmBits,
"got %p\n",
ds.dsBm.bmBits);
1275 IDWriteBitmapRenderTarget_Release(
target);
1281 hr = IDWriteGdiInterop_CreateBitmapRenderTarget(interop,
NULL, 10, 5, &
target);
1284 hdc = IDWriteBitmapRenderTarget_GetMemoryDC(
target);
1289 ok(
c ==
RGB(0, 0, 0),
"got 0x%08lx\n",
c);
1293 ok(
c ==
RGB(255, 255, 255),
"got 0x%08lx\n",
c);
1301 ok(
ds.dsBm.bmWidth == 10,
"got %d\n",
ds.dsBm.bmWidth);
1302 ok(
ds.dsBm.bmHeight == 5,
"got %d\n",
ds.dsBm.bmHeight);
1303 ok(
ds.dsBm.bmPlanes == 1,
"got %d\n",
ds.dsBm.bmPlanes);
1304 ok(
ds.dsBm.bmBitsPixel == 32,
"got %d\n",
ds.dsBm.bmBitsPixel);
1305 ok(
ds.dsBm.bmBits !=
NULL,
"got %p\n",
ds.dsBm.bmBits);
1314 hr = IDWriteBitmapRenderTarget_Resize(
target, 10, 5);
1318 ok(hbm2 ==
hbm,
"got %p, %p\n", hbm2,
hbm);
1321 hr = IDWriteBitmapRenderTarget_Resize(
target, 5, 5);
1331 ok(hbm2 !=
hbm,
"got %p, %p\n", hbm2,
hbm);
1333 hr = IDWriteBitmapRenderTarget_Resize(
target, 20, 5);
1343 ok(hbm2 !=
hbm,
"got %p, %p\n", hbm2,
hbm);
1345 hr = IDWriteBitmapRenderTarget_Resize(
target, 1, 5);
1355 ok(hbm2 !=
hbm,
"got %p, %p\n", hbm2,
hbm);
1359 ok(
ds.dsBm.bmWidth == 1,
"got %d\n",
ds.dsBm.bmWidth);
1360 ok(
ds.dsBm.bmHeight == 5,
"got %d\n",
ds.dsBm.bmHeight);
1361 ok(
ds.dsBm.bmPlanes == 1,
"got %d\n",
ds.dsBm.bmPlanes);
1362 ok(
ds.dsBm.bmBitsPixel == 32,
"got %d\n",
ds.dsBm.bmBitsPixel);
1363 ok(
ds.dsBm.bmBits !=
NULL,
"got %p\n",
ds.dsBm.bmBits);
1366 hr = IDWriteBitmapRenderTarget_Resize(
target, 0, 5);
1376 ok(hbm2 !=
hbm,
"got %p, %p\n", hbm2,
hbm);
1380 ok(
ds.dsBm.bmWidth == 1,
"got %d\n",
ds.dsBm.bmWidth);
1381 ok(
ds.dsBm.bmHeight == 1,
"got %d\n",
ds.dsBm.bmHeight);
1382 ok(
ds.dsBm.bmPlanes == 1,
"got %d\n",
ds.dsBm.bmPlanes);
1383 ok(
ds.dsBm.bmBitsPixel == 1,
"got %d\n",
ds.dsBm.bmBitsPixel);
1384 ok(!
ds.dsBm.bmBits,
"got %p\n",
ds.dsBm.bmBits);
1388 hr = IDWriteBitmapRenderTarget_GetCurrentTransform(
target,
NULL);
1391 hr = IDWriteBitmapRenderTarget_GetCurrentTransform(
target, &
m);
1393 ok(
m.m11 == 1.0 &&
m.m22 == 1.0 &&
m.m12 == 0.0 &&
m.m21 == 0.0,
"got %.1f,%.1f,%.1f,%.1f\n",
m.m11,
m.m22,
m.m12,
m.m21);
1394 ok(
m.dx == 0.0 &&
m.dy == 0.0,
"got %.1f,%.1f\n",
m.dx,
m.dy);
1397 ok(xform.
eM11 == 1.0 && xform.
eM22 == 1.0 && xform.
eM12 == 0.0 && xform.
eM21 == 0.0,
"got wrong transform\n");
1398 ok(xform.
eDx == 0.0 && xform.
eDy == 0.0,
"got %.1f,%.1f\n", xform.
eDx, xform.
eDy);
1401 hr = IDWriteBitmapRenderTarget_SetCurrentTransform(
target, &
m);
1405 hr = IDWriteBitmapRenderTarget_GetCurrentTransform(
target, &
m);
1407 ok(
m.m11 == 0.0 &&
m.m22 == 0.0 &&
m.m12 == 0.0 &&
m.m21 == 0.0,
"got %.1f,%.1f,%.1f,%.1f\n",
m.m11,
m.m22,
m.m12,
m.m21);
1408 ok(
m.dx == 0.0 &&
m.dy == 0.0,
"got %.1f,%.1f\n",
m.dx,
m.dy);
1411 ok(xform.
eM11 == 1.0 && xform.
eM22 == 1.0 && xform.
eM12 == 0.0 && xform.
eM21 == 0.0,
"got wrong transform\n");
1412 ok(xform.
eDx == 0.0 && xform.
eDy == 0.0,
"got %.1f,%.1f\n", xform.
eDx, xform.
eDy);
1415 m.m11 = 2.0;
m.m22 = 1.0;
1416 hr = IDWriteBitmapRenderTarget_SetCurrentTransform(
target, &
m);
1420 ok(xform.
eM11 == 1.0 && xform.
eM22 == 1.0 && xform.
eM12 == 0.0 && xform.
eM21 == 0.0,
"got wrong transform\n");
1421 ok(xform.
eDx == 0.0 && xform.
eDy == 0.0,
"got %.1f,%.1f\n", xform.
eDx, xform.
eDy);
1423 hr = IDWriteBitmapRenderTarget_SetCurrentTransform(
target,
NULL);
1427 hr = IDWriteBitmapRenderTarget_GetCurrentTransform(
target, &
m);
1429 ok(
m.m11 == 1.0 &&
m.m22 == 1.0 &&
m.m12 == 0.0 &&
m.m21 == 0.0,
"got %.1f,%.1f,%.1f,%.1f\n",
m.m11,
m.m22,
m.m12,
m.m21);
1430 ok(
m.dx == 0.0 &&
m.dy == 0.0,
"got %.1f,%.1f\n",
m.dx,
m.dy);
1433 pdip = IDWriteBitmapRenderTarget_GetPixelsPerDip(
target);
1434 ok(pdip == 1.0,
"got %.2f\n", pdip);
1436 hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(
target, 2.0);
1439 hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(
target, -1.0);
1442 hr = IDWriteBitmapRenderTarget_SetPixelsPerDip(
target, 0.0);
1445 pdip = IDWriteBitmapRenderTarget_GetPixelsPerDip(
target);
1446 ok(pdip == 2.0,
"got %.2f\n", pdip);
1448 hr = IDWriteBitmapRenderTarget_QueryInterface(
target, &IID_IDWriteBitmapRenderTarget1, (
void**)&
target1);
1452 mode = IDWriteBitmapRenderTarget1_GetTextAntialiasMode(
target1);
1453 ok(
mode == DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE,
"got %d\n",
mode);
1455 hr = IDWriteBitmapRenderTarget1_SetTextAntialiasMode(
target1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE+1);
1458 mode = IDWriteBitmapRenderTarget1_GetTextAntialiasMode(
target1);
1459 ok(
mode == DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE,
"got %d\n",
mode);
1461 hr = IDWriteBitmapRenderTarget1_SetTextAntialiasMode(
target1, DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE);
1464 mode = IDWriteBitmapRenderTarget1_GetTextAntialiasMode(
target1);
1465 ok(
mode == DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE,
"got %d\n",
mode);
1467 IDWriteBitmapRenderTarget1_Release(
target1);
1470 win_skip(
"IDWriteBitmapRenderTarget1 is not supported.\n");
1473 hr = IDWriteBitmapRenderTarget_Resize(
target, 16, 16);
1474 ok(
hr ==
S_OK,
"Failed to resize target, hr %#lx.\n",
hr);
1480 hr = IDWriteFontFace_GetGlyphIndices(fontface, &
ch, 1, glyphs);
1482 ok(glyphs[0] > 0,
"got %u\n", glyphs[0]);
1483 glyphs[1] = glyphs[0];
1485 memset(&run, 0,
sizeof(run));
1493 ok(
hr ==
S_OK,
"Failed to create rendering params, hr %#lx.\n",
hr);
1509 ok(
hr ==
S_OK,
"Failed to draw a run, hr %#lx.\n",
hr);
1515 ok(
hr ==
S_OK,
"Failed to draw a run, hr %#lx.\n",
hr);
1518 IDWriteRenderingParams_Release(
params);
1521 hr = IDWriteBitmapRenderTarget_Resize(
target, 0, 16);
1522 ok(
hr ==
S_OK,
"Failed to resize target, hr %#lx.\n",
hr);
1532 IDWriteFontFace_Release(fontface);
1534 ref = IDWriteBitmapRenderTarget_Release(
target);
1535 ok(
ref == 0,
"render target not released, %lu\n",
ref);
1536 ref = IDWriteGdiInterop_Release(interop);
1537 ok(
ref == 0,
"interop not released, %lu\n",
ref);
1539 ok(
ref == 0,
"factory not released, %lu\n",
ref);
1558 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
1561 hr = IDWriteFactory_GetSystemFontCollection(
factory, &syscoll,
FALSE);
1564 memset(&logfont, 0,
sizeof(logfont));
1571 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
1574 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font2);
1576 ok(font2 !=
font,
"got %p, %p\n", font2,
font);
1582 hr = IDWriteFont_GetFontFamily(
font, &family);
1587 hr = IDWriteFont_GetFontFamily(
font, &family2);
1589 ok(family2 == family,
"got %p, previous %p\n", family2, family);
1592 IDWriteFontFamily_Release(family2);
1594 hr = IDWriteFont_QueryInterface(
font, &IID_IDWriteFontFamily, (
void**)&family2);
1596 ok(family2 ==
NULL,
"got %p\n", family2);
1598 hr = IDWriteFont_GetFontFamily(font2, &family2);
1600 ok(family2 != family,
"got %p, %p\n", family2, family);
1603 hr = IDWriteFontFamily_GetFontCollection(family, &
collection);
1607 hr = IDWriteFontFamily_GetFontCollection(family2, &collection2);
1612 IDWriteFont_Release(
font);
1613 IDWriteFont_Release(font2);
1615 hr = IDWriteFontFamily_QueryInterface(family, &IID_IDWriteFontFamily1, (
void**)&family1);
1624 font3 = (
void*)0xdeadbeef;
1625 hr = IDWriteFontFamily1_GetFont(family1, ~0
u, &font3);
1627 ok(font3 ==
NULL,
"got %p\n", font3);
1629 hr = IDWriteFontFamily1_GetFont(family1, 0, &font3);
1632 hr = IDWriteFont3_QueryInterface(font3, &IID_IDWriteFont, (
void**)&
font);
1634 IDWriteFont_Release(
font);
1636 hr = IDWriteFont3_QueryInterface(font3, &IID_IDWriteFont1, (
void**)&font1);
1638 IDWriteFont1_Release(font1);
1640 hr = IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList1, (
void **)&fontlist1);
1643 hr = IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList, (
void **)&fontlist);
1645 ok(fontlist == (
IDWriteFontList *)fontlist1,
"Unexpected interface pointer.\n");
1649 if (
SUCCEEDED(IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList2, (
void **)&fontlist2)))
1653 ok(fontlist == (
IDWriteFontList *)fontlist2,
"Unexpected interface pointer.\n");
1655 hr = IDWriteFontList2_GetFontSet(fontlist2, &fontset);
1658 hr = IDWriteFontList2_GetFontSet(fontlist2, &fontset2);
1660 ok(fontset != fontset2,
"Unexpected instance.\n");
1662 IDWriteFontSet1_Release(fontset2);
1663 IDWriteFontSet1_Release(fontset);
1665 IDWriteFontList2_Release(fontlist2);
1668 win_skip(
"IDWriteFontList2 is not supported.\n");
1670 IDWriteFontList1_Release(fontlist1);
1671 IDWriteFontList_Release(fontlist);
1674 hr = IDWriteFontFamily1_QueryInterface(family1, &IID_IDWriteFontList, (
void**)&fontlist);
1676 IDWriteFontList_Release(fontlist);
1678 IDWriteFont3_Release(font3);
1680 hr = IDWriteFontFamily1_GetFontFaceReference(family1, 0, &
ref);
1683 hr = IDWriteFontFamily1_GetFontFaceReference(family1, 0, &ref1);
1685 ok(
ref != ref1,
"got %p, %p\n",
ref, ref1);
1687 IDWriteFontFaceReference_Release(
ref);
1688 IDWriteFontFaceReference_Release(ref1);
1690 IDWriteFontFamily1_Release(family1);
1693 win_skip(
"IDWriteFontFamily1 is not supported.\n");
1696 if (
SUCCEEDED(IDWriteFontCollection_QueryInterface(syscoll, &IID_IDWriteFontCollection2, (
void **)&coll2)))
1700 count = IDWriteFontCollection2_GetFontFamilyCount(coll2);
1701 ok(!!
count,
"Unexpected family count.\n");
1703 family2 = (
void *)0xdeadbeef;
1704 hr = IDWriteFontCollection2_GetFontFamily(coll2,
count, &family2);
1706 ok(!family2,
"Unexpected pointer.\n");
1708 hr = IDWriteFontCollection2_GetFontFamily(coll2, 0, &family2);
1709 ok(
hr ==
S_OK,
"Failed to get family, hr %#lx.\n",
hr);
1710 IDWriteFontFamily2_Release(family2);
1712 IDWriteFontCollection2_Release(coll2);
1715 win_skip(
"IDWriteFontCollection2 is not supported.\n");
1717 IDWriteFontCollection_Release(syscoll);
1718 IDWriteFontCollection_Release(collection2);
1720 IDWriteFontFamily_Release(family2);
1721 IDWriteFontFamily_Release(family);
1722 IDWriteGdiInterop_Release(interop);
1724 ok(
ref == 0,
"factory not released, %lu\n",
ref);
1730 IDWriteFontFace3 *fontface3;
1744 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
1747 memset(&logfont, 0,
sizeof(logfont));
1754 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
1757 hr = IDWriteFont_GetFontFamily(
font, &family);
1761 hr = IDWriteFontFamily_GetFamilyNames(family,
NULL);
1763 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
1767 hr = IDWriteFontFamily_GetFamilyNames(family, &names2);
1770 ok(
names != names2,
"got %p, was %p\n", names2,
names);
1772 IDWriteLocalizedStrings_Release(names2);
1776 hr = IDWriteLocalizedStrings_GetStringLength(
names, 0,
NULL);
1779 hr = IDWriteLocalizedStrings_GetStringLength(
names, 10, &
len);
1784 hr = IDWriteLocalizedStrings_GetStringLength(
names, 0, &
len);
1789 hr = IDWriteLocalizedStrings_GetString(
names, 0,
NULL, 0);
1792 hr = IDWriteLocalizedStrings_GetString(
names, 10,
NULL, 0);
1796 hr = IDWriteLocalizedStrings_GetString(
names, 0,
NULL, 100);
1799 hr = IDWriteLocalizedStrings_GetString(
names, 10,
buffer, 100);
1815 ok(
hr ==
S_OK,
"Failed to get a string, hr %#lx.\n",
hr);
1818 IDWriteLocalizedStrings_Release(
names);
1821 hr = IDWriteFont_CreateFontFace(
font, &fontface);
1822 ok(
hr ==
S_OK,
"Failed to create fontface, hr %#lx.\n",
hr);
1824 if (
SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (
void **)&fontface3)))
1826 hr = IDWriteFontFace3_GetFamilyNames(fontface3, &
names);
1827 ok(
hr ==
S_OK,
"Failed to get family names, hr %#lx.\n",
hr);
1831 ok(
hr ==
S_OK,
"Failed to get a string, hr %#lx.\n",
hr);
1834 IDWriteLocalizedStrings_Release(
names);
1835 IDWriteFontFace3_Release(fontface3);
1838 win_skip(
"IDWriteFontFace3::GetFamilyNames() is not supported.\n");
1840 IDWriteFontFace_Release(fontface);
1842 IDWriteFontFamily_Release(family);
1843 IDWriteFont_Release(
font);
1844 IDWriteGdiInterop_Release(interop);
1846 ok(
ref == 0,
"factory not released, %lu\n",
ref);
1870 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
1873 memset(&logfont, 0,
sizeof(logfont));
1881 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
1885 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &font2);
1887 ok(
font != font2,
"got %p, %p\n",
font, font2);
1889 hr = IDWriteFont_QueryInterface(
font, &IID_IDWriteFontFace, (
void**)&fontface);
1896 hr = IDWriteFont_CreateFontFace(
font, &fontface);
1900 hr = IDWriteFont_CreateFontFace(
font, &fontface2);
1902 ok(fontface == fontface2,
"got %p, was %p\n", fontface2, fontface);
1903 IDWriteFontFace_Release(fontface2);
1906 hr = IDWriteFont_CreateFontFace(font2, &fontface2);
1908 ok(fontface == fontface2,
"got %p, was %p\n", fontface2, fontface);
1909 IDWriteFontFace_Release(fontface2);
1911 IDWriteFont_Release(font2);
1912 IDWriteFont_Release(
font);
1914 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFont, (
void**)&
font);
1917 IDWriteFontFace_Release(fontface);
1918 IDWriteGdiInterop_Release(interop);
1924 hr = IDWriteFontCollection_GetFontFamily(
collection, 0, &family);
1936 ok(
font != font2,
"got %p, %p\n",
font, font2);
1939 hr = IDWriteFont_CreateFontFace(
font, &fontface);
1943 hr = IDWriteFont_CreateFontFace(font2, &fontface2);
1945 ok(fontface == fontface2,
"got %p, was %p\n", fontface2, fontface);
1948 if (
SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace5, (
void **)&fontface5)))
1950 ret = IDWriteFontFace5_Equals(fontface5, fontface2);
1951 ok(
ret,
"Unexpected result %d.\n",
ret);
1952 IDWriteFontFace5_Release(fontface5);
1955 IDWriteFontFace_Release(fontface);
1956 IDWriteFontFace_Release(fontface2);
1957 IDWriteFont_Release(font2);
1958 IDWriteFont_Release(
font);
1959 IDWriteFontFamily_Release(family);
1962 ok(
ref == 0,
"factory not released, %lu.\n",
ref);
1977 ok(supported ==
TRUE,
"got %i\n", supported);
2001 fontface = (
void*)0xdeadbeef;
2004 ok(fontface ==
NULL,
"got %p\n", fontface);
2006 fontface = (
void*)0xdeadbeef;
2009 ok(fontface ==
NULL,
"got %p\n", fontface);
2011 fontface = (
void*)0xdeadbeef;
2014 ok(fontface ==
NULL,
"got %p\n", fontface);
2021 ok(fontface !=
NULL,
"got %p\n", fontface);
2022 face_type = IDWriteFontFace_GetType(fontface);
2024 IDWriteFontFace_Release(fontface);
2027 IDWriteFontFile_Release(
file);
2029 ok(
ref == 0,
"factory not released, %lu.\n",
ref);
2035 void *os2_context, *head_context, *post_context, *hhea_context;
2046 hr = IDWriteFontFace_TryGetFontTable(fontface,
MS_OS2_TAG, (
const void **)&
tt_os2, &
size, &os2_context, &exists);
2048 hr = IDWriteFontFace_TryGetFontTable(fontface,
MS_HEAD_TAG, (
const void**)&
tt_head, &
size, &head_context, &exists);
2050 hr = IDWriteFontFace_TryGetFontTable(fontface,
MS_HHEA_TAG, (
const void**)&
tt_hhea, &
size, &hhea_context, &exists);
2052 hr = IDWriteFontFace_TryGetFontTable(fontface,
MS_POST_TAG, (
const void**)&
tt_post, &
size, &post_context, &exists);
2067 metrics->descent = descent < 0 ? -descent : 0;
2083 metrics->lineGap = linegap > 0 ? linegap : 0;
2112 if (
metrics->underlineThickness == 0)
2114 if (
metrics->strikethroughThickness == 0)
2118 IDWriteFontFace_ReleaseFontTable(fontface, os2_context);
2120 IDWriteFontFace_ReleaseFontTable(fontface, head_context);
2122 IDWriteFontFace_ReleaseFontTable(fontface, hhea_context);
2124 IDWriteFontFace_ReleaseFontTable(fontface, post_context);
2134 has_metrics1 =
SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void **)&fontface1));
2135 simulations = IDWriteFontFace_GetSimulations(fontface);
2138 IDWriteFontFace1_GetMetrics(fontface1, &
metrics);
2139 IDWriteFontFace1_Release(fontface1);
2146 ok(
metrics.designUnitsPerEm ==
expected->designUnitsPerEm,
"designUnitsPerEm %u, expected %u.\n",
2151 ok(
metrics.underlinePosition ==
expected->underlinePosition,
"underlinePosition %d, expected %d.\n",
2153 ok(
metrics.underlineThickness ==
expected->underlineThickness,
"underlineThickness %u, expected %u.\n",
2155 ok(
metrics.strikethroughPosition ==
expected->strikethroughPosition,
"strikethroughPosition %d, expected %d.\n",
2157 ok(
metrics.strikethroughThickness ==
expected->strikethroughThickness,
"strikethroughThickness %u, "
2158 "expected %u.\n",
metrics.strikethroughThickness,
expected->strikethroughThickness);
2169 ok(
metrics.hasTypographicMetrics ==
expected->hasTypographicMetrics,
"hasTypographicMetrics %d, "
2170 "expected %d.\n",
metrics.hasTypographicMetrics,
expected->hasTypographicMetrics);
2171 ok(
metrics.glyphBoxLeft ==
expected->glyphBoxLeft,
"glyphBoxLeft %d, expected %d.\n",
2173 ok(
metrics.glyphBoxTop ==
expected->glyphBoxTop,
"glyphBoxTop %d, expected %d.\n",
2175 ok(
metrics.glyphBoxRight ==
expected->glyphBoxRight,
"glyphBoxRight %d, expected %d.\n",
2177 ok(
metrics.glyphBoxBottom ==
expected->glyphBoxBottom,
"glyphBoxBottom %d, expected %d.\n",
2180 ok(
metrics.subscriptPositionX ==
expected->subscriptPositionX,
"subscriptPositionX %d, expected %d.\n",
2182 ok(
metrics.subscriptPositionY ==
expected->subscriptPositionY,
"subscriptPositionY %d, expected %d.\n",
2184 ok(
metrics.subscriptSizeX ==
expected->subscriptSizeX,
"subscriptSizeX %d, expected %d.\n",
2186 ok(
metrics.subscriptSizeY ==
expected->subscriptSizeY,
"subscriptSizeY %d, expected %d.\n",
2188 ok(
metrics.superscriptPositionX ==
expected->superscriptPositionX,
"superscriptPositionX %d, expected %d.\n",
2190 ok(
metrics.superscriptPositionY ==
expected->superscriptPositionY,
"superscriptPositionY %d, expected %d.\n",
2192 ok(
metrics.superscriptSizeX ==
expected->superscriptSizeX,
"superscriptSizeX %d, expected %d.\n",
2194 ok(
metrics.superscriptSizeY ==
expected->superscriptSizeY,
"superscriptSizeY %d, expected %d.\n",
2207 hr = IDWriteLocalizedStrings_FindLocaleName(
strings,
L"en-us", &
index, &exists);
2236 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
2239 memset(&logfont, 0,
sizeof(logfont));
2246 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
2260 IDWriteFont_GetMetrics(
font,
NULL);
2265 ok(
metrics.designUnitsPerEm != 0,
"designUnitsPerEm %u\n",
metrics.designUnitsPerEm);
2271 ok(
metrics.underlinePosition < 0,
"underlinePosition %d\n",
metrics.underlinePosition);
2272 ok(
metrics.underlineThickness != 0,
"underlineThickness %u\n",
metrics.underlineThickness);
2273 ok(
metrics.strikethroughPosition > 0,
"strikethroughPosition %d\n",
metrics.strikethroughPosition);
2274 ok(
metrics.strikethroughThickness != 0,
"strikethroughThickness %u\n",
metrics.strikethroughThickness);
2276 hr = IDWriteFont_CreateFontFace(
font, &fontface);
2280 IDWriteFontFace_GetMetrics(fontface, &
metrics);
2282 ok(
metrics.designUnitsPerEm != 0,
"designUnitsPerEm %u\n",
metrics.designUnitsPerEm);
2288 ok(
metrics.underlinePosition < 0,
"underlinePosition %d\n",
metrics.underlinePosition);
2289 ok(
metrics.underlineThickness != 0,
"underlineThickness %u\n",
metrics.underlineThickness);
2290 ok(
metrics.strikethroughPosition > 0,
"strikethroughPosition %d\n",
metrics.strikethroughPosition);
2291 ok(
metrics.strikethroughThickness != 0,
"strikethroughThickness %u\n",
metrics.strikethroughThickness);
2293 hr = IDWriteFont_QueryInterface(
font, &IID_IDWriteFont1, (
void**)&font1);
2298 memset(&metrics1, 0,
sizeof(metrics1));
2299 IDWriteFont1_GetMetrics(font1, &metrics1);
2323 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
2326 memset(&metrics1, 0,
sizeof(metrics1));
2327 IDWriteFontFace1_GetMetrics(fontface1, &metrics1);
2351 IDWriteFontFace1_Release(fontface1);
2352 IDWriteFont1_Release(font1);
2355 win_skip(
"DWRITE_FONT_METRICS1 is not supported.\n");
2357 IDWriteFontFace_Release(fontface);
2358 IDWriteFont_Release(
font);
2359 IDWriteGdiInterop_Release(interop);
2365 hr = IDWriteFont_CreateFontFace(
font, &fontface);
2369 hr = IDWriteFontFace_GetFiles(fontface, &
count, &
file);
2372 IDWriteFontFace_GetMetrics(fontface, &
metrics);
2373 ok(IDWriteFontFace_GetSimulations(fontface) == 0,
"wrong simulations flags\n");
2374 IDWriteFontFace_Release(fontface);
2379 IDWriteFontFace_GetMetrics(fontface, &metrics2);
2392 metrics.strikethroughPosition);
2394 metrics.strikethroughThickness);
2396 IDWriteFontFile_Release(
file);
2397 IDWriteFontFace_Release(fontface);
2398 IDWriteFont_Release(
font);
2401 hr = IDWriteFactory_GetSystemFontCollection(
factory, &syscollection,
FALSE);
2403 count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
2407 WCHAR familyW[256], faceW[256];
2413 hr = IDWriteFontCollection_GetFontFamily(syscollection,
i, &family);
2416 fontcount = IDWriteFontFamily_GetFontCount(family);
2418 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
2419 ok(
hr ==
S_OK,
"Failed to get family names, hr %#lx.\n",
hr);
2421 IDWriteLocalizedStrings_Release(
names);
2423 for (
j = 0;
j < fontcount;
j++) {
2426 hr = IDWriteFontFamily_GetFont(family,
j, &
font);
2427 ok(
hr ==
S_OK,
"Failed to get a font, hr %#lx.\n",
hr);
2429 hr = IDWriteFont_CreateFontFace(
font, &fontface);
2430 ok(
hr ==
S_OK,
"Failed to create face instance, hr %#lx.\n",
hr);
2433 ok(
hr ==
S_OK,
"Failed to get face names, hr %#lx.\n",
hr);
2435 IDWriteLocalizedStrings_Release(
names);
2437 IDWriteFont_Release(
font);
2445 skip(
"GetMetrics() test does not support variable fonts.\n");
2446 IDWriteFontFace_Release(fontface);
2453 IDWriteFontFace_Release(fontface);
2456 IDWriteFontFamily_Release(family);
2458 IDWriteFontCollection_Release(syscollection);
2460 ok(
ref == 0,
"factory not released, %lu\n",
ref);
2487 hr = IDWriteFactory_GetSystemFontCollection(
factory, &coll2,
FALSE);
2490 IDWriteFontCollection_Release(coll2);
2493 hr = IDWriteFactory_GetSystemFontCollection(factory2, &coll2,
FALSE);
2496 IDWriteFontCollection_Release(coll2);
2497 IDWriteFactory_Release(factory2);
2499 i = IDWriteFontCollection_GetFontFamilyCount(
collection);
2500 ok(
i,
"got %u\n",
i);
2503 family = (
void*)0xdeadbeef;
2504 hr = IDWriteFontCollection_GetFontFamily(
collection,
i, &family);
2506 ok(family ==
NULL,
"got %p\n", family);
2530 hr = IDWriteFontCollection_GetFontFamily(
collection,
i, &family);
2536 IDWriteFontFamily_Release(family);
2538 hr = IDWriteFont_CreateFontFace(
font, &fontface);
2540 IDWriteFont_Release(
font);
2544 hr = IDWriteFontFace_GetFiles(fontface, &
i, &
file);
2547 IDWriteFontFace_Release(fontface);
2551 IDWriteFontFile_Release(
file);
2553 hr = IDWriteFontFileLoader_QueryInterface(
loader, &IID_IDWriteLocalFontFileLoader, (
void**)&localloader);
2555 IDWriteLocalFontFileLoader_Release(localloader);
2565 hr = IDWriteFactory_RegisterFontFileLoader(factory2,
loader);
2567 hr = IDWriteFactory_RegisterFontFileLoader(factory2,
loader);
2569 hr = IDWriteFactory_UnregisterFontFileLoader(factory2,
loader);
2571 hr = IDWriteFactory_UnregisterFontFileLoader(factory2,
loader);
2573 IDWriteFactory_Release(factory2);
2575 IDWriteFontFileLoader_Release(
loader);
2584 hr = IDWriteFontCollection_QueryInterface(
collection, &IID_IDWriteFontCollection1, (
void**)&collection1);
2588 IDWriteFactory3 *factory3;
2590 hr = IDWriteFontCollection1_QueryInterface(collection1, &IID_IDWriteFontCollection, (
void**)&coll2);
2593 IDWriteFontCollection_Release(coll2);
2595 family1 = (
void*)0xdeadbeef;
2596 hr = IDWriteFontCollection1_GetFontFamily(collection1, ~0
u, &family1);
2598 ok(family1 ==
NULL,
"got %p\n", family1);
2600 hr = IDWriteFontCollection1_GetFontFamily(collection1, 0, &family1);
2602 IDWriteFontFamily1_Release(family1);
2607 hr = IDWriteFontCollection1_GetFontSet(collection1, &fontset);
2609 ok(
hr ==
S_OK,
"Failed to get fontset, hr %#lx.\n",
hr);
2615 hr = IDWriteFontCollection1_GetFontSet(collection1, &fontset2);
2616 ok(
hr ==
S_OK,
"Failed to get fontset, hr %#lx.\n",
hr);
2617 ok(fontset != fontset2,
"Expected new fontset instance.\n");
2619 IDWriteFontSet_Release(fontset2);
2621 hr = IDWriteFactory_QueryInterface(
factory, &IID_IDWriteFactory3, (
void **)&factory3);
2622 ok(
hr ==
S_OK,
"Failed to get IDWriteFactory3 interface, hr %#lx.\n",
hr);
2625 hr = IDWriteFactory3_GetSystemFontSet(factory3, &fontset2);
2626 ok(
hr ==
S_OK,
"Failed to get system font set, hr %#lx.\n",
hr);
2627 ok(fontset != fontset2,
"Expected new fontset instance.\n");
2631 IDWriteFontSet_Release(fontset2);
2632 IDWriteFontSet_Release(fontset);
2634 IDWriteFactory3_Release(factory3);
2636 IDWriteFontCollection1_Release(collection1);
2639 win_skip(
"IDWriteFontCollection1 is not supported.\n");
2641 hr = IDWriteFontCollection_QueryInterface(
collection, &IID_IDWriteFontCollection3, (
void **)&collection3);
2646 event = IDWriteFontCollection3_GetExpirationEvent(collection3);
2648 ok(!!
event,
"Expected event handle.\n");
2652 IDWriteFontCollection3_Release(collection3);
2655 win_skip(
"IDWriteFontCollection3 is not supported.\n");
2658 hr = IDWriteFactory_QueryInterface(
factory, &IID_IDWriteFactory6, (
void **)&factory6);
2665 ok(
hr ==
S_OK,
"Failed to get collection, hr %#lx.\n",
hr);
2668 ok(
hr ==
S_OK,
"Failed to get collection, hr %#lx.\n",
hr);
2670 IDWriteFontCollection2_Release(c2);
2671 IDWriteFontCollection2_Release(collection2);
2675 ok(
hr ==
S_OK,
"Failed to get collection, hr %#lx.\n",
hr);
2676 IDWriteFontCollection2_Release(collection2);
2677 IDWriteFactory6_Release(factory6);
2680 win_skip(
"IDWriteFactory6 is not supported.\n");
2683 ok(!
ref,
"Collection wasn't released, %lu.\n",
ref);
2685 ok(!
ref,
"Factory wasn't released, %lu.\n",
ref);
2690 void *os2_context, *head_context;
2713 hr = IDWriteFont_CreateFontFace(
font, &fontface);
2714 ok(
hr ==
S_OK,
"Failed to create font face, %#lx\n",
hr);
2717 &os2_context, &exists);
2718 ok(
hr ==
S_OK,
"Failed to get OS/2 table, %#lx\n",
hr);
2721 &head_context, &exists);
2722 ok(
hr ==
S_OK,
"Failed to get head table, %#lx\n",
hr);
2724 sim = IDWriteFont_GetSimulations(
font);
2782 IDWriteLocalizedStrings_FindLocaleName(
names,
L"en-us", &
index, &exists);
2787 ok(
hr ==
S_OK,
"Failed to get name string, hr %#lx.\n",
hr);
2792 IDWriteLocalizedStrings_Release(
names);
2796 IDWriteFontFace_ReleaseFontTable(fontface, os2_context);
2798 IDWriteFontFace_ReleaseFontTable(fontface, head_context);
2799 IDWriteFontFace_Release(fontface);
2815 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
2820 hr = IDWriteGdiInterop_ConvertFontFaceToLOGFONT(interop,
NULL,
NULL);
2821 hr = IDWriteGdiInterop_ConvertFontFaceToLOGFONT(interop, fontface,
NULL);
2823 memset(&logfont, 0xcc,
sizeof(logfont));
2824 hr = IDWriteGdiInterop_ConvertFontFaceToLOGFONT(interop,
NULL, &logfont);
2833 WCHAR nameW[128], familynameW[64], facenameW[64];
2841 hr = IDWriteFontCollection_GetFontFamily(
collection,
i, &family);
2844 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
2848 IDWriteLocalizedStrings_Release(
names);
2850 font_count = IDWriteFontFamily_GetFontCount(family);
2852 for (
j = 0;
j < font_count;
j++) {
2855 hr = IDWriteFontFamily_GetFont(family,
j, &
font);
2862 IDWriteLocalizedStrings_Release(
names);
2866 hr = IDWriteFont_CreateFontFace(
font, &fontface);
2873 skip(
"ConvertFontFaceToLOGFONT() test does not support variable fonts.\n");
2874 IDWriteFontFace_Release(fontface);
2875 IDWriteFont_Release(
font);
2879 memset(&logfont, 0xcc,
sizeof(logfont));
2880 hr = IDWriteGdiInterop_ConvertFontFaceToLOGFONT(interop, fontface, &logfont);
2883 sim = IDWriteFontFace_GetSimulations(fontface);
2888 ok(logfont.
lfWeight == lf.
lfWeight,
"Unexpected lfWeight %ld, expected lfWeight %ld, font weight %d, "
2891 ok(logfont.
lfItalic == lf.
lfItalic,
"Unexpected italic flag %d, oblique simulation %s.\n",
2903 IDWriteFontFace_Release(fontface);
2904 IDWriteFont_Release(
font);
2907 IDWriteFontFamily_Release(family);
2911 IDWriteGdiInterop_Release(interop);
2913 ok(
ref == 0,
"factory not released, %lu\n",
ref);
2921 IDWriteFontFileEnumerator_AddRef(iface);
2976 *
obj = &
loader->IDWriteFontCollectionLoader_iface;
2977 IDWriteFontCollectionLoader_AddRef(iface);
3024 return &
loader->IDWriteFontCollectionLoader_iface;
3051 hr = IDWriteFactory_RegisterFontCollectionLoader(
factory,
NULL);
3054 hr = IDWriteFactory_UnregisterFontCollectionLoader(
factory,
NULL);
3062 hr = IDWriteFactory_RegisterFontCollectionLoader(
factory, loader2);
3076 font_collection = (
void*)0xdeadbeef;
3077 hr = IDWriteFactory_CreateCustomFontCollection(
factory, loader3,
"Billy", 6, &font_collection);
3079 ok(font_collection ==
NULL,
"got %p\n", font_collection);
3082 hr = IDWriteFactory_CreateCustomFontCollection(
factory,
loader,
"Billy", 6, &font_collection);
3087 IDWriteFontCollection_Release(font_collection);
3089 hr = IDWriteFactory_CreateCustomFontCollection(
factory, loader2,
"Billy", 6, &font_collection);
3091 IDWriteFontCollection_Release(font_collection);
3093 font_collection = (
void*)0xdeadbeef;
3096 ok(font_collection ==
NULL,
"got %p\n", font_collection);
3099 ok(
font !=
NULL,
"Failed to find font resource\n");
3102 &
font,
sizeof(HRSRC), &font_collection);
3108 hr = IDWriteFontCollection_FindFamilyName(font_collection,
L"wine_test", &
index, &exists);
3111 ok(exists,
"got exists %i\n", exists);
3113 count = IDWriteFontCollection_GetFontFamilyCount(font_collection);
3117 hr = IDWriteFontCollection_GetFontFamily(font_collection, 0, &family);
3122 hr = IDWriteFontCollection_GetFontFamily(font_collection, 0, &family2);
3125 ok(family != family2,
"got %p, %p\n", family, family2);
3127 hr = IDWriteFontFamily_GetFont(family, 0, &idfont);
3131 hr = IDWriteFontFamily_GetFont(family, 0, &idfont2);
3135 ok(idfont != idfont2,
"got %p, %p\n", idfont, idfont2);
3136 IDWriteFont_Release(idfont2);
3140 ok(exists,
"got %d\n", exists);
3142 IDWriteLocalizedStrings_Release(
string);
3145 hr = IDWriteFont_GetFontFamily(idfont, &family3);
3148 ok(family == family3,
"got %p, %p\n", family, family3);
3149 IDWriteFontFamily_Release(family3);
3152 hr = IDWriteFont_CreateFontFace(idfont, &idfontface);
3157 hr = IDWriteFontFamily_GetFont(family2, 0, &idfont2);
3161 ok(idfont2 != idfont,
"Font instances should not match\n");
3164 hr = IDWriteFont_CreateFontFace(idfont2, &idfontface2);
3166 ok(idfontface2 == idfontface,
"fontfaces should match\n");
3170 hr = IDWriteFontFace_GetFiles(idfontface, &
index, &fontfile);
3175 hr = IDWriteFontFace_GetFiles(idfontface2, &
index, &fontfile2);
3177 ok(fontfile == fontfile2,
"fontfiles should match\n");
3179 IDWriteFont_Release(idfont);
3180 IDWriteFont_Release(idfont2);
3181 IDWriteFontFile_Release(fontfile);
3182 IDWriteFontFile_Release(fontfile2);
3183 IDWriteFontFace_Release(idfontface);
3184 IDWriteFontFace_Release(idfontface2);
3185 IDWriteFontFamily_Release(family2);
3186 IDWriteFontFamily_Release(family);
3187 IDWriteFontCollection_Release(font_collection);
3193 hr = IDWriteFactory_UnregisterFontCollectionLoader(
factory, loader2);
3200 IDWriteFontCollectionLoader_Release(
loader);
3201 IDWriteFontCollectionLoader_Release(loader2);
3202 IDWriteFontCollectionLoader_Release(loader3);
3205 ok(
ref == 0,
"factory not released, %lu\n",
ref);
3213 IDWriteFontFileLoader_AddRef(iface);
3259 UINT32 codePoints[1] = {0xa8};
3282 hr = IDWriteFontFile_GetReferenceKey(
file, &
key, &key_size);
3285 hr = IDWriteFactory_CreateCustomFontFileReference(
factory,
key, key_size,
loader, &file2);
3288 IDWriteFontFile_Release(file2);
3289 IDWriteFontFile_Release(
file);
3290 IDWriteFontFileLoader_Release(
loader);
3292 hr = IDWriteFactory_RegisterFontFileLoader(
factory, &floader);
3294 hr = IDWriteFactory_RegisterFontFileLoader(
factory, &floader2);
3296 hr = IDWriteFactory_RegisterFontFileLoader(
factory, &floader);
3302 hr = IDWriteFactory_CreateCustomFontFileReference(
factory,
"test", 4, &floader, &
file);
3304 IDWriteFontFile_Release(
file);
3306 file = (
void*)0xdeadbeef;
3307 hr = IDWriteFactory_CreateCustomFontFileReference(
factory,
"test", 4, &floader3, &
file);
3311 file = (
void*)0xdeadbeef;
3312 hr = IDWriteFactory_CreateCustomFontFileReference(
factory,
"test", 4,
NULL, &
file);
3317 hr = IDWriteFactory_CreateCustomFontFileReference(
factory,
"test", 4, &floader, &
file);
3325 ok(
hr == 0x8faecafe,
"Unexpected hr %#lx.\n",
hr);
3326 ok(support ==
FALSE,
"got %i\n", support);
3332 ok(
hr == 0x8faecafe,
"Unexpected hr %#lx.\n",
hr);
3333 IDWriteFontFile_Release(
file);
3336 ok(fontrsrc !=
NULL,
"Failed to find font resource\n");
3338 hr = IDWriteFactory_CreateCustomFontFileReference(
factory, &fontrsrc,
sizeof(HRSRC), &
rloader, &
file);
3347 ok(support ==
TRUE,
"got %i\n", support);
3353 face = (
void*)0xdeadbeef;
3365 IDWriteFontFace_Release(face2);
3373 IDWriteFontFace_Release(face2);
3376 hr = IDWriteFactory_CreateCustomFontFileReference(
factory, &fontrsrc,
sizeof(HRSRC), &
rloader, &file2);
3378 ok(
file != file2,
"got %p, %p\n",
file, file2);
3384 IDWriteFontFace_Release(face2);
3385 IDWriteFontFile_Release(file2);
3390 hr = IDWriteFontFace_GetGlyphIndices(
face, codePoints, 0,
NULL);
3393 hr = IDWriteFontFace_GetGlyphIndices(
face, codePoints, 0,
indices);
3408 hr = IDWriteFontFace_GetGlyphIndices(
face, codePoints, 1,
indices);
3411 IDWriteFontFace_Release(
face);
3412 IDWriteFontFile_Release(
file);
3414 hr = IDWriteFactory_UnregisterFontFileLoader(
factory, &floader);
3416 hr = IDWriteFactory_UnregisterFontFileLoader(
factory, &floader);
3418 hr = IDWriteFactory_UnregisterFontFileLoader(
factory, &floader2);
3423 ref = IDWriteFactory_Release(factory2);
3424 ok(
ref == 0,
"factory not released, %lu\n",
ref);
3426 ok(
ref == 0,
"factory not released, %lu\n",
ref);
3446 ffile = (
void*)0xdeadbeef;
3449 ok(ffile ==
NULL,
"got %p\n", ffile);
3460 ok(support ==
TRUE,
"got %i\n", support);
3468 IDWriteFontFace_Release(fface);
3469 IDWriteFontFile_Release(ffile);
3471 ok(
ref == 0,
"factory not released, %lu\n",
ref);
3487 ok(shared !=
NULL,
"got %p\n", shared);
3488 IDWriteFactory_Release(shared);
3495 ok(shared == shared2,
"got %p, and %p\n", shared, shared2);
3496 IDWriteFactory_Release(shared2);
3498 IDWriteFactory_Release(shared);
3503 ok(shared == shared2,
"got %p, and %p\n", shared, shared2);
3504 IDWriteFactory_Release(shared2);
3511 ok(isolated != isolated2,
"got %p, and %p\n", isolated, isolated2);
3512 IDWriteFactory_Release(isolated2);
3516 IDWriteFactory_Release(isolated2);
3520 ok(shared != isolated2,
"got %p, and %p\n", shared, isolated2);
3522 ref = IDWriteFactory_Release(isolated);
3523 ok(
ref == 0,
"factory not released, %lu\n",
ref);
3524 ref = IDWriteFactory_Release(isolated2);
3525 ok(
ref == 0,
"factory not released, %lu\n",
ref);
3573 size_t new_capacity, max_capacity;
3576 if (
count <= *capacity)
3580 if (
count > max_capacity)
3583 new_capacity =
max(4, *capacity);
3584 while (new_capacity <
count && new_capacity <= max_capacity / 2)
3586 if (new_capacity <
count)
3587 new_capacity = max_capacity;
3589 if (!(new_elements =
realloc(*elements, new_capacity *
size)))
3592 *elements = new_elements;
3593 *capacity = new_capacity;
3620 for (
j = 0;
j < segment_count; ++
j) {
3625 if (endcode == 0xffff)
3632 (*ranges)[*
count].last = endcode;
3642 for (
j = 0;
j < num_groups; ++
j) {
3658 ok(0,
"%u table format %#x unhandled.\n", cmap_index,
format);
3664 int index_full = -1, index_bmp = -1;
3665 unsigned int i,
count = 0;
3666 size_t capacity = 0;
3675 for (
i = 0;
i < num_tables; ++
i)
3695 if (index_full != -1)
3697 else if (index_bmp != -1)
3713 hr = IDWriteFontFace1_TryGetFontTable(fontface,
MS_CMAP_TAG, (
const void **)&cmap.
data,
3719 IDWriteFontFace1_ReleaseFontTable(fontface, cmap.
context);
3729 prev->
last = ranges[
i].last;
3733 (*out)[
j++] = ranges[
i];
3760 ok(
font !=
NULL,
"Failed to find font resource\n");
3762 hr = IDWriteFactory_CreateCustomFontFileReference(
factory, &
font,
sizeof(HRSRC), &
rloader, &ffile);
3767 IDWriteFontFile_Release(ffile);
3769 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
3770 IDWriteFontFace_Release(fontface);
3772 win_skip(
"GetUnicodeRanges() is not supported.\n");
3773 IDWriteFactory_Release(
factory);
3778 hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 0,
NULL, &
count);
3783 hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 1,
NULL, &
count);
3788 hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 1, &
r, &
count);
3793 hr = IDWriteFontFace1_GetUnicodeRanges(fontface1,
count, ranges, &
count);
3797 hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 1, ranges, &
count);
3799 ok(ranges[0].
first != 0 && ranges[0].
last != 0,
"got 0x%x-0x%0x\n", ranges[0].
first, ranges[0].
last);
3806 IDWriteFontFace1_Release(fontface1);
3810 hr = IDWriteFactory_GetSystemFontCollection(
factory, &syscollection,
FALSE);
3811 ok(
hr ==
S_OK,
"Failed to get system collection, hr %#lx.\n",
hr);
3813 count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
3816 WCHAR familynameW[256], facenameW[128];
3822 hr = IDWriteFontCollection_GetFontFamily(syscollection,
i, &family);
3823 ok(
hr ==
S_OK,
"Failed to get font family, hr %#lx.\n",
hr);
3825 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
3826 ok(
hr ==
S_OK,
"Failed to get family names, hr %#lx.\n",
hr);
3829 IDWriteLocalizedStrings_Release(
names);
3831 fontcount = IDWriteFontFamily_GetFontCount(family);
3832 for (
j = 0;
j < fontcount;
j++) {
3836 hr = IDWriteFontFamily_GetFont(family,
j, &
font);
3837 ok(
hr ==
S_OK,
"Failed to get font, hr %#lx.\n",
hr);
3839 hr = IDWriteFont_CreateFontFace(
font, &fontface);
3840 ok(
hr ==
S_OK,
"Failed to create fontface, hr %#lx.\n",
hr);
3843 ok(
hr ==
S_OK,
"Failed to get face names, hr %#lx.\n",
hr);
3844 IDWriteFont_Release(
font);
3848 IDWriteLocalizedStrings_Release(
names);
3850 if (IDWriteFontFace_IsSymbolFont(fontface))
3854 skip(
"GetUnicodeRanges() test does not support symbol fonts.\n");
3855 IDWriteFontFace_Release(fontface);
3859 IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void **)&fontface1);
3861 hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, 0,
NULL, &range_count);
3864 ranges =
malloc(range_count *
sizeof(*ranges));
3866 hr = IDWriteFontFace1_GetUnicodeRanges(fontface1, range_count, ranges, &range_count);
3867 ok(
hr ==
S_OK,
"Failed to get ranges, hr %#lx.\n",
hr);
3870 ok(
expected_count == range_count,
"%s - %s: unexpected range count %u, expected %u.\n",
3876 BOOL failed =
memcmp(&expected_ranges[
k], &ranges[
k],
sizeof(*ranges));
3877 ok(!failed,
"%u: %s - %s mismatching range [%#x, %#x] vs [%#x, %#x].\n",
k,
3879 expected_ranges[
k].
first, expected_ranges[
k].
last);
3886 free(expected_ranges);
3889 IDWriteFontFace1_Release(fontface1);
3890 IDWriteFontFace_Release(fontface);
3893 IDWriteFontFamily_Release(family);
3896 IDWriteFontCollection_Release(syscollection);
3899 ok(
ref == 0,
"factory not released, %lu\n",
ref);
3919 hr = IDWriteFontCollection_GetFontFamily(
collection, 0, &family);
3926 hr = IDWriteFont_CreateFontFace(
font, &fontface);
3930 hr = IDWriteFontCollection_GetFontFromFontFace(
collection, fontface, &font2);
3932 ok(font2 !=
font,
"got %p, %p\n", font2,
font);
3935 hr = IDWriteFontCollection_GetFontFromFontFace(
collection, fontface, &font3);
3937 ok(font3 !=
font && font3 != font2,
"got %p, %p, %p\n", font3, font2,
font);
3939 hr = IDWriteFont_CreateFontFace(font2, &fontface2);
3941 ok(fontface2 == fontface,
"got %p, %p\n", fontface2, fontface);
3942 IDWriteFontFace_Release(fontface2);
3944 hr = IDWriteFont_CreateFontFace(font3, &fontface2);
3946 ok(fontface2 == fontface,
"got %p, %p\n", fontface2, fontface);
3947 IDWriteFontFace_Release(fontface2);
3948 IDWriteFontFace_Release(fontface);
3949 IDWriteFont_Release(font3);
3950 IDWriteFactory_Release(
factory);
3961 IDWriteFontFile_Release(
file);
3963 hr = IDWriteFontCollection_GetFontFromFontFace(
collection, fontface, &font3);
3965 ok(font3 ==
NULL,
"got %p\n", font3);
3966 IDWriteFontFace_Release(fontface);
3968 IDWriteFont_Release(
font);
3969 IDWriteFont_Release(font2);
3970 IDWriteFontFamily_Release(family);
3973 ok(
ref == 0,
"factory not released, %lu\n",
ref);
3992 hr = IDWriteFontCollection_GetFontFamily(
collection, 0, &family);
4002 ok(
font != font2,
"got %p, %p\n",
font, font2);
4003 IDWriteFont_Release(
font);
4004 IDWriteFont_Release(font2);
4009 IDWriteFont_Release(
font);
4013 IDWriteFont_Release(
font);
4018 IDWriteFont_Release(
font);
4020 IDWriteFontFamily_Release(family);
4023 simulations = IDWriteFont_GetSimulations(
font);
4025 IDWriteFont_Release(
font);
4029 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4048 hr = IDWriteFontCollection_GetFontFamily(
collection, 0, &family);
4055 IDWriteFontList_Release(fontlist);
4060 IDWriteFontList_Release(fontlist);
4065 IDWriteFontList_Release(fontlist);
4074 ok(fontlist != fontlist2,
"got %p, %p\n", fontlist, fontlist2);
4075 IDWriteFontList_Release(fontlist2);
4077 hr = IDWriteFontList_QueryInterface(fontlist, &IID_IDWriteFontList1, (
void**)&fontlist1);
4083 count = IDWriteFontList1_GetFontCount(fontlist1);
4086 font = (
void*)0xdeadbeef;
4087 hr = IDWriteFontList1_GetFont(fontlist1, ~0
u, &
font);
4091 font = (
void*)0xdeadbeef;
4092 hr = IDWriteFontList1_GetFont(fontlist1,
count, &
font);
4096 hr = IDWriteFontList1_GetFont(fontlist1, 0, &
font);
4098 IDWriteFont3_Release(
font);
4100 hr = IDWriteFontList1_GetFontFaceReference(fontlist1, 0, &
ref);
4103 hr = IDWriteFontList1_GetFontFaceReference(fontlist1, 0, &ref1);
4105 ok(
ref != ref1,
"got %p, %p\n",
ref, ref1);
4107 IDWriteFontFaceReference_Release(ref1);
4108 IDWriteFontFaceReference_Release(
ref);
4109 IDWriteFontList1_Release(fontlist1);
4112 win_skip(
"IDWriteFontList1 is not supported.\n");
4114 if (
SUCCEEDED(IDWriteFontList_QueryInterface(fontlist, &IID_IDWriteFontList2, (
void **)&fontlist3)))
4118 hr = IDWriteFontList2_GetFontSet(fontlist3, &fontset);
4121 hr = IDWriteFontList2_GetFontSet(fontlist3, &fontset2);
4123 ok(fontset != fontset2,
"Unexpected instance.\n");
4125 IDWriteFontSet1_Release(fontset2);
4126 IDWriteFontSet1_Release(fontset);
4128 IDWriteFontList2_Release(fontlist3);
4131 win_skip(
"IDWriteFontList2 is not supported.\n");
4133 IDWriteFontList_Release(fontlist);
4134 IDWriteFontFamily_Release(family);
4138 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4145 IDWriteFontFace3 *fontface3;
4159 hr = IDWriteFontCollection_GetFontFamily(
collection, 0, &family);
4191 IDWriteLocalizedStrings_Release(
strings);
4192 IDWriteLocalizedStrings_Release(strings2);
4194 hr = IDWriteFont_CreateFontFace(
font, &fontface);
4195 ok(
hr ==
S_OK,
"Failed to create fontface, hr %#lx.\n",
hr);
4197 if (
SUCCEEDED(
hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (
void **)&fontface3)))
4201 ok(
hr ==
S_OK,
"Failed to get info strings, hr %#lx.\n",
hr);
4202 IDWriteLocalizedStrings_Release(
strings);
4204 IDWriteFontFace3_Release(fontface3);
4207 win_skip(
"IDWriteFontFace3::GetInformationalStrings() is not supported.\n");
4209 IDWriteFontFace_Release(fontface);
4211 IDWriteFont_Release(
font);
4212 IDWriteFontFamily_Release(family);
4215 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4230 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
4234 hr = IDWriteFactory_GetGdiInterop(
factory, &interop2);
4236 ok(interop == interop2,
"got %p, %p\n", interop, interop2);
4237 IDWriteGdiInterop_Release(interop2);
4244 hr = IDWriteFactory_GetGdiInterop(factory2, &interop2);
4246 ok(interop != interop2,
"got %p, %p\n", interop, interop2);
4249 IDWriteFactory_Release(factory2);
4251 memset(&logfont, 0,
sizeof(logfont));
4258 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop2, &logfont, &
font);
4260 IDWriteFont_Release(
font);
4262 IDWriteGdiInterop_Release(interop2);
4263 IDWriteGdiInterop_Release(interop);
4265 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4308 const void *refkey, *fragment;
4310 DWORD data_size, num_fonts;
4316 HFONT
hfont, oldhfont;
4333 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
4337 fontface = (
void*)0xdeadbeef;
4338 hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop,
NULL, &fontface);
4340 ok(fontface ==
NULL,
"got %p\n", fontface);
4342 fontface = (
void *)0xdeadbeef;
4343 hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop, (
HDC)0xdeadbeef, &fontface);
4345 ok(fontface ==
NULL,
"got %p\n", fontface);
4347 memset(&logfont, 0,
sizeof(logfont));
4359 hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop,
hdc, &fontface);
4360 ok(
hr ==
S_OK,
"Failed to create font face, hr %#lx.\n",
hr);
4363 hr = IDWriteFontFace_GetFiles(fontface, &
count, &
file);
4364 ok(
hr ==
S_OK,
"Failed to get font files, hr %#lx.\n",
hr);
4367 ok(
hr ==
S_OK,
"Failed to get file loader, hr %#lx.\n",
hr);
4369 hr = IDWriteFontFileLoader_QueryInterface(
loader, &IID_IDWriteLocalFontFileLoader, (
void **)&unk);
4372 IUnknown_Release(unk);
4374 IDWriteFontFileLoader_Release(
loader);
4375 IDWriteFontFile_Release(
file);
4377 IDWriteFontFace_Release(fontface);
4381 memset(&lf, 0,
sizeof(lf));
4388 fontface = (
void *)0xdeadbeef;
4389 hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop,
hdc, &fontface);
4391 ok(fontface ==
NULL,
"got %p\n", fontface);
4404 ok(num_fonts == 1,
"Unexpected number of fonts.\n");
4406 memset(&lf, 0,
sizeof(lf));
4414 hr = IDWriteGdiInterop_CreateFontFaceFromHdc(interop,
hdc, &fontface);
4415 ok(
hr ==
S_OK,
"Failed to create fontface, hr %#lx.\n",
hr);
4418 hr = IDWriteFontFace_GetFiles(fontface, &
count, &
file);
4419 ok(
hr ==
S_OK,
"Failed to get font files, hr %#lx.\n",
hr);
4422 ok(
hr ==
S_OK,
"Failed to get file loader, hr %#lx.\n",
hr);
4427 hr = IDWriteFontFileLoader_QueryInterface(
loader, &IID_IDWriteInMemoryFontFileLoader, (
void **)&unk);
4430 hr = IDWriteFontFileLoader_QueryInterface(
loader, &IID_IDWriteLocalFontFileLoader, (
void **)&unk);
4434 hr = IDWriteFontFile_GetReferenceKey(
file, &refkey, &
count);
4435 ok(
hr ==
S_OK,
"Failed to get ref key, hr %#lx.\n",
hr);
4438 if (pGetFontRealizationInfo)
4442 ok(
ret,
"Failed to get realization info.\n");
4443 ok(
count ==
sizeof(
info.instance_id),
"Unexpected key size.\n");
4444 ok(*(
DWORD *)refkey ==
info.instance_id,
"Unexpected stream key.\n");
4447 win_skip(
"GetFontRealizationInfo() is not available.\n");
4450 ok(
hr ==
S_OK,
"Failed to create file stream, hr %#lx.\n",
hr);
4452 hr = IDWriteFontFileLoader_CreateStreamFromKey(
loader, refkey,
count, &stream2);
4453 ok(
hr ==
S_OK,
"Failed to create file stream, hr %#lx.\n",
hr);
4454 ok(stream2 !=
stream,
"Unexpected stream instance.\n");
4455 IDWriteFontFileStream_Release(stream2);
4459 ok(
hr ==
S_OK,
"Failed to create file stream, hr %#lx.\n",
hr);
4462 hr = IDWriteFontFileStream_GetLastWriteTime(stream2, &writetime);
4464 ok(writetime == 1,
"Unexpected write time.\n");
4466 IDWriteFontFileStream_Release(stream2);
4469 ok(
hr ==
S_OK,
"Failed to get stream size, hr %#lx.\n",
hr);
4470 ok(
size == data_size,
"Unexpected stream size.\n");
4472 hr = IDWriteFontFileStream_GetLastWriteTime(
stream, &writetime);
4475 fragment_context =
NULL;
4476 hr = IDWriteFontFileStream_ReadFileFragment(
stream, &fragment, 0,
size, &fragment_context);
4477 ok(
hr ==
S_OK,
"Failed to read fragment, hr %#lx.\n",
hr);
4478 ok(fragment_context !=
NULL,
"Unexpected context %p.\n", fragment_context);
4479 ok(fragment == fragment_context,
"Unexpected data pointer %p, context %p.\n", fragment, fragment_context);
4480 IDWriteFontFileStream_ReleaseFileFragment(
stream, fragment_context);
4482 hr = IDWriteFontFileStream_ReadFileFragment(
stream, &fragment, 0,
size + 1, &fragment_context);
4485 hr = IDWriteFontFileStream_ReadFileFragment(
stream, &fragment,
size - 1,
size / 2, &fragment_context);
4488 IDWriteFontFileStream_Release(
stream);
4490 IDWriteFontFileLoader_Release(
loader);
4491 IDWriteFontFile_Release(
file);
4493 IDWriteFontFace_Release(fontface);
4504 IDWriteGdiInterop_Release(interop);
4506 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4522 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
4525 memset(&logfont, 0,
sizeof(logfont));
4532 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
4537 hr = IDWriteFont_CreateFontFace(
font, &fontface);
4539 simulations = IDWriteFontFace_GetSimulations(fontface);
4541 IDWriteFontFace_Release(fontface);
4542 IDWriteFont_Release(
font);
4544 memset(&logfont, 0,
sizeof(logfont));
4551 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
4556 hr = IDWriteFont_CreateFontFace(
font, &fontface);
4558 simulations = IDWriteFontFace_GetSimulations(fontface);
4560 IDWriteFontFace_Release(fontface);
4561 IDWriteFont_Release(
font);
4563 IDWriteGdiInterop_Release(interop);
4565 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4571 IDWriteFontFace3 *fontface3;
4585 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
4588 memset(&logfont, 0,
sizeof(logfont));
4595 hr = IDWriteGdiInterop_CreateFontFromLOGFONT(interop, &logfont, &
font);
4601 hr = IDWriteFont_GetFaceNames(
font, &strings2);
4604 IDWriteLocalizedStrings_Release(strings2);
4611 hr = IDWriteLocalizedStrings_FindLocaleName(
strings,
L"en-Us", &
index, &exists);
4613 ok(
index == 0 && exists,
"got %d, %d\n",
index, exists);
4616 hr = IDWriteLocalizedStrings_GetLocaleNameLength(
strings, 1, &
count);
4630 IDWriteLocalizedStrings_Release(
strings);
4632 hr = IDWriteFont_CreateFontFace(
font, &fontface);
4633 ok(
hr ==
S_OK,
"Failed to create a font face, hr %#lx.\n",
hr);
4635 if (
SUCCEEDED(IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (
void **)&fontface3)))
4637 hr = IDWriteFontFace3_GetFaceNames(fontface3, &strings2);
4638 ok(
hr ==
S_OK,
"Failed to get face names, hr %#lx.\n",
hr);
4640 hr = IDWriteFontFace3_GetFaceNames(fontface3, &strings3);
4641 ok(
hr ==
S_OK,
"Failed to get face names, hr %#lx.\n",
hr);
4642 ok(strings2 != strings3,
"Unexpected instance.\n");
4643 IDWriteLocalizedStrings_Release(strings3);
4646 hr = IDWriteLocalizedStrings_GetString(strings2, 0, buffW,
ARRAY_SIZE(buffW));
4647 ok(
hr ==
S_OK,
"Failed to get a string, hr %#lx.\n",
hr);
4649 IDWriteLocalizedStrings_Release(strings2);
4651 IDWriteFontFace3_Release(fontface3);
4654 win_skip(
"GetFaceNames() is not supported.\n");
4656 IDWriteFontFace_Release(fontface);
4658 IDWriteFont_Release(
font);
4659 IDWriteGdiInterop_Release(interop);
4661 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4676 const void *
table, *table2;
4697 hr = IDWriteFontFile_GetReferenceKey(
file, (
const void**)&
key, &
size);
4703 ok(!
memcmp(&
info.ftLastWriteTime, &
key->writetime,
sizeof(
key->writetime)),
"got wrong write time\n");
4707 IDWriteFontFileLoader_QueryInterface(
loader, &IID_IDWriteLocalFontFileLoader, (
void**)&localloader);
4708 IDWriteFontFileLoader_Release(
loader);
4710 hr = IDWriteLocalFontFileLoader_GetFilePathLengthFromKey(localloader,
key,
size, &
len);
4714 hr = IDWriteLocalFontFileLoader_GetFilePathFromKey(localloader,
key,
size, buffW,
ARRAY_SIZE(buffW));
4717 IDWriteLocalFontFileLoader_Release(localloader);
4727 ok(exists ==
TRUE,
"got %d\n", exists);
4731 context2 = (
void*)0xdeadbeef;
4733 hr = IDWriteFontFace_TryGetFontTable(fontface,
MS_CMAP_TAG, &table2, &
size, &context2, &exists);
4735 ok(exists ==
TRUE,
"got %d\n", exists);
4736 ok(context2 ==
context && table2 ==
table,
"cmap: context2 %p, table2 %p\n", context2, table2);
4738 IDWriteFontFace_ReleaseFontTable(fontface, context2);
4739 IDWriteFontFace_ReleaseFontTable(fontface,
context);
4744 table = (
void*)0xdeadbeef;
4745 hr = IDWriteFontFace_TryGetFontTable(fontface, 0xabababab, &
table, &
size, &
context, &exists);
4747 ok(exists ==
FALSE,
"got %d\n", exists);
4750 IDWriteFontFace_Release(fontface);
4751 IDWriteFontFile_Release(
file);
4753 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4774 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
4780 hr = IDWriteFontCollection_GetFontFamily(
collection, 0, &family);
4788 IDWriteGdiInterop_ConvertFontToLOGFONT(interop,
NULL,
NULL,
NULL);
4789 IDWriteGdiInterop_ConvertFontToLOGFONT(interop,
NULL, &logfont,
NULL);
4790 IDWriteGdiInterop_ConvertFontToLOGFONT(interop,
font,
NULL, &
system);
4793 memset(&logfont, 0xcc,
sizeof(logfont));
4795 hr = IDWriteGdiInterop_ConvertFontToLOGFONT(interop,
NULL, &logfont, &
system);
4802 WCHAR nameW[128], familynameW[64], facenameW[64];
4810 hr = IDWriteFontCollection_GetFontFamily(
collection,
i, &family);
4813 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
4817 IDWriteLocalizedStrings_Release(
names);
4819 font_count = IDWriteFontFamily_GetFontCount(family);
4821 for (
j = 0;
j < font_count; ++
j)
4824 BOOL has_variations;
4826 hr = IDWriteFontFamily_GetFont(family,
j, &
font);
4833 IDWriteLocalizedStrings_Release(
names);
4839 hr = IDWriteFont_CreateFontFace(
font, &fontface);
4843 IDWriteFontFace_Release(fontface);
4849 skip(
"ConvertFontToLOGFONT() test does not support variable fonts.\n");
4850 IDWriteFont_Release(
font);
4855 memset(&logfont, 0xcc,
sizeof(logfont));
4856 hr = IDWriteGdiInterop_ConvertFontToLOGFONT(interop,
font, &logfont, &
system);
4860 sim = IDWriteFont_GetSimulations(
font);
4865 ok(logfont.
lfWeight == lf.
lfWeight,
"Unexpected lfWeight %ld, expected lfWeight %ld, font weight %d, "
4868 ok(logfont.
lfItalic == lf.
lfItalic,
"Unexpected italic flag %d, oblique simulation %s.\n",
4880 IDWriteFont_Release(
font);
4883 IDWriteFontFamily_Release(family);
4886 IDWriteFactory_Release(factory2);
4889 IDWriteFontFamily_Release(family);
4890 IDWriteFont_Release(
font);
4891 IDWriteGdiInterop_Release(interop);
4893 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4919 hr = IDWriteFontFile_GetReferenceKey(
file, (
const void**)&
key, &
size);
4925 IDWriteFontFileLoader_QueryInterface(
loader, &IID_IDWriteLocalFontFileLoader, (
void**)&localloader);
4926 IDWriteFontFileLoader_Release(
loader);
4928 hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader,
key,
size, &
stream);
4932 hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader,
key,
size, &stream2);
4937 IDWriteFontFileStream_Release(
stream);
4938 IDWriteFontFileStream_Release(stream2);
4940 hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader,
key,
size, &
stream);
4949 IDWriteFontFileStream_Release(
stream);
4950 IDWriteFontFile_Release(
file);
4952 IDWriteLocalFontFileLoader_Release(localloader);
4954 ok(
ref == 0,
"factory not released, %lu\n",
ref);
4965 const void *fragment, *fragment2;
4982 hr = IDWriteFontFile_GetReferenceKey(
file, (
const void**)&
key, &
size);
4988 IDWriteFontFileLoader_QueryInterface(
loader, &IID_IDWriteLocalFontFileLoader, (
void**)&localloader);
4989 IDWriteFontFileLoader_Release(
loader);
4991 hr = IDWriteLocalFontFileLoader_CreateStreamFromKey(localloader,
key,
size, &
stream);
4994 hr = IDWriteFontFileStream_GetFileSize(
stream, &filesize);
4998 fragment = (
void*)0xdeadbeef;
5000 hr = IDWriteFontFileStream_ReadFileFragment(
stream, &fragment, 0, filesize+1, &
context);
5003 ok(fragment ==
NULL,
"got %p\n", fragment);
5005 fragment = (
void*)0xdeadbeef;
5007 hr = IDWriteFontFileStream_ReadFileFragment(
stream, &fragment, 0, filesize, &
context);
5010 ok(fragment !=
NULL,
"got %p\n", fragment);
5012 fragment2 = (
void*)0xdeadbeef;
5013 context2 = (
void*)0xdeadbeef;
5014 hr = IDWriteFontFileStream_ReadFileFragment(
stream, &fragment2, 0, filesize, &context2);
5016 ok(context2 ==
NULL,
"got %p\n", context2);
5017 ok(fragment == fragment2,
"got %p, %p\n", fragment, fragment2);
5020 IDWriteFontFileStream_ReleaseFileFragment(
stream, context2);
5023 fragment = (
void*)0xdeadbeef;
5025 hr = IDWriteFontFileStream_ReadFileFragment(
stream, &fragment, 0, filesize, &
context);
5028 ok(fragment == fragment2,
"got %p, %p\n", fragment, fragment2);
5031 IDWriteFontFile_Release(
file);
5032 IDWriteFontFileStream_Release(
stream);
5033 IDWriteLocalFontFileLoader_Release(localloader);
5035 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5061 IDWriteFontFile_Release(
file);
5065 hr = IDWriteFontFace_GetGlyphIndices(fontface, &codepoint, 1, &
indices[0]);
5086 IDWriteFontFace_Release(fontface);
5088 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5101 &post_context, &exists);
5107 IDWriteFontFace1_ReleaseFontTable(fontface, post_context);
5113 return is_monospaced;
5128 win_skip(
"IsMonospacedFont() is not supported.\n");
5133 ok(
hr ==
S_OK,
"Failed to get font collection, hr %#lx.\n",
hr);
5143 hr = IDWriteFontCollection_GetFontFamily(
collection,
i, &family);
5144 ok(
hr ==
S_OK,
"Failed to get family, hr %#lx.\n",
hr);
5146 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
5147 ok(
hr ==
S_OK,
"Failed to get names, hr %#lx.\n",
hr);
5149 IDWriteLocalizedStrings_Release(
names);
5151 font_count = IDWriteFontFamily_GetFontCount(family);
5153 for (
j = 0;
j < font_count; ++
j)
5155 BOOL is_monospaced_font, is_monospaced_face, is_monospaced_expected;
5162 hr = IDWriteFontFamily_GetFont(family,
j, &
font);
5163 ok(
hr ==
S_OK,
"Failed to get font, hr %#lx.\n",
hr);
5165 hr = IDWriteFont_QueryInterface(
font, &IID_IDWriteFont1, (
void **)&font1);
5166 ok(
hr ==
S_OK,
"Failed to get interface, hr %#lx.\n",
hr);
5167 IDWriteFont_Release(
font);
5169 hr = IDWriteFont1_CreateFontFace(font1, &fontface);
5170 ok(
hr ==
S_OK,
"Failed to create fontface, hr %#lx.\n",
hr);
5172 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void **)&fontface1);
5173 ok(
hr ==
S_OK,
"Failed to get interface, hr %#lx.\n",
hr);
5174 IDWriteFontFace_Release(fontface);
5176 is_monospaced_font = IDWriteFont1_IsMonospacedFont(font1);
5177 is_monospaced_face = IDWriteFontFace1_IsMonospacedFont(fontface1);
5178 ok(is_monospaced_font == is_monospaced_face,
"Unexpected monospaced flag.\n");
5180 IDWriteFont1_GetPanose(font1, &panose);
5183 ok(is_monospaced_expected == is_monospaced_face,
"Unexpected is_monospaced flag %d for %s, font %d.\n",
5186 IDWriteFontFace1_Release(fontface1);
5187 IDWriteFont1_Release(font1);
5190 IDWriteFontFamily_Release(family);
5195 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5218 IDWriteFontFile_Release(
file);
5220 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
5228 hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &codepoint, 1, &
index);
5243 IDWriteFontFace1_Release(fontface1);
5246 win_skip(
"GetDesignGlyphAdvances() is not supported.\n");
5248 IDWriteFontFace_Release(fontface);
5250 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5275 IDWriteFontFile_Release(
file);
5279 hr = IDWriteFontFace_GetGlyphIndices(
face, &codepoint, 1, glyphs);
5281 ok(glyphs[0] > 0,
"got %u\n", glyphs[0]);
5282 glyphs[1] = glyphs[0];
5293 offsets[0].advanceOffset = 1.0;
5294 offsets[0].ascenderOffset = 1.0;
5295 offsets[1].advanceOffset = 0.0;
5296 offsets[1].ascenderOffset = 0.0;
5373 hr = IDWriteFontFace_GetGlyphIndices(
face, &codepoint, 1, glyphs);
5375 ok(glyphs[0] > 0,
"got %u\n", glyphs[0]);
5382 IDWriteFactory_Release(
factory);
5383 IDWriteFontFace_Release(
face);
5392 hr = IDWriteFontFace_GetGlyphIndices(
face, &codepoint, 1, glyphs);
5394 ok(glyphs[0] > 0,
"got %u\n", glyphs[0]);
5401 IDWriteFontFace_Release(
face);
5403 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5415 win_skip(
"GetEudcFontCollection() is not supported.\n");
5420 hr = IDWriteFactory1_GetEudcFontCollection(
factory, &coll,
FALSE);
5423 hr = IDWriteFactory1_GetEudcFontCollection(
factory, &coll2,
FALSE);
5426 ok(coll == coll2,
"got %p, %p\n", coll, coll2);
5427 IDWriteFontCollection_Release(coll);
5428 IDWriteFontCollection_Release(coll2);
5431 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5455 IDWriteFontFile_Release(
file);
5457 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
5458 IDWriteFontFace_Release(fontface);
5460 win_skip(
"GetCaretMetrics() is not supported.\n");
5462 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5467 memset(&caret, 0xcc,
sizeof(caret));
5468 IDWriteFontFace1_GetCaretMetrics(fontface1, &caret);
5472 IDWriteFontFace1_Release(fontface1);
5473 IDWriteFactory_Release(
factory);
5478 hr = IDWriteFont_CreateFontFace(
font, &fontface);
5480 IDWriteFont_Release(
font);
5481 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
5483 IDWriteFontFace_Release(fontface);
5485 memset(&caret, 0xcc,
sizeof(caret));
5486 IDWriteFontFace1_GetCaretMetrics(fontface1, &caret);
5490 IDWriteFontFace1_Release(fontface1);
5494 hr = IDWriteFont_CreateFontFace(
font, &fontface);
5496 IDWriteFont_Release(
font);
5497 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
5499 IDWriteFontFace_Release(fontface);
5501 IDWriteFontFace1_GetMetrics(fontface1, &
metrics);
5503 memset(&caret, 0xcc,
sizeof(caret));
5504 IDWriteFontFace1_GetCaretMetrics(fontface1, &caret);
5508 IDWriteFontFace1_Release(fontface1);
5511 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5533 IDWriteFontFile_Release(
file);
5535 count = IDWriteFontFace_GetGlyphCount(fontface);
5538 IDWriteFontFace_Release(fontface);
5540 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5562 IDWriteFontFile_Release(
file);
5564 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
5566 INT32 adjustments[1];
5568 hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 0,
NULL,
NULL);
5572 hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 1,
NULL,
NULL);
5575 hr = IDWriteFontFace1_GetKerningPairAdjustments(fontface1, 1,
NULL, adjustments);
5577 ok(adjustments[0] == 0,
"got %d\n", adjustments[0]);
5579 IDWriteFontFace1_Release(fontface1);
5582 win_skip(
"GetKerningPairAdjustments() is not supported.\n");
5584 IDWriteFontFace_Release(fontface);
5586 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5596 IDWriteFactory3 *factory3;
5607 hr = IDWriteRenderingParams_QueryInterface(
params, &IID_IDWriteRenderingParams1, (
void**)¶ms1);
5612 enhcontrast = IDWriteRenderingParams1_GetGrayscaleEnhancedContrast(params1);
5613 ok(enhcontrast == 1.0,
"got %.2f\n", enhcontrast);
5614 IDWriteRenderingParams1_Release(params1);
5616 hr = IDWriteRenderingParams_QueryInterface(
params, &IID_IDWriteRenderingParams2, (
void**)¶ms2);
5621 gridfit = IDWriteRenderingParams2_GetGridFitMode(params2);
5624 IDWriteRenderingParams2_Release(params2);
5627 win_skip(
"IDWriteRenderingParams2 not supported.\n");
5630 win_skip(
"IDWriteRenderingParams1 not supported.\n");
5632 IDWriteRenderingParams_Release(
params);
5637 mode = IDWriteRenderingParams_GetRenderingMode(
params);
5639 IDWriteRenderingParams_Release(
params);
5641 hr = IDWriteFactory_QueryInterface(
factory, &IID_IDWriteFactory3, (
void**)&factory3);
5649 hr = IDWriteRenderingParams3_QueryInterface(params3, &IID_IDWriteRenderingParams, (
void**)&
params);
5652 mode = IDWriteRenderingParams_GetRenderingMode(
params);
5655 IDWriteRenderingParams_Release(
params);
5656 IDWriteRenderingParams3_Release(params3);
5657 IDWriteFactory3_Release(factory3);
5660 win_skip(
"IDWriteRenderingParams3 not supported.\n");
5663 ok(
ref == 0,
"factory not released, %lu\n",
ref);
5678 IDWriteFactory3 *factory3;
5683 UINT16 glyph, glyphs[10];
5702 hr = IDWriteFontFace_GetGlyphIndices(
face, &
ch, 1, &glyph);
5704 ok(glyph > 0,
"got %u\n", glyph);
5708 advances[0] =
metrics.advanceWidth;
5710 offsets[0].advanceOffset = 0.0;
5711 offsets[0].ascenderOffset = 0.0;
5723 analysis = (
void*)0xdeadbeef;
5724 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 0.0,
NULL,
5726 0.0, 0.0, &analysis);
5728 ok(analysis ==
NULL,
"got %p\n", analysis);
5731 analysis = (
void*)0xdeadbeef;
5732 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, -1.0,
NULL,
5734 0.0, 0.0, &analysis);
5736 ok(analysis ==
NULL,
"got %p\n", analysis);
5739 analysis = (
void*)0xdeadbeef;
5740 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5742 0.0, 0.0, &analysis);
5744 ok(analysis ==
NULL,
"got %p\n", analysis);
5747 analysis = (
void*)0xdeadbeef;
5748 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5750 0.0, 0.0, &analysis);
5752 ok(analysis ==
NULL,
"got %p\n", analysis);
5754 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5756 0.0, 0.0, &analysis);
5771 IDWriteGlyphRunAnalysis_Release(analysis);
5774 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 2.0,
NULL,
5776 0.0, 0.0, &analysis);
5783 IDWriteGlyphRunAnalysis_Release(analysis);
5785 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5787 10.0, -5.0, &analysis);
5794 IDWriteGlyphRunAnalysis_Release(analysis);
5801 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5803 0.0, 0.0, &analysis);
5829 IDWriteGlyphRunAnalysis_Release(analysis);
5832 IDWriteFontFace_GetMetrics(run.
fontFace, &fm);
5839 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5841 0.0, 0.0, &analysis);
5861 IDWriteGlyphRunAnalysis_Release(analysis);
5874 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5876 0.0, 0.0, &analysis);
5884 IDWriteGlyphRunAnalysis_Release(analysis);
5896 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5898 0.0, 0.0, &analysis);
5906 IDWriteGlyphRunAnalysis_Release(analysis);
5909 glyphs[0] = glyphs[1] = glyph;
5910 advances[0] = advances[1] = 100.0f;
5920 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5922 0.0, 0.0, &analysis);
5931 IDWriteGlyphRunAnalysis_Release(analysis);
5933 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 2.0,
NULL,
5935 0.0, 0.0, &analysis);
5942 IDWriteGlyphRunAnalysis_Release(analysis);
5945 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
5947 0.0, 0.0, &analysis);
5954 IDWriteGlyphRunAnalysis_Release(analysis);
5959 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0, &
m,
5961 0.0, 0.0, &analysis);
5970 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0, &
m,
5972 0.0, 0.0, &analysis2);
5974 ok(analysis2 != analysis,
"got %p, previous instance %p\n", analysis2, analysis);
5975 IDWriteGlyphRunAnalysis_Release(analysis2);
5977 IDWriteGlyphRunAnalysis_Release(analysis);
5979 if (IDWriteFactory_QueryInterface(
factory, &IID_IDWriteFactory2, (
void **)&factory2) ==
S_OK) {
5980 FLOAT gamma, contrast, cleartype_level;
5985 0.0f, 0.0f, &analysis);
5991 0.0f, 0.0f, &analysis);
5997 0.0f, 0.0f, &analysis);
6003 0.0f, 0.0f, &analysis);
6009 0.0f, 0.0f, &analysis);
6012 IDWriteGlyphRunAnalysis_Release(analysis);
6017 0.0f, 0.0f, &analysis);
6018 ok(
hr ==
S_OK,
"Failed to create analysis, hr %#lx.\n",
hr);
6022 ok(
hr ==
S_OK,
"Failed to get texture bounds, hr %#lx.\n",
hr);
6027 ok(
hr ==
S_OK,
"Failed to get texture bounds, hr %#lx.\n",
hr);
6034 ok(
hr ==
S_OK,
"Failed to get alpha texture, hr %#lx.\n",
hr);
6050 ok(
hr ==
S_OK,
"Failed to create custom parameters, hr %#lx.\n",
hr);
6052 hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis,
params, &gamma, &contrast, &cleartype_level);
6053 ok(
hr ==
S_OK,
"Failed to get alpha blend params, hr %#lx.\n",
hr);
6055 ok(cleartype_level == 0.0f,
"Unexpected cleartype level %f.\n", cleartype_level);
6057 IDWriteRenderingParams_Release(
params);
6058 IDWriteGlyphRunAnalysis_Release(analysis);
6060 IDWriteFactory2_Release(factory2);
6063 if (IDWriteFactory_QueryInterface(
factory, &IID_IDWriteFactory3, (
void **)&factory3) ==
S_OK) {
6068 0.0f, 0.0f, &analysis);
6074 0.0f, 0.0f, &analysis);
6080 0.0f, 0.0f, &analysis);
6086 DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE, 0.0f, 0.0f, &analysis);
6091 0.0f, 0.0f, &analysis);
6092 ok(
hr ==
S_OK,
"Failed to create analysis, hr %#lx.\n",
hr);
6093 IDWriteGlyphRunAnalysis_Release(analysis);
6098 0.0f, 0.0f, &analysis);
6099 ok(
hr ==
S_OK,
"Failed to create analysis, hr %#lx.\n",
hr);
6103 ok(
hr ==
S_OK,
"Failed to get texture bounds, hr %#lx.\n",
hr);
6108 ok(
hr ==
S_OK,
"Failed to get texture bounds, hr %#lx.\n",
hr);
6115 ok(
hr ==
S_OK,
"Failed to get alpha texture, hr %#lx.\n",
hr);
6129 IDWriteGlyphRunAnalysis_Release(analysis);
6131 IDWriteFactory3_Release(factory3);
6134 IDWriteFontFace_Release(
face);
6136 ok(
ref == 0,
"factory not released, %lu\n",
ref);
6139#define round(x) ((int)floor((x) + 0.5))
6172 WORD num_ratios,
i, group_offset = 0;
6174 BYTE dev_x_ratio = 1, dev_y_ratio = 1;
6178 for (
i = 0;
i < num_ratios;
i++)
6204 if (emsize < group->startsz || emsize >=
group->endsz)
return FALSE;
6207 for (
i = 0;
i < recs;
i++)
6213 trace(
"FIXME interpolate %d\n", emsize);
6231 ok(
metrics->designUnitsPerEm ==
expected->designUnitsPerEm,
"got %u expect %u.\n",
6238 ok(
metrics->underlinePosition ==
expected->underlinePosition,
"ulP: got %d expect %d.\n",
6240 ok(
metrics->underlineThickness ==
expected->underlineThickness,
"ulTh: got %u expect %u.\n",
6242 ok(
metrics->strikethroughPosition ==
expected->strikethroughPosition,
"stP: got %d expect %d.\n",
6244 ok(
metrics->strikethroughThickness ==
expected->strikethroughThickness,
"stTh: got %u expect %u.\n",
6254 ok(
metrics->designUnitsPerEm ==
expected->designUnitsPerEm,
"got %u expect %u.\n",
6261 ok(
metrics->underlinePosition ==
expected->underlinePosition,
"ulP: got %d expect %d.\n",
6263 ok(
metrics->underlineThickness ==
expected->underlineThickness,
"ulTh: got %u expect %u.\n",
6265 ok(
metrics->strikethroughPosition ==
expected->strikethroughPosition,
"stP: got %d expect %d.\n",
6267 ok(
metrics->strikethroughThickness ==
expected->strikethroughThickness,
"stTh: got %u expect %u.\n",
6269 ok(
metrics->glyphBoxLeft ==
expected->glyphBoxLeft,
"box left: got %d expect %d.\n",
6272 ok(
metrics->glyphBoxTop ==
expected->glyphBoxTop,
"box top: got %d expect %d.\n",
6274 ok(
metrics->glyphBoxRight ==
expected->glyphBoxRight,
"box right: got %d expect %d.\n",
6277 ok(
metrics->glyphBoxBottom ==
expected->glyphBoxBottom,
"box bottom: got %d expect %d.\n",
6279 ok(
metrics->subscriptPositionX ==
expected->subscriptPositionX,
"subX: got %d expect %d.\n",
6281 ok(
metrics->subscriptPositionY ==
expected->subscriptPositionY,
"subY: got %d expect %d.\n",
6283 ok(
metrics->subscriptSizeX ==
expected->subscriptSizeX,
"subsizeX: got %d expect %d.\n",
6285 ok(
metrics->subscriptPositionY ==
expected->subscriptPositionY,
"subsizeY: got %d expect %d.\n",
6287 ok(
metrics->superscriptPositionX ==
expected->superscriptPositionX,
"supX: got %d expect %d.\n",
6290 ok(
metrics->superscriptPositionY ==
expected->superscriptPositionY,
"supY: got %d expect %d.\n",
6292 ok(
metrics->superscriptSizeX ==
expected->superscriptSizeX,
"supsizeX: got %d expect %d.\n",
6294 ok(
metrics->superscriptSizeY ==
expected->superscriptSizeY,
"supsizeY: got %d expect %d.\n",
6296 ok(
metrics->hasTypographicMetrics ==
expected->hasTypographicMetrics,
"hastypo: got %d expect %d.\n",
6309 { { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 1.0, 5.0 },
6310 { { 0.0, 0.0, 0.0, -1.0, 0.0, 0.0 }, 1.0, 5.0 },
6311 { { 0.0, 0.0, 0.0, -1.0, 0.0, 0.0 }, 2.0, 5.0 },
6312 { { 0.0, 0.0, 0.0, 3.0, 0.0, 0.0 }, 2.0, 5.0 },
6313 { { 0.0, 0.0, 0.0, -3.0, 0.0, 0.0 }, 2.0, 5.0 },
6314 { { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }, 2.0, 5.0 },
6315 { { 1.0, 0.0, 0.0, 1.0, 5.0, 0.0 }, 2.0, 5.0 },
6316 { { 1.0, 0.0, 0.0, 1.0, 0.0, 5.0 }, 2.0, 5.0 },
6336 int ascent, descent;
6344 hr = IDWriteFontFace_QueryInterface(
face, &IID_IDWriteFontFace1, (
void**)&fontface1);
6346 win_skip(
"gdi compatible DWRITE_FONT_METRICS1 are not supported.\n");
6349 IDWriteFontFace1_GetMetrics(fontface1, &design_metrics1);
6350 memcpy(&design_metrics, &design_metrics1,
sizeof(design_metrics));
6353 IDWriteFontFace_GetMetrics(
face, &design_metrics);
6356 &vdmx_len, &vdmx_ctx, &exists);
6357 if (
hr !=
S_OK || !exists)
6363 memset(&comp_metrics, 0xcc,
sizeof(comp_metrics));
6365 hr = IDWriteFontFace_GetGdiCompatibleMetrics(
face, -10.0, 1.0,
NULL, &comp_metrics);
6370 memset(&comp_metrics, 0xcc,
sizeof(comp_metrics));
6372 hr = IDWriteFontFace_GetGdiCompatibleMetrics(
face, 0.0, 1.0,
NULL, &comp_metrics);
6377 memset(&comp_metrics, 0xcc,
sizeof(comp_metrics));
6379 hr = IDWriteFontFace_GetGdiCompatibleMetrics(
face, 5.0, 0.0,
NULL, &comp_metrics);
6383 memset(&comp_metrics, 0xcc,
sizeof(comp_metrics));
6384 hr = IDWriteFontFace_GetGdiCompatibleMetrics(
face, 5.0, -1.0,
NULL, &comp_metrics);
6392 hr = IDWriteFontFace_GetGdiCompatibleMetrics(
face,
ptr->emsize,
ptr->ppdip, &
ptr->m, &comp_metrics);
6402 hr = IDWriteFontFace1_GetGdiCompatibleMetrics(fontface1,
emsize, 1.0,
NULL, &comp_metrics1);
6406 hr = IDWriteFontFace_GetGdiCompatibleMetrics(
face,
emsize, 1.0,
NULL, &comp_metrics);
6456 IDWriteFontFace1_Release(fontface1);
6457 if (vdmx) IDWriteFontFace_ReleaseFontTable(
face, vdmx_ctx);
6471 hr = IDWriteFont_CreateFontFace(
font, &fontface);
6473 IDWriteFont_Release(
font);
6475 IDWriteFontFace_Release(fontface);
6479 skip(
"Skipping tests with Arial\n");
6482 hr = IDWriteFont_CreateFontFace(
font, &fontface);
6484 IDWriteFont_Release(
font);
6487 IDWriteFontFace_Release(fontface);
6491 ok(
ref == 0,
"factory not released, %lu\n",
ref);
6505 hr = IDWriteFont1_CreateFontFace(
font, &fontface);
6508 hr = IDWriteFontFace_TryGetFontTable(fontface,
MS_OS2_TAG, (
const void **)&
tt_os2, &
size, &os2_context, &exists);
6513 IDWriteFontFace_ReleaseFontTable(fontface, os2_context);
6516 IDWriteFontFace_Release(fontface);
6532 hr = IDWriteFont_QueryInterface(
font, &IID_IDWriteFont1, (
void **)&font1);
6533 IDWriteFont_Release(
font);
6537 ok(
ref == 0,
"factory not released, %lu\n",
ref);
6538 win_skip(
"GetPanose() is not supported.\n");
6541 IDWriteFont1_Release(font1);
6543 hr = IDWriteFactory_GetSystemFontCollection(
factory, &syscollection,
FALSE);
6545 count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
6550 IDWriteFontFace3 *fontface3;
6557 hr = IDWriteFontCollection_GetFontFamily(syscollection,
i, &family);
6564 hr = IDWriteFont_QueryInterface(
font, &IID_IDWriteFont1, (
void **)&font1);
6566 IDWriteFont_Release(
font);
6568 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
6573 IDWriteLocalizedStrings_Release(
names);
6575 IDWriteFont1_GetPanose(font1, &
panose);
6580 ok(
panose.values[0] == expected_panose.
values[0],
"values[0] %#x, expected %#x.\n",
6582 ok(
panose.values[1] == expected_panose.
values[1],
"values[1] %#x, expected %#x.\n",
6584 ok(
panose.values[2] == expected_panose.
values[2],
"values[2] %#x, expected %#x.\n",
6586 ok(
panose.values[3] == expected_panose.
values[3],
"values[3] %#x, expected %#x.\n",
6588 ok(
panose.values[4] == expected_panose.
values[4],
"values[4] %#x, expected %#x.\n",
6590 ok(
panose.values[5] == expected_panose.
values[5],
"values[5] %#x, expected %#x.\n",
6592 ok(
panose.values[6] == expected_panose.
values[6],
"values[6] %#x, expected %#x.\n",
6594 ok(
panose.values[7] == expected_panose.
values[7],
"values[7] %#x, expected %#x.\n",
6596 ok(
panose.values[8] == expected_panose.
values[8],
"values[8] %#x, expected %#x.\n",
6598 ok(
panose.values[9] == expected_panose.
values[9],
"values[9] %#x, expected %#x.\n",
6603 hr = IDWriteFont1_CreateFontFace(font1, &fontface);
6604 ok(
hr ==
S_OK,
"Failed to create a font face, %#lx.\n",
hr);
6605 if (IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (
void **)&fontface3) ==
S_OK) {
6606 ok(!
memcmp(&
panose, &expected_panose,
sizeof(
panose)),
"%s: Unexpected panose from font face.\n",
6608 IDWriteFontFace3_Release(fontface3);
6610 IDWriteFontFace_Release(fontface);
6612 IDWriteFont1_Release(font1);
6613 IDWriteFontFamily_Release(family);
6616 IDWriteFontCollection_Release(syscollection);
6618 ok(
ref == 0,
"factory not released, %lu\n",
ref);
6628 memset(&logfont, 0,
sizeof(logfont));
6663 hr = IDWriteFont_CreateFontFace(
font, &fontface);
6665 IDWriteFont_Release(
font);
6667 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void **)&fontface1);
6668 IDWriteFontFace_Release(fontface);
6672 ok(
ref == 0,
"factory not released, %lu\n",
ref);
6673 win_skip(
"GetGdiCompatibleGlyphAdvances() is not supported\n");
6679 hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &codepoint, 1, &glyph);
6681 ok(glyph > 0,
"got %u\n", glyph);
6685 hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 0.0,
6692 hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, -1.0,
6699 hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 1.0,
6706 hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, 1.0,
6711 IDWriteFontFace1_GetMetrics(fontface1, &fm);
6719 hr = IDWriteFontFace1_GetGdiCompatibleGlyphAdvances(fontface1, emsize,
6725 ok((
advance - gdi_advance) <= 2,
"%.0f: got advance %d, expected %d\n", emsize,
advance, gdi_advance);
6730 IDWriteFontFace1_Release(fontface1);
6732 ok(
ref == 0,
"factory not released, %lu\n",
ref);
6749 (
const void**)&
ptr, &
size, &ctxt, &exists);
6758 ok(0,
"unsupported gasp table: ver %d size %d recs %d\n",
version,
size, num_recs);
6770 IDWriteFontFace_ReleaseFontTable(fontface, ctxt);
6774#define GASP_GRIDFIT 0x0001
6775#define GASP_DOGRAY 0x0002
6776#define GASP_SYMMETRIC_GRIDFIT 0x0004
6777#define GASP_SYMMETRIC_SMOOTHING 0x0008
6783 static const FLOAT aa_threshold = 100.0f;
6784 static const FLOAT a_threshold = 350.0f;
6785 static const FLOAT naturalemsize = 20.0f;
6819 static const FLOAT aa_threshold = 100.0f;
6820 static const FLOAT a_threshold = 350.0f;
6857 IDWriteFontFace3 *fontface3;
6871 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
6873 win_skip(
"IDWriteFontFace1::GetRecommendedRenderingMode() is not supported.\n");
6876 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (
void**)&fontface2);
6878 win_skip(
"IDWriteFontFace2::GetRecommendedRenderingMode() is not supported.\n");
6881 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (
void**)&fontface3);
6883 win_skip(
"IDWriteFontFace3::GetRecommendedRenderingMode() is not supported.\n");
6886 hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 3.0, 1.0,
6890 hr = IDWriteFontFace_GetRecommendedRenderingMode(fontface, 3.0, 1.0,
6901 for (emsize = 1.0; emsize < 500.0; emsize += 1.0)
6965 dpi = 96.0f * ppdip;
6969 hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize,
dpi,
dpi,
6979 dpi = 96.0f * ppdip;
6983 hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize,
dpi,
dpi,
6989 dpi = 96.0f * ppdip;
6993 hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize,
dpi,
dpi,
7000 dpi = 96.0f * ppdip;
7004 hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize,
dpi * 0.5f,
dpi,
7010 dpi = 96.0f * ppdip;
7014 hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize,
dpi,
dpi * 0.5f,
7020 dpi = 96.0f * ppdip;
7024 hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize,
dpi * 0.5f,
dpi,
7030 dpi = 96.0f * ppdip;
7034 hr = IDWriteFontFace1_GetRecommendedRenderingMode(fontface1, emsize,
dpi,
dpi * 0.5f,
7056 hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, emsize, 96.0f, 96.0f,
7060 ok(gridfit == expected_gridfit,
"gridfit: got %d, flags 0x%04x, expected %d.\n", gridfit, gasp, expected_gridfit);
7070 unsigned int expected1;
7080 hr = IDWriteFontFace3_GetRecommendedRenderingMode(fontface3, emsize, 96.0f, 96.0f,
7083 ok(mode1 == expected1,
"got %d, flags 0x%04x, expected %d.\n", mode1, gasp, expected1);
7084 ok(gridfit == expected_gridfit,
"gridfit: got %d, flags 0x%04x, expected %d.\n", gridfit, gasp, expected_gridfit);
7093 IDWriteRenderingParams_Release(
params);
7105 IDWriteRenderingParams_Release(
params);
7112 hr = IDWriteFactory_QueryInterface(
factory, &IID_IDWriteFactory2, (
void**)&factory2);
7121 hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0, 96.0, 96.0,
7130 hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0, 96.0, 96.0,
7137 IDWriteRenderingParams2_Release(params2);
7138 IDWriteFactory2_Release(factory2);
7145 IDWriteFactory3 *factory3;
7149 hr = IDWriteFactory_QueryInterface(
factory, &IID_IDWriteFactory3, (
void**)&factory3);
7156 mode1 = IDWriteRenderingParams3_GetRenderingMode1(params3);
7159 mode = IDWriteRenderingParams3_GetRenderingMode(params3);
7162 hr = IDWriteRenderingParams3_QueryInterface(params3, &IID_IDWriteRenderingParams, (
void**)&
params);
7165 mode = IDWriteRenderingParams_GetRenderingMode(
params);
7167 IDWriteRenderingParams_Release(
params);
7169 hr = IDWriteRenderingParams3_QueryInterface(params3, &IID_IDWriteRenderingParams2, (
void**)¶ms2);
7172 mode = IDWriteRenderingParams2_GetRenderingMode(params2);
7174 IDWriteRenderingParams2_Release(params2);
7178 hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0f, 96.0f, 96.0f,
7187 hr = IDWriteFontFace2_GetRecommendedRenderingMode(fontface2, 5.0f, 96.0f, 96.0f,
7194 IDWriteRenderingParams3_Release(params3);
7195 IDWriteFactory3_Release(factory3);
7199 IDWriteFontFace3_Release(fontface3);
7201 IDWriteFontFace2_Release(fontface2);
7203 IDWriteFontFace1_Release(fontface1);
7204 IDWriteFontFace_Release(fontface);
7206 ok(
ref == 0,
"factory not released, %lu\n",
ref);
7211 int x = *(
int *)&
left;
7219 return abs(
x -
y) <= 8;
7233 FLOAT gamma, contrast, ctlevel;
7253 hr = IDWriteFontFace_GetGlyphIndices(fontface, &
ch, 1, &glyph);
7255 ok(glyph > 0,
"got %u\n", glyph);
7257 hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, &glyph, 1, &
metrics,
FALSE);
7261 offset.advanceOffset = 0.0;
7262 offset.ascenderOffset = 0.0;
7280 expected_gdi_gamma = (
FLOAT)(
value / 1000.0);
7283 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
7285 0.0, 0.0, &analysis);
7288 gamma = contrast = ctlevel = -1.0;
7289 hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis,
NULL, &gamma, &contrast, &ctlevel);
7291 ok(gamma == -1.0,
"got %.2f\n", gamma);
7292 ok(contrast == -1.0,
"got %.2f\n", contrast);
7293 ok(ctlevel == -1.0,
"got %.2f\n", ctlevel);
7295 gamma = contrast = ctlevel = -1.0;
7296 hr = IDWriteGlyphRunAnalysis_GetAlphaBlendParams(analysis,
params, &gamma, &contrast, &ctlevel);
7300 ok(
float_eq(gamma, expected_gdi_gamma),
"got %.2f, expected %.2f\n", gamma, expected_gdi_gamma);
7301 ok(contrast == 0.0f,
"got %.2f\n", contrast);
7302 ok(ctlevel == 1.0f,
"got %.2f\n", ctlevel);
7305 ok(gamma == 0.9f,
"got %.2f\n", gamma);
7306 ok(contrast == 0.3f,
"got %.2f\n", contrast);
7307 ok(ctlevel == 0.1f,
"got %.2f\n", ctlevel);
7310 IDWriteGlyphRunAnalysis_Release(analysis);
7313 IDWriteRenderingParams_Release(
params);
7314 IDWriteFontFace_Release(fontface);
7316 ok(
ref == 0,
"factory not released, %lu\n",
ref);
7340 hr = IDWriteFontFace_GetGlyphIndices(fontface, &
ch, 1, &glyph);
7342 ok(glyph > 0,
"got %u\n", glyph);
7344 hr = IDWriteFontFace_GetDesignGlyphMetrics(fontface, &glyph, 1, &
metrics,
FALSE);
7348 offset.advanceOffset = 0.0;
7349 offset.ascenderOffset = 0.0;
7360 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
7362 0.0, 0.0, &analysis);
7394 IDWriteGlyphRunAnalysis_Release(analysis);
7396 hr = IDWriteFactory_CreateGlyphRunAnalysis(
factory, &run, 1.0,
NULL,
7398 0.0, 0.0, &analysis);
7456 IDWriteGlyphRunAnalysis_Release(analysis);
7457 IDWriteFontFace_Release(fontface);
7459 ok(
ref == 0,
"factory not released, %lu\n",
ref);
7474 hr = IDWriteFontFace_TryGetFontTable(fontface,
MS_OS2_TAG, (
const void **)&
tt_os2, &
size, &os2_context, &exists);
7475 ok(
hr ==
S_OK,
"Failed to get OS/2 table, hr %#lx.\n",
hr);
7480 IDWriteFontFace_ReleaseFontTable(fontface, os2_context);
7486 hr = IDWriteFontFace_TryGetFontTable(fontface,
MS_CMAP_TAG, (
const void **)&cmap.
data,
7494 for (
i = 0;
i < num_tables; ++
i)
7509 IDWriteFontFace_ReleaseFontTable(fontface, cmap.
context);
7537 hr = IDWriteFontCollection_GetFontFamily(
collection,
i, &family);
7538 ok(
hr ==
S_OK,
"Failed to get family, hr %#lx.\n",
hr);
7540 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
7541 ok(
hr ==
S_OK,
"Failed to get names, hr %#lx.\n",
hr);
7543 IDWriteLocalizedStrings_Release(
names);
7545 font_count = IDWriteFontFamily_GetFontCount(family);
7547 for (
j = 0;
j < font_count; ++
j)
7549 BOOL is_symbol_font, is_symbol_face, is_symbol_expected;
7551 hr = IDWriteFontFamily_GetFont(family,
j, &
font);
7552 ok(
hr ==
S_OK,
"Failed to get font, hr %#lx.\n",
hr);
7554 hr = IDWriteFont_CreateFontFace(
font, &fontface);
7555 ok(
hr ==
S_OK,
"Failed to create fontface, hr %#lx.\n",
hr);
7557 is_symbol_font = IDWriteFont_IsSymbolFont(
font);
7558 is_symbol_face = IDWriteFontFace_IsSymbolFont(fontface);
7559 ok(is_symbol_font == is_symbol_face,
"Unexpected symbol flag.\n");
7562 ok(is_symbol_expected == is_symbol_face,
"Unexpected is_symbol flag %d for %s, font %d.\n",
7565 IDWriteFontFace_Release(fontface);
7566 IDWriteFont_Release(
font);
7569 IDWriteFontFamily_Release(family);
7575 ok(
ref == 0,
"factory not released, %lu\n",
ref);
7595 UINT32 palettecount, entrycount,
size, colorrecords;
7606 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (
void**)&fontface2);
7607 IDWriteFontFace_Release(fontface);
7610 ok(
ref == 0,
"factory not released, %lu\n",
ref);
7611 win_skip(
"GetPaletteEntries() is not supported.\n");
7615 hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, 0, 1, &
color);
7617 IDWriteFontFace2_Release(fontface2);
7623 ok(
ref == 0,
"factory not released, %lu\n",
ref);
7624 skip(
"Segoe UI Emoji font not found.\n");
7628 hr = IDWriteFont_CreateFontFace(
font, &fontface);
7630 IDWriteFont_Release(
font);
7632 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (
void**)&fontface2);
7634 IDWriteFontFace_Release(fontface);
7636 palettecount = IDWriteFontFace2_GetColorPaletteCount(fontface2);
7637 ok(palettecount >= 1,
"got %u\n", palettecount);
7639 entrycount = IDWriteFontFace2_GetPaletteEntryCount(fontface2);
7640 ok(entrycount >= 1,
"got %u\n", entrycount);
7643 hr = IDWriteFontFace2_TryGetFontTable(fontface2,
MS_CPAL_TAG, (
const void**)&cpal_header, &
size, &ctxt, &exists);
7645 ok(exists,
"got %d\n", exists);
7647 ok(colorrecords >= 1,
"got %u\n", colorrecords);
7651 hr = IDWriteFontFace2_GetPaletteEntries(fontface2, palettecount, 0, 1, &
color);
7658 hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, entrycount, 1, &
color);
7664 hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, entrycount - 1, 1, &
color);
7671 hr = IDWriteFontFace2_GetPaletteEntries(fontface2, 0, 0, 0, &
color);
7676 IDWriteFontFace2_Release(fontface2);
7678 ok(
ref == 0,
"factory not released, %lu\n",
ref);
7701 win_skip(
"TranslateColorGlyphRun() is not supported.\n");
7708 codepoints[0] =
'A';
7709 hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs);
7721 layers = (
void*)0xdeadbeef;
7722 hr = IDWriteFactory2_TranslateColorGlyphRun(
factory, 0.0f, 0.0f, &run,
NULL,
7725 ok(layers ==
NULL,
"got %p\n", layers);
7726 IDWriteFontFace_Release(fontface);
7731 IDWriteFactory2_Release(
factory);
7732 skip(
"Segoe UI Emoji font not found.\n");
7736 hr = IDWriteFont_CreateFontFace(
font, &fontface);
7738 IDWriteFont_Release(
font);
7740 codepoints[0] = 0x26c4;
7741 hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs);
7747 hr = IDWriteFactory2_TranslateColorGlyphRun(
factory, 0.0f, 0.0f, &run,
NULL,
7750 ok(layers !=
NULL,
"got %p\n", layers);
7752 hr = IDWriteColorGlyphRunEnumerator_QueryInterface(layers, &IID_IDWriteColorGlyphRunEnumerator1, (
void **)&layers1);
7756 win_skip(
"IDWriteColorGlyphRunEnumerator1 is not supported.\n");
7762 hr = IDWriteColorGlyphRunEnumerator_MoveNext(layers, &hasrun);
7768 hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &colorrun);
7779 hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
7780 ok(
hr ==
S_OK,
"Failed to get color runt, hr %#lx.\n",
hr);
7791 hr = IDWriteColorGlyphRunEnumerator_GetCurrentRun(layers, &colorrun);
7796 hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
7800 IDWriteColorGlyphRunEnumerator_Release(layers);
7802 IDWriteColorGlyphRunEnumerator1_Release(layers1);
7804 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (
void**)&fontface2);
7808 layers = (
void*)0xdeadbeef;
7809 hr = IDWriteFactory2_TranslateColorGlyphRun(
factory, 0.0f, 0.0f, &run,
NULL,
7813 ok(layers ==
NULL,
"got %p\n", layers);
7816 hr = IDWriteFactory2_TranslateColorGlyphRun(
factory, 0.0f, 0.0f, &run,
NULL,
7820 IDWriteColorGlyphRunEnumerator_Release(layers);
7823 codepoints[0] =
'A';
7824 hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 1, glyphs);
7826 ok(!!*glyphs,
"Unexpected glyph.\n");
7828 layers = (
void*)0xdeadbeef;
7829 hr = IDWriteFactory2_TranslateColorGlyphRun(
factory, 0.0f, 0.0f, &run,
NULL,
7832 ok(layers ==
NULL,
"got %p\n", layers);
7835 codepoints[0] =
'A';
7836 codepoints[1] = 0x26c4;
7838 hr = IDWriteFontFace_GetGlyphIndices(fontface, codepoints, 2, glyphs);
7844 hr = IDWriteFactory2_TranslateColorGlyphRun(
factory, 0.0f, 0.0f, &run,
NULL,
7847 ok(layers !=
NULL,
"got %p\n", layers);
7849 hr = IDWriteColorGlyphRunEnumerator_QueryInterface(layers, &IID_IDWriteColorGlyphRunEnumerator1, (
void **)&layers1);
7855 hr = IDWriteColorGlyphRunEnumerator1_MoveNext(layers1, &hasrun);
7861 hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
7877 IDWriteColorGlyphRunEnumerator1_Release(layers1);
7879 IDWriteColorGlyphRunEnumerator_Release(layers);
7881 if (
SUCCEEDED(IDWriteFactory2_QueryInterface(
factory, &IID_IDWriteFactory4, (
void **)&factory4)))
7886 hr = IDWriteFactory4_TranslateColorGlyphRun(factory4,
origin, &run,
NULL,
7890 hr = IDWriteFactory4_TranslateColorGlyphRun(factory4,
origin, &run,
NULL,
7894 hr = IDWriteFactory4_TranslateColorGlyphRun(factory4,
origin, &run,
NULL,
7898 hr = IDWriteFactory4_TranslateColorGlyphRun(factory4,
origin, &run,
NULL,
7905 hr = IDWriteColorGlyphRunEnumerator1_MoveNext(layers1, &hasrun);
7911 hr = IDWriteColorGlyphRunEnumerator1_GetCurrentRun(layers1, &colorrun1);
7926 IDWriteColorGlyphRunEnumerator1_Release(layers1);
7928 IDWriteFactory4_Release(factory4);
7931 win_skip(
"IDWriteFactory4::TranslateColorGlyphRun() is not supported.\n");
7933 IDWriteFontFace2_Release(fontface2);
7934 IDWriteFontFace_Release(fontface);
7936 ok(
ref == 0,
"factory not released, %lu\n",
ref);
7941 IDWriteFactory3 *factory3;
7955 hr = IDWriteFactory_QueryInterface(
factory, &IID_IDWriteFactory3, (
void**)&factory3);
7957 hr = IDWriteFont_QueryInterface(
font, &IID_IDWriteFont3, (
void**)&font3);
7960 ret = IDWriteFont3_HasCharacter(font3,
'A');
7963 IDWriteFont3_Release(font3);
7964 IDWriteFactory3_Release(factory3);
7967 win_skip(
"IDWriteFont3 is not supported.\n");
7969 IDWriteFont_Release(
font);
7971 ok(
ref == 0,
"factory not released, %lu\n",
ref);
7991 return has_wght && has_wdth && has_ital && has_slnt;
7997 IDWriteFontFace3 *fontface, *fontface1;
8012 win_skip(
"CreateFontFaceReference() is not supported.\n");
8029 index = IDWriteFontFaceReference_GetFontFaceIndex(
ref);
8032 hr = IDWriteFontFaceReference_GetFontFile(
ref, &
file);
8034 IDWriteFontFile_Release(
file);
8036 hr = IDWriteFontFaceReference_CreateFontFace(
ref, &fontface);
8040 IDWriteFontFaceReference_Release(
ref);
8047 IDWriteFontFaceReference_Release(
ref);
8055 hr = IDWriteFontFaceReference_GetFontFile(
ref, &
file);
8058 hr = IDWriteFontFaceReference_GetFontFile(
ref, &file1);
8060 ok(
file != file1,
"got %p, previous file %p\n", file1,
file);
8062 IDWriteFontFile_Release(
file);
8063 IDWriteFontFile_Release(file1);
8068 ok(ref1 !=
ref,
"got %p, previous ref %p\n", ref1,
ref);
8071 hr = IDWriteFontFaceReference_CreateFontFace(
ref, &fontface);
8074 hr = IDWriteFontFaceReference_CreateFontFace(ref1, &fontface1);
8076 ok(fontface == fontface1,
"got %p, expected %p\n", fontface1, fontface);
8077 IDWriteFontFace3_Release(fontface);
8078 IDWriteFontFace3_Release(fontface1);
8081 ret = IDWriteFontFaceReference_Equals(
ref, ref1);
8083 IDWriteFontFaceReference_Release(ref1);
8087 ret = IDWriteFontFaceReference_Equals(
ref, ref1);
8089 IDWriteFontFaceReference_Release(ref1);
8093 ret = IDWriteFontFaceReference_Equals(
ref, ref1);
8095 IDWriteFontFaceReference_Release(ref1);
8097 IDWriteFontFaceReference_Release(
ref);
8106 hr = IDWriteFontFaceReference_GetFontFile(
ref, &file1);
8108 ok(
file != file1,
"got %p, previous file %p\n", file1,
file);
8110 if (
SUCCEEDED(IDWriteFontFaceReference_QueryInterface(
ref, &IID_IDWriteFontFaceReference1, (
void **)&ref2)))
8112 axis_count = IDWriteFontFaceReference1_GetFontAxisValueCount(ref2);
8113 ok(!axis_count,
"Unexpected axis value count.\n");
8114 IDWriteFontFaceReference1_Release(ref2);
8117 IDWriteFontFaceReference_Release(
ref);
8118 IDWriteFontFile_Release(
file);
8119 IDWriteFontFile_Release(file1);
8123 ok(
hr ==
S_OK,
"Failed to get system collection, hr %#lx.\n",
hr);
8131 hr = IDWriteFontCollection1_GetFontFamily(
collection,
i, &family);
8132 ok(
hr ==
S_OK,
"Failed to get family, hr %#lx.\n",
hr);
8134 font_count = IDWriteFontFamily1_GetFontCount(family);
8136 for (
j = 0;
j < font_count;
j++)
8138 hr = IDWriteFontFamily1_GetFont(family,
j, &font3);
8139 ok(
hr ==
S_OK,
"Failed to get font, hr %#lx.\n",
hr);
8141 hr = IDWriteFont3_GetFontFaceReference(font3, &
ref);
8142 ok(
hr ==
S_OK,
"Failed to get reference object, hr %#lx.\n",
hr);
8144 hr = IDWriteFont3_GetFontFaceReference(font3, &ref1);
8145 ok(
hr ==
S_OK,
"Failed to get reference object, hr %#lx.\n",
hr);
8146 ok(
ref != ref1,
"Unexpected reference object %p, %p.\n", ref1,
ref);
8148 hr = IDWriteFont3_CreateFontFace(font3, &fontface);
8149 ok(
hr ==
S_OK,
"Failed to create a fontface, hr %#lx.\n",
hr);
8153 if (
SUCCEEDED(
hr = IDWriteFontFaceReference_QueryInterface(
ref, &IID_IDWriteFontFaceReference1,
8156 axis_count = IDWriteFontFaceReference1_GetFontAxisValueCount(ref2);
8158 ok(axis_count >= 4,
"Unexpected axis value count.\n");
8160 hr = IDWriteFontFaceReference1_GetFontAxisValues(ref2, axis_values,
ARRAY_SIZE(axis_values));
8166 IDWriteFontFaceReference1_Release(ref2);
8169 IDWriteFontFaceReference_Release(
ref);
8170 IDWriteFontFaceReference_Release(ref1);
8172 hr = IDWriteFontFace3_GetFontFaceReference(fontface, &
ref);
8173 ok(
hr ==
S_OK,
"Failed to get a reference, hr %#lx.\n",
hr);
8176 hr = IDWriteFontFace3_GetFontFaceReference(fontface, &ref1);
8177 ok(
hr ==
S_OK,
"Failed to get a reference, hr %#lx.\n",
hr);
8178 ok(
ref == ref1,
"Unexpected reference %p, %p.\n", ref1,
ref);
8181 hr = IDWriteFontFace3_QueryInterface(fontface, &IID_IDWriteFontFaceReference, (
void **)&ref3);
8185 ok(
ref == ref3,
"Unexpected reference %p.\n", ref3);
8186 IDWriteFontFaceReference_Release(ref3);
8189 hr = IDWriteFontFaceReference_CreateFontFace(
ref, &fontface1);
8190 ok(
hr ==
S_OK,
"Failed to create fontface, hr %#lx.\n",
hr);
8191 ok(fontface1 == fontface,
"Unexpected fontface %p, %p.\n", fontface1, fontface);
8192 IDWriteFontFace3_Release(fontface1);
8194 IDWriteFontFaceReference_Release(
ref);
8195 IDWriteFontFaceReference_Release(ref1);
8197 IDWriteFontFace3_Release(fontface);
8198 IDWriteFont3_Release(font3);
8201 IDWriteFontFamily1_Release(family);
8205 refcount = IDWriteFactory3_Release(
factory);
8206 ok(refcount == 0,
"factory not released, %lu\n", refcount);
8218 memset(fontsig, 0,
sizeof(*fontsig));
8220 hr = IDWriteFont_CreateFontFace(
font, &fontface);
8236 fontsig->fsCsb[0] = 0;
8237 fontsig->fsCsb[1] = 0;
8245 IDWriteFontFace_ReleaseFontTable(fontface, os2.
context);
8248 IDWriteFontFace_Release(fontface);
8264 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
8267 hr = IDWriteGdiInterop_QueryInterface(interop, &IID_IDWriteGdiInterop1, (
void**)&interop1);
8268 IDWriteGdiInterop_Release(interop);
8270 win_skip(
"GetFontSignature() is not supported.\n");
8271 IDWriteGdiInterop_Release(interop);
8272 IDWriteFactory_Release(
factory);
8277 hr = IDWriteGdiInterop1_GetFontSignature(interop1,
NULL, &fontsig);
8280 hr = IDWriteFactory_GetSystemFontCollection(
factory, &syscollection,
FALSE);
8282 count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
8291 hr = IDWriteFontCollection_GetFontFamily(syscollection,
i, &family);
8298 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
8303 IDWriteLocalizedStrings_Release(
names);
8305 hr = IDWriteGdiInterop1_GetFontSignature(interop1,
font, &fontsig);
8312 ok(fontsig.fsUsb[0] == expected_signature.fsUsb[0],
"fsUsb[0] %#lx, expected %#lx.\n",
8313 fontsig.fsUsb[0], expected_signature.fsUsb[0]);
8314 ok(fontsig.fsUsb[1] == expected_signature.fsUsb[1],
"fsUsb[1] %#lx, expected %#lx.\n",
8315 fontsig.fsUsb[1], expected_signature.fsUsb[1]);
8316 ok(fontsig.fsUsb[2] == expected_signature.fsUsb[2],
"fsUsb[2] %#lx, expected %#lx.\n",
8317 fontsig.fsUsb[2], expected_signature.fsUsb[2]);
8318 ok(fontsig.fsUsb[3] == expected_signature.fsUsb[3],
"fsUsb[3] %#lx, expected %#lx.\n",
8319 fontsig.fsUsb[3], expected_signature.fsUsb[3]);
8321 ok(fontsig.fsCsb[0] == expected_signature.fsCsb[0],
"fsCsb[0] %#lx, expected %#lx.\n",
8322 fontsig.fsCsb[0], expected_signature.fsCsb[0]);
8323 ok(fontsig.fsCsb[1] == expected_signature.fsCsb[1],
"fsCsb[1] %#lx, expected %#lx.\n",
8324 fontsig.fsCsb[1], expected_signature.fsCsb[1]);
8328 IDWriteFont_Release(
font);
8329 IDWriteFontFamily_Release(family);
8332 IDWriteGdiInterop1_Release(interop1);
8333 IDWriteFontCollection_Release(syscollection);
8335 ok(
ref == 0,
"factory not released, %lu\n",
ref);
8340 IDWriteFontFace3 *fontface3;
8356 hr = IDWriteFont_CreateFontFace(
font, &fontface);
8359 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace3, (
void**)&fontface3);
8360 IDWriteFontFace_Release(fontface);
8362 style = IDWriteFontFace3_GetStyle(fontface3);
8365 IDWriteFontFace3_Release(fontface3);
8368 IDWriteFont_Release(
font);
8370 ok(
ref == 0,
"factory not released, %lu\n",
ref);
8403 if (lookup_count == 0)
8406 for (
i = 0;
i < lookup_count;
i++) {
8412 ok(
type == 1 ||
type == 7,
"got unexpected lookup type %u\n",
type);
8418 ok(
count > 0,
"got unexpected subtable count %u\n",
count);
8426 ok(0,
"Unhandled Extension Substitution Format %u\n",
GET_BE_WORD(
ext->SubstFormat));
8433 else if (
index == 2) {
8439 ok(0,
"unknown Single Substitution Format, %u\n",
index);
8447 IDWriteFontFace1_ReleaseFontTable(fontface,
context);
8465 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
8466 IDWriteFontFace_Release(fontface);
8468 win_skip(
"HasVerticalGlyphVariants() is not supported.\n");
8469 IDWriteFactory_Release(
factory);
8472 IDWriteFontFace1_Release(fontface1);
8474 hr = IDWriteFactory_GetSystemFontCollection(
factory, &syscollection,
FALSE);
8476 count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
8480 BOOL expected_vert, has_vert;
8485 hr = IDWriteFontCollection_GetFontFamily(syscollection,
i, &family);
8492 hr = IDWriteFont_CreateFontFace(
font, &fontface);
8495 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
8498 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
8504 has_vert = IDWriteFontFace1_HasVerticalGlyphVariants(fontface1);
8506 ok(expected_vert == has_vert,
"%s: expected vertical feature %d, got %d\n",
8509 IDWriteLocalizedStrings_Release(
names);
8510 IDWriteFont_Release(
font);
8512 IDWriteFontFace1_Release(fontface1);
8513 IDWriteFontFace_Release(fontface);
8514 IDWriteFontFamily_Release(family);
8517 IDWriteFontCollection_Release(syscollection);
8519 ok(
ref == 0,
"factory not released, %lu\n",
ref);
8535 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void**)&fontface1);
8536 IDWriteFontFace_Release(fontface);
8538 win_skip(
"HasKerningPairs() is not supported.\n");
8539 IDWriteFactory_Release(
factory);
8542 IDWriteFontFace1_Release(fontface1);
8544 hr = IDWriteFactory_GetSystemFontCollection(
factory, &syscollection,
FALSE);
8546 count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
8558 hr = IDWriteFontCollection_GetFontFamily(syscollection,
i, &family);
8565 hr = IDWriteFont_CreateFontFace(
font, &fontface);
8568 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void **)&fontface1);
8571 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
8579 IDWriteFontFace1_ReleaseFontTable(fontface1,
context);
8581 has_kerningpairs = IDWriteFontFace1_HasKerningPairs(fontface1);
8585 IDWriteLocalizedStrings_Release(
names);
8586 IDWriteFont_Release(
font);
8588 IDWriteFontFace1_Release(fontface1);
8589 IDWriteFontFace_Release(fontface);
8590 IDWriteFontFamily_Release(family);
8593 IDWriteFontCollection_Release(syscollection);
8595 ok(
ref == 0,
"factory not released, %lu\n",
ref);
8600 return run->
fontEmSize * metric /
m->designUnitsPerEm;
8615 ok(
hr ==
S_OK,
"Failed to get glyph metrics, hr %#lx.\n",
hr);
8628 origins[
i] = baseline_origin;
8646 origins[
i] = baseline_origin;
8664 static const struct origins_test
8669 unsigned int bidi_level;
8670 unsigned int sideways;
8674 { { 123.0f, 321.0f }, { 10.0f, 20.0f }, { { 0 } } },
8675 { { 123.0f, 321.0f }, { 10.0f, 20.0f }, { { 0.3f, 0.5f }, { -0.1f, 0.9f } } },
8676 { { 123.0f, 321.0f }, { 10.0f, 20.0f }, { { 0 } }, 1 },
8678 { { 123.0f, 321.0f }, { 10.0f, 20.0f }, { { 0 } }, 0, 1 },
8679 { { 123.0f, 321.0f }, { 10.0f, 20.0f }, { { 0.3f, 0.5f }, { -0.1f, 0.9f } }, 0, 1 },
8680 { { 123.0f, 321.0f }, { 10.0f, 20.0f }, { { 0 } }, 1, 1 },
8681 { { 123.0f, 321.0f }, { 10.0f, 20.0f }, { { 0.3f, 0.5f }, { -0.1f, 0.9f } }, 1, 1 },
8688 UINT16 glyphs[2] = { 0 };
8697 win_skip(
"ComputeGlyphOrigins() is not supported.\n");
8716 memset(origins, 0,
sizeof(origins));
8717 hr = IDWriteFactory4_ComputeGlyphOrigins_(
factory, &run, origins_tests[
i].baseline_origin, origins);
8718 ok(
hr ==
S_OK,
"%u: failed to compute glyph origins, hr %#lx.\n",
i,
hr);
8722 ok(!
memcmp(&origins[
j], &expected_origins[
j],
sizeof(origins[
j])),
8723 "%u: unexpected origin[%u] (%f, %f) - (%f, %f).\n",
i,
j, origins[
j].
x, origins[
j].
y,
8724 expected_origins[
j].
x, expected_origins[
j].
y);
8728 IDWriteFontFace_Release(fontface);
8730 advances[0] = 10.0f;
8731 advances[1] = 20.0f;
8742 baseline_origin.
x = 123.0f;
8743 baseline_origin.
y = 321.0f;
8745 memset(origins, 0,
sizeof(origins));
8746 hr = IDWriteFactory4_ComputeGlyphOrigins_(
factory, &run, baseline_origin, origins);
8748 ok(origins[0].
x == 123.0f && origins[0].
y == 321.0f,
"origins[0] %f,%f\n", origins[0].
x, origins[0].
y);
8749 ok(origins[1].
x == 133.0f && origins[1].
y == 321.0f,
"origins[1] %f,%f\n", origins[1].
x, origins[1].
y);
8751 memset(origins, 0,
sizeof(origins));
8754 ok(origins[0].
x == 123.0f && origins[0].
y == 321.0f,
"origins[0] %f,%f\n", origins[0].
x, origins[0].
y);
8755 ok(origins[1].
x == 133.0f && origins[1].
y == 321.0f,
"origins[1] %f,%f\n", origins[1].
x, origins[1].
y);
8765 memset(origins, 0,
sizeof(origins));
8768 ok(origins[0].
x == 123.0f && origins[0].
y == 321.0f,
"origins[0] %f,%f\n", origins[0].
x, origins[0].
y);
8769 ok(origins[1].
x == 133.0f && origins[1].
y == 321.0f,
"origins[1] %f,%f\n", origins[1].
x, origins[1].
y);
8772 ok(
ref == 0,
"factory not released, %lu\n",
ref);
8797 hr = IDWriteFactory_GetSystemFontCollection(
factory, &collection2,
FALSE);
8799 ok(collection2 ==
collection,
"expected same collection\n");
8804 IDWriteFontCollection_Release(collection2);
8814 hr = IDWriteFontCollection_GetFontFamily(
collection, 0, &family);
8821 hr = IDWriteFontCollection_GetFontFamily(
collection, 0, &family2);
8828 IDWriteFontFamily_Release(family2);
8843 hr = IDWriteFont_GetFontFamily(
font, &family2);
8845 ok(family2 == family,
"unexpected family pointer\n");
8846 IDWriteFontFamily_Release(family2);
8852 hr = IDWriteFont_CreateFontFace(
font, &fontface);
8862 hr = IDWriteFontCollection_GetFontFromFontFace(
collection, fontface, &font2);
8872 IDWriteFont_Release(font2);
8873 IDWriteFontFace_Release(fontface);
8880 IDWriteFont_Release(
font);
8898 ok(fontlist2 != fontlist,
"unexpected font list\n");
8899 IDWriteFontList_Release(fontlist2);
8901 IDWriteFontList_Release(fontlist);
8903 IDWriteFontFamily_Release(family);
8908 ok(
ref == 0,
"collection not released, %lu\n",
ref);
8912 hr = IDWriteFactory_GetGdiInterop(
factory, &interop);
8917 hr = IDWriteFactory_GetGdiInterop(
factory, &interop2);
8919 ok(interop == interop2,
"got unexpected interop pointer\n");
8924 IDWriteGdiInterop_Release(interop2);
8925 ref = IDWriteGdiInterop_Release(interop);
8926 ok(
ref == 0,
"interop not released, %lu\n",
ref);
8929 ok(
ref == 0,
"factory not released, %lu\n",
ref);
8947 IUnknown_AddRef(iface);
8986 const void *
key, *
data, *frag_start;
8999 win_skip(
"CreateInMemoryFontFileLoader() is not supported\n");
9011 hr = IDWriteFactory5_CreateInMemoryFontFileLoader(
factory, &loader2);
9013 ok(
loader != loader2,
"unexpected pointer\n");
9014 IDWriteInMemoryFontFileLoader_Release(loader2);
9018 count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
9023 hr = IDWriteFontFace_GetFiles(fontface, &
count, &
file);
9029 hr = IDWriteFontFile_GetReferenceKey(
file, &
key, &key_size);
9035 IDWriteFontFile_Release(
file);
9048 count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
9062 count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
9068 ok(file2 !=
file,
"got unexpected file\n");
9072 count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
9076 hr = IDWriteFontFile_GetReferenceKey(
file, &
key, &key_size);
9080 ok(key_size == 4,
"ref key size %u\n", key_size);
9082 hr = IDWriteFontFile_GetReferenceKey(file2, &
key, &key_size);
9086 ok(key_size == 4,
"ref key size %u\n", key_size);
9089 hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory,
key, key_size, &stream2);
9090 ok(
hr ==
S_OK,
"Failed to create a stream, hr %#lx.\n",
hr);
9094 hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory,
key, key_size, &stream3);
9095 ok(
hr ==
S_OK,
"Failed to create a stream, hr %#lx.\n",
hr);
9097 ok(stream2 != stream3,
"Unexpected stream.\n");
9099 IDWriteFontFileStream_Release(stream2);
9100 IDWriteFontFileStream_Release(stream3);
9104 ref = IDWriteFontFile_Release(
file);
9105 ok(
ref == 0,
"File object not released, %lu.\n",
ref);
9108 count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
9112 ref = IDWriteFontFile_Release(file2);
9113 ok(
ref == 0,
"File object not released, %lu.\n",
ref);
9116 count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
9124 ref = IDWriteInMemoryFontFileLoader_Release(inmemory);
9125 ok(
ref == 0,
"loader not released, %lu.\n",
ref);
9130 ok(
hr ==
S_OK,
"Failed to create loader, hr %#lx.\n",
hr);
9135 ok(
hr ==
S_OK,
"Failed to register loader, hr %#lx.\n",
hr);
9138 hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key,
sizeof(ref_key), &stream2);
9144 ok(
hr ==
S_OK,
"Failed to create in-memory file reference, hr %#lx.\n",
hr);
9147 hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key,
sizeof(ref_key), &stream2);
9148 ok(
hr ==
S_OK,
"Failed to create a stream, hr %#lx.\n",
hr);
9150 context2 = (
void *)0xdeadbeef;
9151 hr = IDWriteFontFileStream_ReadFileFragment(stream2, &frag_start, 0,
file_size, &context2);
9152 ok(
hr ==
S_OK,
"Failed to read a fragment, hr %#lx.\n",
hr);
9153 ok(context2 ==
NULL,
"Unexpected context %p.\n", context2);
9154 ok(frag_start ==
data,
"Unexpected fragment pointer %p.\n", frag_start);
9156 hr = IDWriteFontFileStream_GetFileSize(stream2, &
size);
9157 ok(
hr ==
S_OK,
"Failed to get file size, hr %#lx.\n",
hr);
9160 IDWriteFontFileStream_ReleaseFileFragment(stream2, context2);
9163 hr = IDWriteFontFileStream_GetLastWriteTime(stream2, &writetime);
9165 ok(writetime == 0,
"Unexpected writetime.\n");
9167 IDWriteFontFileStream_Release(stream2);
9172 ok(
hr ==
S_OK,
"Failed to create in-memory file reference, hr %#lx.\n",
hr);
9175 hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key,
sizeof(ref_key), &stream2);
9176 ok(
hr ==
S_OK,
"Failed to create a stream, hr %#lx.\n",
hr);
9178 context2 = (
void *)0xdeadbeef;
9179 hr = IDWriteFontFileStream_ReadFileFragment(stream2, &frag_start, 0,
file_size, &context2);
9180 ok(
hr ==
S_OK,
"Failed to read a fragment, hr %#lx.\n",
hr);
9181 ok(context2 ==
NULL,
"Unexpected context %p.\n", context2);
9182 ok(frag_start !=
data,
"Unexpected fragment pointer %p.\n", frag_start);
9184 hr = IDWriteFontFileStream_GetFileSize(stream2, &
size);
9185 ok(
hr ==
S_OK,
"Failed to get file size, hr %#lx.\n",
hr);
9188 IDWriteFontFileStream_ReleaseFileFragment(stream2, context2);
9191 hr = IDWriteFontFileStream_GetLastWriteTime(stream2, &writetime);
9193 ok(writetime == 0,
"Unexpected writetime.\n");
9195 IDWriteFontFileStream_Release(stream2);
9196 IDWriteFontFile_Release(file2);
9200 hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory,
NULL,
sizeof(ref_key) - 1, &stream2);
9204 hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key,
sizeof(ref_key) - 1, &stream2);
9208 hr = IDWriteInMemoryFontFileLoader_CreateStreamFromKey(inmemory, &ref_key,
sizeof(ref_key) + 1, &stream2);
9211 count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
9214 hr = IDWriteFontFile_GetReferenceKey(
file, &
key, &key_size);
9215 ok(
hr ==
S_OK,
"Failed to get reference key, hr %#lx.\n",
hr);
9217 ok(
key && *(
DWORD*)
key == 0,
"Unexpected reference key.\n");
9218 ok(key_size == 4,
"Unexpected key size %u.\n", key_size);
9220 IDWriteFontFile_Release(
file);
9222 count = IDWriteInMemoryFontFileLoader_GetFileCount(inmemory);
9226 ok(
hr ==
S_OK,
"Failed to unregister loader, hr %#lx.\n",
hr);
9229 IDWriteFontFileStream_Release(
stream);
9230 IDWriteFontFace_Release(fontface);
9232 ref = IDWriteInMemoryFontFileLoader_Release(inmemory);
9233 ok(
ref == 0,
"loader not released, %lu.\n",
ref);
9236 ok(
ref == 0,
"factory not released, %lu\n",
ref);
9248 ok(
hr ==
S_OK,
"TryGetFontTable() failed, %#lx\n",
hr);
9250 IDWriteFontFace4_ReleaseFontTable(fontface,
context);
9268 ok(
hr ==
S_OK,
"TryGetFontTable() failed, %#lx\n",
hr);
9269 ok(exists,
"Expected maxp table\n");
9278 ok(
hr ==
S_OK,
"TryGetFontTable() failed, %#lx\n",
hr);
9279 ok(exists,
"Expected sbix table\n");
9284 for (
s = 0;
s < num_strikes;
s++) {
9287 for (
g = 0;
g < num_glyphs;
g++) {
9293 if (
offset == offset_next)
9308 case DWRITE_MAKE_OPENTYPE_TAG(
'f',
'l',
'i',
'p'):
9317 IDWriteFontFace4_ReleaseFontTable(fontface,
context);
9326 unsigned int i, num_sizes;
9333 ok(
exists,
"Expected CBLC table.\n");
9341 skip(
"Malformed CBLC table.\n");
9345 for (
i = 0;
i < num_sizes; ++
i)
9357 IDWriteFontFace4_ReleaseFontTable(fontface, cblc.
context);
9401 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace4, (
void **)&fontface4);
9402 IDWriteFontFace_Release(fontface);
9404 win_skip(
"GetGlyphImageFormats() is not supported\n");
9405 IDWriteFactory_Release(
factory);
9408 IDWriteFontFace4_Release(fontface4);
9410 hr = IDWriteFactory_GetSystemFontCollection(
factory, &syscollection,
FALSE);
9412 count = IDWriteFontCollection_GetFontFamilyCount(syscollection);
9415 WCHAR familynameW[256], facenameW[128];
9421 hr = IDWriteFontCollection_GetFontFamily(syscollection,
i, &family);
9424 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
9428 IDWriteLocalizedStrings_Release(
names);
9430 fontcount = IDWriteFontFamily_GetFontCount(family);
9431 for (
j = 0;
j < fontcount;
j++) {
9434 hr = IDWriteFontFamily_GetFont(family,
j, &
font);
9437 hr = IDWriteFont_CreateFontFace(
font, &fontface);
9445 IDWriteLocalizedStrings_Release(
names);
9447 IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace4, (
void **)&fontface4);
9450 formats = IDWriteFontFace4_GetGlyphImageFormats(fontface4);
9452 ok(
formats == expected_formats,
"%s - %s, expected formats %#lx, got formats %#lx.\n",
9455 IDWriteFontFace4_Release(fontface4);
9456 IDWriteFontFace_Release(fontface);
9457 IDWriteFont_Release(
font);
9460 IDWriteFontFamily_Release(family);
9463 IDWriteFontCollection_Release(syscollection);
9465 ok(
ref == 0,
"factory not released, %lu\n",
ref);
9470 static const struct custom_params_test
9474 FLOAT cleartype_level;
9504 params = (
void *)0xdeadbeef;
9505 hr = IDWriteFactory_CreateCustomRenderingParams(
factory, params_tests[
i].gamma, params_tests[
i].contrast,
9506 params_tests[
i].cleartype_level, params_tests[
i].geometry, params_tests[
i].rendering_mode, &
params);
9507 ok(
hr == params_tests[
i].
hr,
"unexpected hr %#lx, expected %#lx.\n",
hr, params_tests[
i].
hr);
9510 ok(params_tests[
i].gamma == IDWriteRenderingParams_GetGamma(
params),
"unexpected gamma %f, expected %f.\n",
9511 IDWriteRenderingParams_GetGamma(
params), params_tests[
i].gamma);
9512 ok(params_tests[
i].contrast == IDWriteRenderingParams_GetEnhancedContrast(
params),
9513 "unexpected contrast %f, expected %f.\n",
9514 IDWriteRenderingParams_GetEnhancedContrast(
params), params_tests[
i].contrast);
9515 ok(params_tests[
i].cleartype_level == IDWriteRenderingParams_GetClearTypeLevel(
params),
9516 "unexpected ClearType level %f, expected %f.\n",
9517 IDWriteRenderingParams_GetClearTypeLevel(
params), params_tests[
i].cleartype_level);
9518 ok(params_tests[
i].geometry == IDWriteRenderingParams_GetPixelGeometry(
params),
9519 "unexpected pixel geometry %u, expected %u.\n", IDWriteRenderingParams_GetPixelGeometry(
params),
9520 params_tests[
i].geometry);
9521 ok(params_tests[
i].rendering_mode == IDWriteRenderingParams_GetRenderingMode(
params),
9522 "unexpected rendering mode %u, expected %u.\n", IDWriteRenderingParams_GetRenderingMode(
params),
9523 params_tests[
i].rendering_mode);
9524 IDWriteRenderingParams_Release(
params);
9527 ok(
params ==
NULL,
"%u: expected NULL interface pointer on failure.\n",
i);
9533 ok(
ref == 0,
"factory not released, %lu\n",
ref);
9551 ok(
hr ==
S_OK,
"Failed to create file reference, hr %#lx.\n",
hr);
9553 hr = IDWriteFactory_CreateFontFileReference(factory2,
path,
NULL, &file2);
9554 ok(
hr ==
S_OK,
"Failed to create file reference, hr %#lx.\n",
hr);
9555 ok(
file != file2,
"Unexpected file instance.\n");
9558 ok(
hr ==
S_OK,
"Failed to get loader, hr %#lx.\n",
hr);
9560 hr = IDWriteFontFile_GetLoader(file2, &loader2);
9561 ok(
hr ==
S_OK,
"Failed to get loader, hr %#lx.\n",
hr);
9562 ok(
loader == loader2,
"Unexpected loader instance\n");
9564 IDWriteFontFile_Release(
file);
9565 IDWriteFontFile_Release(file2);
9566 IDWriteFontFileLoader_Release(
loader);
9567 IDWriteFontFileLoader_Release(loader2);
9569 ok(
ref == 0,
"factory not released, %lu\n",
ref);
9570 ref = IDWriteFactory_Release(factory2);
9571 ok(
ref == 0,
"factory not released, %lu\n",
ref);
9584 win_skip(
"AnalyzeContainerType() is not supported.\n");
9589 ok(
type == DWRITE_CONTAINER_TYPE_UNKNOWN,
"Unexpected container type %u.\n",
type);
9591 type = IDWriteFactory5_AnalyzeContainerType(
factory, (
void const *)0xdeadbeef, 0);
9592 ok(
type == DWRITE_CONTAINER_TYPE_UNKNOWN,
"Unexpected container type %u.\n",
type);
9594 memset(&woff_header, 0xff,
sizeof(woff_header));
9597 type = IDWriteFactory5_AnalyzeContainerType(
factory, &woff_header,
sizeof(woff_header));
9600 memset(&woff_header, 0xff,
sizeof(woff_header));
9602 type = IDWriteFactory5_AnalyzeContainerType(
factory, &woff_header,
sizeof(woff_header.
signature));
9605 memset(&woff_header, 0xff,
sizeof(woff_header));
9607 type = IDWriteFactory5_AnalyzeContainerType(
factory, &woff_header,
sizeof(woff_header.
signature) - 1);
9608 ok(
type == DWRITE_CONTAINER_TYPE_UNKNOWN,
"Unexpected container type %u.\n",
type);
9610 memset(&woff2_header, 0xff,
sizeof(woff2_header));
9612 type = IDWriteFactory5_AnalyzeContainerType(
factory, &woff2_header,
sizeof(woff2_header));
9615 memset(&woff2_header, 0xff,
sizeof(woff2_header));
9617 type = IDWriteFactory5_AnalyzeContainerType(
factory, &woff2_header,
sizeof(woff2_header.
signature));
9620 memset(&woff2_header, 0xff,
sizeof(woff2_header));
9622 type = IDWriteFactory5_AnalyzeContainerType(
factory, &woff2_header,
sizeof(woff2_header.
signature) - 1);
9623 ok(
type == DWRITE_CONTAINER_TYPE_UNKNOWN,
"Unexpected container type %u.\n",
type);
9625 IDWriteFactory5_Release(
factory);
9646 win_skip(
"IDWriteFontSetBuilder is not supported.\n");
9651 hr = IDWriteFactory3_CreateFontSetBuilder(
factory, &builder);
9652 ok(
hr ==
S_OK,
"Failed to create font set builder, hr %#lx.\n",
hr);
9655 if (
SUCCEEDED(
hr = IDWriteFontSetBuilder_QueryInterface(builder, &IID_IDWriteFontSetBuilder1, (
void **)&builder1)))
9662 hr = IDWriteFontSetBuilder1_AddFontFile(builder1,
file);
9665 hr = IDWriteFontSetBuilder1_CreateFontSet(builder1, &fontset);
9670 ok(
count == 1,
"Unexpected family count %u.\n",
count);
9672 IDWriteFontSet_Release(fontset);
9674 hr = IDWriteFontSetBuilder1_AddFontFile(builder1,
file);
9677 hr = IDWriteFontSetBuilder1_CreateFontSet(builder1, &fontset);
9684 ok(
count == 1,
"Unexpected family count %u.\n",
count);
9688 count = IDWriteFontSet_GetFontCount(fontset);
9691 hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &
ref);
9694 hr = IDWriteFontFaceReference_QueryInterface(
ref, &IID_IDWriteFontFaceReference1, (
void **)&ref1);
9697 count = IDWriteFontFaceReference1_GetFontAxisValueCount(ref1);
9703 hr = IDWriteFontFaceReference1_GetFontAxisValues(ref1, axis_values,
ARRAY_SIZE(axis_values));
9708 ok(axis_values[0].
value == 500.0f,
"Unexpected value[0] %f.\n", axis_values[0].
value);
9711 ok(axis_values[1].
value == 100.0f,
"Unexpected value[1] %f.\n", axis_values[1].
value);
9714 ok(axis_values[2].
value == 0.0f,
"Unexpected value[2] %f.\n", axis_values[2].
value);
9717 ok(axis_values[3].
value == 0.0f,
"Unexpected value[3] %f.\n", axis_values[3].
value);
9720 IDWriteFontFaceReference1_Release(ref1);
9722 IDWriteFontFaceReference_Release(
ref);
9724 IDWriteFontSet_Release(fontset);
9726 IDWriteFontFile_Release(
file);
9727 IDWriteFontSetBuilder1_Release(builder1);
9730 win_skip(
"IDWriteFontSetBuilder1 is not available.\n");
9731 IDWriteFontSetBuilder_Release(builder);
9734 ok(
hr ==
S_OK,
"Failed to get system collection, hr %#lx.\n",
hr);
9742 hr = IDWriteFontCollection1_GetFontFamily(
collection,
i, &family);
9743 ok(
hr ==
S_OK,
"Failed to get family, hr %#lx.\n",
hr);
9745 fontcount = IDWriteFontFamily1_GetFontCount(family);
9746 for (
j = 0;
j < fontcount; ++
j)
9751 hr = IDWriteFontFamily1_GetFont(family,
j, &
font);
9752 ok(
hr ==
S_OK,
"Failed to get font, hr %#lx.\n",
hr);
9755 hr = IDWriteFactory3_CreateFontSetBuilder(
factory, &builder);
9756 ok(
hr ==
S_OK,
"Failed to create font set builder, hr %#lx.\n",
hr);
9758 hr = IDWriteFont3_GetFontFaceReference(
font, &
ref);
9759 ok(
hr ==
S_OK,
"Failed to get fontface reference, hr %#lx.\n",
hr);
9762 hr = IDWriteFontSetBuilder_AddFontFaceReference(builder,
ref);
9763 ok(
hr ==
S_OK,
"Failed to add fontface reference, hr %#lx.\n",
hr);
9766 hr = IDWriteFontSetBuilder_CreateFontSet(builder, &fontset);
9767 ok(
hr ==
S_OK,
"Failed to create a font set, hr %#lx.\n",
hr);
9769 setcount = IDWriteFontSet_GetFontCount(fontset);
9770 ok(setcount == 1,
"Unexpected font count %u.\n", setcount);
9772 ref2 = (
void *)0xdeadbeef;
9773 hr = IDWriteFontSet_GetFontFaceReference(fontset, setcount, &ref2);
9775 ok(!ref2,
"Unexpected pointer.\n");
9778 hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref2);
9779 ok(
hr ==
S_OK,
"Failed to get font face reference, hr %#lx.\n",
hr);
9780 ok(ref2 !=
ref,
"Unexpected reference.\n");
9783 hr = IDWriteFontSet_GetFontFaceReference(fontset, 0, &ref3);
9784 ok(
hr ==
S_OK,
"Failed to get font face reference, hr %#lx.\n",
hr);
9785 ok(ref2 != ref3,
"Unexpected reference.\n");
9787 IDWriteFontFaceReference_Release(ref3);
9788 IDWriteFontFaceReference_Release(ref2);
9793 WCHAR buffW[255], buff2W[255];
9797 hr = IDWriteFontSet_GetPropertyValues(fontset, 0,
id, &exists, &
values);
9798 ok(
hr ==
S_OK,
"Failed to get property value, hr %#lx.\n",
hr);
9804 ok(exists,
"Property %u expected to exist.\n",
id);
9813 ivalue = IDWriteFont3_GetWeight(
font);
9816 ivalue = IDWriteFont3_GetStretch(
font);
9819 ivalue = IDWriteFont3_GetStyle(
font);
9830 c = IDWriteLocalizedStrings_GetCount(
values);
9831 ok(
c == 1,
"Unexpected string count %u.\n",
c);
9835 ok(
hr ==
S_OK,
"Failed to get locale name, hr %#lx.\n",
hr);
9840 ok(
hr ==
S_OK,
"Failed to get property string, hr %#lx.\n",
hr);
9850 IDWriteLocalizedStrings_Release(
values);
9853 IDWriteFontSet_Release(fontset);
9854 IDWriteFontFaceReference_Release(
ref);
9855 IDWriteFontSetBuilder_Release(builder);
9857 IDWriteFont3_Release(
font);
9860 IDWriteFontFamily1_Release(family);
9865 refcount = IDWriteFactory3_Release(
factory);
9866 ok(!refcount,
"Factory not released, %u.\n", refcount);
9885 win_skip(
"IDWriteFactory6 is not supported.\n");
9892 hr = IDWriteFontFace_GetFiles(fontface, &
count, &fontfile);
9893 ok(
hr ==
S_OK,
"Failed to get file object, hr %#lx.\n",
hr);
9896 ok(
hr ==
S_OK,
"Failed to create font resource, hr %#lx.\n",
hr);
9898 hr = IDWriteFactory6_CreateFontResource(
factory, fontfile, 0, &resource2);
9899 ok(
hr ==
S_OK,
"Failed to create font resource, hr %#lx.\n",
hr);
9900 ok(
resource != resource2,
"Unexpected instance.\n");
9901 IDWriteFontResource_Release(resource2);
9903 hr = IDWriteFontResource_GetFontFile(
resource, &fontfile2);
9904 ok(
hr ==
S_OK,
"Failed to get font file, hr %#lx.\n",
hr);
9905 ok(fontfile2 == fontfile,
"Unexpected file instance.\n");
9906 IDWriteFontFile_Release(fontfile2);
9913 axis_values[0].
value = 400.0f;
9915 ok(
hr ==
S_OK,
"Failed to create reference object, hr %#lx.\n",
hr);
9917 count = IDWriteFontFaceReference1_GetFontAxisValueCount(
reference);
9918 ok(
count == 1,
"Unexpected axis value count.\n");
9920 IDWriteFontFaceReference1_Release(
reference);
9924 count = IDWriteFontFaceReference1_GetFontAxisValueCount(
reference);
9925 ok(
count == 1,
"Unexpected axis value count.\n");
9926 IDWriteFontFaceReference1_Release(
reference);
9930 ok(
hr ==
S_OK,
"Failed to create reference object, hr %#lx.\n",
hr);
9934 ok(
hr ==
S_OK,
"Failed to create reference object, hr %#lx.\n",
hr);
9935 ok(
reference != reference2,
"Unexpected reference instance.\n");
9936 IDWriteFontFaceReference1_Release(reference2);
9937 IDWriteFontFaceReference1_Release(
reference);
9939 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace5, (
void **)&fontface5);
9940 ok(
hr ==
S_OK,
"Failed to get interface, hr %#lx.\n",
hr);
9942 hr = IDWriteFontFace5_GetFontResource(fontface5, &resource2);
9943 ok(
hr ==
S_OK,
"Failed to get font resource, hr %#lx.\n",
hr);
9944 ok(
resource != resource2,
"Unexpected resource instance.\n");
9945 IDWriteFontResource_Release(
resource);
9947 hr = IDWriteFontFace5_GetFontResource(fontface5, &
resource);
9948 ok(
hr ==
S_OK,
"Failed to get font resource, hr %#lx.\n",
hr);
9949 ok(
resource != resource2,
"Unexpected resource instance.\n");
9951 IDWriteFontResource_Release(
resource);
9952 IDWriteFontResource_Release(resource2);
9954 IDWriteFontFace5_Release(fontface5);
9958 axis_values[0].
value = 400.0f;
9960 axis_values[1].
value = 1.0f;
9963 count = IDWriteFontFaceReference1_GetFontAxisValueCount(
reference);
9964 ok(
count == 2,
"Unexpected axis value count.\n");
9968 count = IDWriteFontFaceReference1_GetFontAxisValueCount(reference2);
9969 ok(!
count,
"Unexpected axis value count.\n");
9972 ok(!
ret,
"Unexpected result.\n");
9973 IDWriteFontFaceReference1_Release(reference2);
9977 axis_values[0].
value = 1.0f;
9979 axis_values[1].
value = 400.0f;
9982 count = IDWriteFontFaceReference1_GetFontAxisValueCount(reference2);
9983 ok(
count == 2,
"Unexpected axis value count.\n");
9986 ok(!
ret,
"Unexpected result.\n");
9987 IDWriteFontFaceReference1_Release(reference2);
9991 axis_values[0].
value = 1.0f;
9993 axis_values[1].
value = 401.0f;
9996 count = IDWriteFontFaceReference1_GetFontAxisValueCount(reference2);
9997 ok(
count == 2,
"Unexpected axis value count.\n");
10000 ok(!
ret,
"Unexpected result.\n");
10001 IDWriteFontFaceReference1_Release(reference2);
10003 memset(axis_values, 0,
sizeof(axis_values));
10004 hr = IDWriteFontFaceReference1_GetFontAxisValues(
reference, axis_values, 1);
10006 ok(!axis_values[0].axisTag,
"Unexpected axis tag.\n");
10008 memset(axis_values, 0,
sizeof(axis_values));
10009 hr = IDWriteFontFaceReference1_GetFontAxisValues(
reference, axis_values, 2);
10010 ok(
hr ==
S_OK,
"Failed to get axis values, hr %#lx.\n",
hr);
10013 hr = IDWriteFontFaceReference1_CreateFontFace(
reference, &fontface5);
10014 ok(
hr ==
S_OK,
"Failed to create a font face, hr %#lx.\n",
hr);
10015 IDWriteFontFace5_Release(fontface5);
10017 IDWriteFontFaceReference1_Release(
reference);
10019 IDWriteFontFile_Release(fontfile);
10021 IDWriteFontFace_Release(fontface);
10023 ok(
ref == 0,
"Factory wasn't released, %lu.\n",
ref);
10035 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10037 IDWriteFontFace2_ReleaseFontTable(fontface,
context);
10042 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10044 IDWriteFontFace2_ReleaseFontTable(fontface,
context);
10062 win_skip(
"IsColorFont() is not supported.\n");
10067 ok(
hr ==
S_OK,
"Failed to get font collection, hr %#lx.\n",
hr);
10077 hr = IDWriteFontCollection_GetFontFamily(
collection,
i, &family);
10078 ok(
hr ==
S_OK,
"Failed to get family, hr %#lx.\n",
hr);
10080 hr = IDWriteFontFamily_GetFamilyNames(family, &
names);
10081 ok(
hr ==
S_OK,
"Failed to get names, hr %#lx.\n",
hr);
10083 IDWriteLocalizedStrings_Release(
names);
10085 font_count = IDWriteFontFamily_GetFontCount(family);
10087 for (
j = 0;
j < font_count; ++
j)
10089 BOOL is_color_font, is_color_face, is_color_expected;
10095 hr = IDWriteFontFamily_GetFont(family,
j, &
font);
10096 ok(
hr ==
S_OK,
"Failed to get font, hr %#lx.\n",
hr);
10098 hr = IDWriteFont_QueryInterface(
font, &IID_IDWriteFont2, (
void **)&font2);
10099 ok(
hr ==
S_OK,
"Failed to get interface, hr %#lx.\n",
hr);
10100 IDWriteFont_Release(
font);
10102 hr = IDWriteFont2_CreateFontFace(font2, &fontface);
10103 ok(
hr ==
S_OK,
"Failed to create fontface, hr %#lx.\n",
hr);
10105 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace2, (
void **)&fontface2);
10106 ok(
hr ==
S_OK,
"Failed to get interface, hr %#lx.\n",
hr);
10107 IDWriteFontFace_Release(fontface);
10109 is_color_font = IDWriteFont2_IsColorFont(font2);
10110 is_color_face = IDWriteFontFace2_IsColorFont(fontface2);
10111 ok(is_color_font == is_color_face,
"Unexpected color flag.\n");
10114 ok(is_color_expected == is_color_face,
"Unexpected is_color flag %d for %s, font %d.\n",
10117 IDWriteFontFace2_Release(fontface2);
10118 IDWriteFont2_Release(font2);
10121 IDWriteFontFamily_Release(family);
10125 refcount = IDWriteFactory2_Release(
factory);
10126 ok(refcount == 0,
"Factory not released, refcount %lu.\n", refcount);
10131 UINT16 glyphs[1], glyph_variants[1];
10143 hr = IDWriteFontFace_QueryInterface(fontface, &IID_IDWriteFontFace1, (
void **)&fontface1);
10144 IDWriteFontFace_Release(fontface);
10147 win_skip(
"GetVerticalGlyphVariants() is not supported.\n");
10148 IDWriteFactory_Release(
factory);
10154 hr = IDWriteFontFace1_GetGlyphIndices(fontface1, &
ch, 1, glyphs);
10155 ok(
hr ==
S_OK,
"Failed to get glyph, hr %#lx.\n",
hr);
10156 ok(!!*glyphs,
"Unexpected glyph %u.\n", glyphs[0]);
10158 memset(glyph_variants, 0,
sizeof(glyph_variants));
10159 hr = IDWriteFontFace1_GetVerticalGlyphVariants(fontface1, 1, glyphs, glyph_variants);
10160 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10161 ok(glyphs[0] == glyph_variants[0],
"Unexpected glyph.\n");
10163 ret = IDWriteFontFace1_HasVerticalGlyphVariants(fontface1);
10164 ok(!
ret,
"Unexpected flag.\n");
10166 IDWriteFontFace1_Release(fontface1);
10167 refcount = IDWriteFactory_Release(
factory);
10168 ok(!refcount,
"Factory not released, refcount %lu.\n", refcount);
10177 hr = IDWriteFontCollection_QueryInterface(
collection, &IID_IDWriteFontCollection3, (
void **)&collection3);
10178 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10179 event = IDWriteFontCollection3_GetExpirationEvent(collection3);
10180 IDWriteFontCollection3_Release(collection3);
10190 unsigned int refcount;
10197 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10199 hr = IDWriteFontCollection_QueryInterface(
collection, &IID_IDWriteFontCollection3, (
void **)&collection3);
10202 win_skip(
"Expiration events are not supported.\n");
10204 IDWriteFactory_Release(
factory);
10207 IDWriteFontCollection3_Release(collection3);
10211 ok(!!
event,
"Unexpected event handle.\n");
10216 hr = IDWriteFactory_GetSystemFontCollection(factory2, &collection2,
FALSE);
10217 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10220 ok(!!event2,
"Unexpected event handle.\n");
10221 ok(
event != event2,
"Unexpected event handle.\n");
10223 IDWriteFontCollection_Release(collection2);
10227 refcount = IDWriteFactory_Release(factory2);
10228 ok(!refcount,
"Unexpected factory refcount %u.\n", refcount);
10229 refcount = IDWriteFactory_Release(
factory);
10230 ok(!refcount,
"Unexpected factory refcount %u.\n", refcount);
10239 unsigned int count, refcount;
10250 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10252 hr = IDWriteFontCollection_GetFontFamily(
collection, 0, &family);
10253 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10255 if (
SUCCEEDED(IDWriteFontFamily_QueryInterface(family, &IID_IDWriteFontFamily2, (
void **)&family2)))
10257 hr = IDWriteFontFamily2_GetFontSet(family2, &fontset);
10258 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10259 hr = IDWriteFontFamily2_GetFontSet(family2, &fontset2);
10260 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10261 ok(fontset != fontset2,
"Unexpected fontset instance.\n");
10263 count = IDWriteFontSet1_GetFontCount(fontset);
10267 values = (
void *)0xdeadbeef;
10268 hr = IDWriteFontSet1_GetPropertyValues(fontset, 0, 100, &exists, &
values);
10270 ok(!exists && !
values,
"Unexpected return value.\n");
10274 values = (
void *)0xdeadbeef;
10277 ok(!exists && !
values,
"Unexpected return value.\n");
10280 values = (
void *)0xdeadbeef;
10281 hr = IDWriteFontSet1_GetPropertyValues(fontset,
count, 100, &exists, &
values);
10283 ok(!exists && !
values,
"Unexpected return value.\n");
10286 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10287 ok(exists == !!
values,
"Unexpected return value.\n");
10291 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10292 IDWriteLocalizedStrings_Release(
values);
10295 hr = IDWriteFontSet1_CreateFontResource(fontset, 100, &
resource);
10298 hr = IDWriteFontSet1_CreateFontResource(fontset, 0, &
resource);
10299 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10300 IDWriteFontResource_Release(
resource);
10302 IDWriteFontSet1_Release(fontset2);
10303 IDWriteFontSet1_Release(fontset);
10305 IDWriteFontFamily2_Release(family2);
10308 win_skip(
"IDWriteFontFamily2 is not supported.\n");
10310 IDWriteFontFamily_Release(family);
10313 refcount = IDWriteFactory_Release(
factory);
10314 ok(!refcount,
"Unexpected factory refcount %u.\n", refcount);
10321 IDWriteFontFace3 *fontface;
10324 unsigned int count;
10329 win_skip(
"System font set is not supported.\n");
10333 hr = IDWriteFactory3_GetSystemFontSet(
factory, &fontset);
10334 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10336 count = IDWriteFontSet_GetFontCount(fontset);
10340 p.propertyValue =
L"Tahoma";
10341 p.localeName =
L"";
10342 hr = IDWriteFontSet_GetMatchingFonts(fontset, &
p, 1, &filtered_set);
10343 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10344 count = IDWriteFontSet_GetFontCount(filtered_set);
10347 hr = IDWriteFontSet_GetFontFaceReference(filtered_set, 0, &
ref);
10348 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10350 hr = IDWriteFontFaceReference_CreateFontFace(
ref, &fontface);
10351 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10353 IDWriteFontFace3_Release(fontface);
10354 IDWriteFontFaceReference_Release(
ref);
10356 IDWriteFontSet_Release(filtered_set);
10358 IDWriteFontSet_Release(fontset);
10360 IDWriteFactory3_Release(
factory);
10379 win_skip(
"_CreateFontCollectionFromFontSet() is not available.\n");
10383 hr = IDWriteFactory5_CreateFontSetBuilder(
factory, &builder);
10384 ok(
hr ==
S_OK,
"Failed to create font set builder, hr %#lx.\n",
hr);
10391 hr = IDWriteFontSetBuilder1_AddFontFile(builder,
file);
10398 props[0].propertyValue =
L"Another Font";
10399 props[0].localeName =
L"en-US";
10400 hr = IDWriteFontSetBuilder1_AddFontFaceReference_(builder,
ref,
props, 1);
10403 IDWriteFontFaceReference_Release(
ref);
10405 hr = IDWriteFontSetBuilder1_CreateFontSet(builder, &fontset);
10413 ok(
count == 2,
"Unexpected family count %u.\n",
count);
10417 hr = IDWriteFontCollection1_FindFamilyName(
collection,
L"Another Font", &
index, &exists);
10420 ok(!!exists,
"Unexpected return value %d.\n", exists);
10423 IDWriteFontSet_Release(fontset);
10425 IDWriteFontSetBuilder1_Release(builder);
10427 IDWriteFontFile_Release(
file);
10428 refcount = IDWriteFactory5_Release(
factory);
10429 ok(!refcount,
"Unexpected factory refcount %u.\n", refcount);
10446 win_skip(
"Skipping GetMatchingFontsByLOGFONT() tests.\n");
10450 hr = IDWriteFactory3_GetSystemFontSet(
factory, &systemset);
10451 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10454 hr = IDWriteFactory3_GetGdiInterop(
factory, &interop0);
10455 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10457 hr = IDWriteGdiInterop_QueryInterface(interop0, &IID_IDWriteGdiInterop1, (
void **)&interop);
10458 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10459 IDWriteGdiInterop_Release(interop0);
10461 memset(&logfont, 0,
sizeof(logfont));
10468 hr = IDWriteGdiInterop1_GetMatchingFontsByLOGFONT(interop,
NULL, systemset, &
set);
10471 hr = IDWriteGdiInterop1_GetMatchingFontsByLOGFONT(interop, &logfont,
NULL, &
set);
10474 hr = IDWriteGdiInterop1_GetMatchingFontsByLOGFONT(interop, &logfont, systemset, &
set);
10475 ok(
hr ==
S_OK,
"Unexpected hr %#lx.\n",
hr);
10477 count = IDWriteFontSet_GetFontCount(
set);
10480 IDWriteFontSet_Release(
set);
10482 IDWriteGdiInterop1_Release(interop);
10483 IDWriteFontSet_Release(systemset);
10485 refcount = IDWriteFactory3_Release(
factory);
10486 ok(!refcount,
"Factory wasn't released, %lu.\n", refcount);
10494 win_skip(
"failed to create factory\n");
10565 IDWriteFactory_Release(
factory);
INT WINAPI GetSystemDefaultLocaleName(LPWSTR localename, INT len)
static VOID Substitute(_Out_writes_bytes_(BufferSize) PWCHAR Buffer, _In_ ULONG BufferSize, _In_ PCWSTR Template, _In_ PCWSTR SystemDriveName, _In_ PCWSTR SystemRootName)
_STLP_MOVE_TO_STD_NAMESPACE void _STLP_CALL advance(_InputIterator &__i, _Distance __n)
COMPILER_DEPENDENT_UINT64 UINT64
#define InterlockedIncrement
#define InterlockedDecrement
static const char * wine_dbgstr_rect(const RECT *prc)
static const WCHAR nameW[]
_In_ ULONG const _In_ FEATURE_NUMBER const Feature
@ D2D1_FIGURE_BEGIN_FILLED
@ DWRITE_GLYPH_IMAGE_FORMATS_COLR
@ DWRITE_GLYPH_IMAGE_FORMATS_NONE
@ DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8
@ DWRITE_GLYPH_IMAGE_FORMATS_JPEG
@ DWRITE_GLYPH_IMAGE_FORMATS_PNG
@ DWRITE_GLYPH_IMAGE_FORMATS_CFF
@ DWRITE_GLYPH_IMAGE_FORMATS_SVG
@ DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE
@ DWRITE_GLYPH_IMAGE_FORMATS_TIFF
@ DWRITE_MEASURING_MODE_GDI_CLASSIC
@ DWRITE_MEASURING_MODE_NATURAL
@ DWRITE_MEASURING_MODE_GDI_NATURAL
opentype_cmap_table_platform
opentype_cmap_table_encoding
static const struct pixel_format_desc formats[]
void get_logfont_from_font(IDWriteFont *iface, LOGFONTW *lf)
static struct dwrite_localfontfilestream * impl_from_IDWriteFontFileStream(IDWriteFontFileStream *iface)
static struct system_fontfile_enumerator * impl_from_IDWriteFontFileEnumerator(IDWriteFontFileEnumerator *iface)
HRESULT WINAPI DWriteCreateFactory(DWRITE_FACTORY_TYPE type, REFIID riid, IUnknown **ret)
const char * wine_dbgstr_an(const char *str, int n)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
static const WCHAR *const ext[]
static const WCHAR version[]
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI GetFileAttributesExW(LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation)
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
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)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP float __cdecl fabsf(float)
_ACRTIMP int __cdecl system(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
static void Lookup(RTF_Info *, char *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
struct nls_table * tables
@ DWRITE_PIXEL_GEOMETRY_FLAT
@ DWRITE_PIXEL_GEOMETRY_RGB
@ DWRITE_PIXEL_GEOMETRY_BGR
@ DWRITE_RENDERING_MODE_GDI_NATURAL
@ DWRITE_RENDERING_MODE_OUTLINE
@ DWRITE_RENDERING_MODE_GDI_CLASSIC
@ DWRITE_RENDERING_MODE_NATURAL
@ DWRITE_RENDERING_MODE_DEFAULT
@ DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
@ DWRITE_RENDERING_MODE_ALIASED
@ DWRITE_FONT_FILE_TYPE_TRUETYPE
@ DWRITE_FONT_FILE_TYPE_UNKNOWN
@ DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE
@ DWRITE_INFORMATIONAL_STRING_NONE
@ DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES
@ DWRITE_FONT_FACE_TYPE_VECTOR
@ DWRITE_FONT_FACE_TYPE_TYPE1
@ DWRITE_FONT_FACE_TYPE_CFF
@ DWRITE_FONT_FACE_TYPE_BITMAP
@ DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION
@ DWRITE_FONT_FACE_TYPE_UNKNOWN
@ DWRITE_FONT_FACE_TYPE_TRUETYPE
@ DWRITE_FONT_FACE_TYPE_RAW_CFF
@ DWRITE_FONT_WEIGHT_NORMAL
@ DWRITE_FONT_WEIGHT_BOLD
@ DWRITE_FONT_WEIGHT_ULTRA_BLACK
@ DWRITE_FONT_SIMULATIONS_OBLIQUE
@ DWRITE_FONT_SIMULATIONS_NONE
@ DWRITE_FONT_SIMULATIONS_BOLD
@ DWRITE_FONT_STYLE_NORMAL
@ DWRITE_FONT_STYLE_ITALIC
@ DWRITE_FONT_STYLE_OBLIQUE
@ DWRITE_FACTORY_TYPE_ISOLATED
@ DWRITE_FACTORY_TYPE_SHARED
@ DWRITE_TEXTURE_ALIASED_1x1
@ DWRITE_TEXTURE_CLEARTYPE_3x1
@ DWRITE_FONT_STRETCH_NORMAL
@ DWRITE_FONT_FEATURE_TAG_VERTICAL_WRITING
@ DWRITE_OUTLINE_THRESHOLD_ALIASED
@ DWRITE_OUTLINE_THRESHOLD_ANTIALIASED
@ DWRITE_PANOSE_PROPORTION_MONOSPACED
@ DWRITE_GRID_FIT_MODE_DEFAULT
@ DWRITE_GRID_FIT_MODE_DISABLED
@ DWRITE_GRID_FIT_MODE_ENABLED
@ DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC
@ DWRITE_FONT_FAMILY_MODEL_WEIGHT_STRETCH_STYLE
@ DWRITE_FONT_AXIS_TAG_WEIGHT
@ DWRITE_FONT_AXIS_TAG_WIDTH
@ DWRITE_FONT_AXIS_TAG_ITALIC
@ DWRITE_FONT_AXIS_TAG_SLANT
struct FONTSIGNATURE FONTSIGNATURE
@ DWRITE_RENDERING_MODE1_ALIASED
@ DWRITE_RENDERING_MODE1_NATURAL
@ DWRITE_RENDERING_MODE1_OUTLINE
@ DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED
@ DWRITE_FONT_PROPERTY_ID_FAMILY_NAME
@ DWRITE_FONT_PROPERTY_ID_TOTAL
@ DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME
@ DWRITE_FONT_PROPERTY_ID_STYLE
@ DWRITE_FONT_PROPERTY_ID_STRETCH
@ DWRITE_FONT_PROPERTY_ID_WEIGHT
@ DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FAMILY_NAME
@ DWRITE_FONT_PROPERTY_ID_FULL_NAME
HRESULT opentype_cmap_get_unicode_ranges(const struct dwrite_cmap *cmap, unsigned int max_count, DWRITE_UNICODE_RANGE *ranges, unsigned int *count)
HANDLE NTAPI CreateFileMappingA(IN HANDLE hFile, IN LPSECURITY_ATTRIBUTES lpFileMappingAttributes, IN DWORD flProtect, IN DWORD dwMaximumSizeHigh, IN DWORD dwMaximumSizeLow, IN LPCSTR lpName)
static const FxOffsetAndName offsets[]
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLuint GLuint GLsizei GLenum const GLvoid * indices
GLenum GLenum GLenum GLenum GLenum scale
GLsizei const GLchar *const * strings
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLuint GLsizei GLfloat * metrics
GLenum const GLfloat * params
GLuint64EXT GLuint GLuint GLenum GLenum GLuint GLenum GLuint GLenum target2
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLboolean GLenum GLenum GLvoid * values
GLuint64EXT GLuint GLuint GLenum GLenum GLuint GLuint GLenum target1
GLenum GLenum GLenum GLenum mapping
GLboolean GLboolean GLboolean GLboolean a
GLsizei const GLfloat * points
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 * u
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)
struct task_struct * current
static IDWriteFontFace * create_fontface(void)
static void array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
static void test_CreateFontFaceReference(void)
static ULONG WINAPI test_geometrysink_AddRef(ID2D1SimplifiedGeometrySink *iface)
static void test_inmemory_file_loader(void)
static ID2D1SimplifiedGeometrySink test_geomsink2
static IDWriteFont * get_font(IDWriteFactory *factory, const WCHAR *name, DWRITE_FONT_STYLE style)
static BOOL get_expected_is_color(IDWriteFontFace2 *fontface)
static const IUnknownVtbl testownervtbl
static ULONG WINAPI singlefontfileenumerator_AddRef(IDWriteFontFileEnumerator *iface)
static void test_ConvertFontFaceToLOGFONT(void)
static ULONG WINAPI fontdatastream_Release(IDWriteFontFileStream *iface)
static void WINAPI test_geometrysink2_AddBeziers(ID2D1SimplifiedGeometrySink *iface, const D2D1_BEZIER_SEGMENT *beziers, UINT32 count)
static ULONG WINAPI test_geometrysink_Release(ID2D1SimplifiedGeometrySink *iface)
static void test_AnalyzeContainerType(void)
static void WINAPI test_geometrysink_SetSegmentFlags(ID2D1SimplifiedGeometrySink *iface, D2D1_PATH_SEGMENT flags)
static HRESULT WINAPI fontfileenumerator_QueryInterface(IDWriteFontFileEnumerator *iface, REFIID riid, void **obj)
static void test_GetGlyphCount(void)
static BOOL face_has_table(IDWriteFontFace4 *fontface, UINT32 tag)
static void get_expected_fontsig(IDWriteFont *font, FONTSIGNATURE *fontsig)
static HRESULT create_fontdatastream(LPVOID data, UINT size, IDWriteFontFileStream **iface)
static void test_TranslateColorGlyphRun(void)
static ID2D1SimplifiedGeometrySink test_geomsink
static IDWriteFont * get_tahoma_instance(IDWriteFactory *factory, DWRITE_FONT_STYLE style)
static void test_expiration_event(void)
static HRESULT WINAPI fontdatastream_GetLastWriteTime(IDWriteFontFileStream *iface, UINT64 *last_writetime)
static DWORD table_read_be_dword(const struct dwrite_fonttable *table, void *ptr, DWORD offset)
static void test_ComputeGlyphOrigins(void)
static void _delete_testfontfile(const WCHAR *filename, int line)
static HRESULT WINAPI fontdatastream_ReadFileFragment(IDWriteFontFileStream *iface, void const **fragment_start, UINT64 offset, UINT64 fragment_size, void **fragment_context)
static void WINAPI test_geometrysink_EndFigure(ID2D1SimplifiedGeometrySink *iface, D2D1_FIGURE_END figureEnd)
static BOOL get_expected_is_symbol(IDWriteFontFace *fontface)
static void test_GetFontFamily(void)
@ TT_HEAD_MACSTYLE_EXTENDED
@ TT_HEAD_MACSTYLE_UNDERLINE
@ TT_HEAD_MACSTYLE_ITALIC
@ TT_HEAD_MACSTYLE_OUTLINE
@ TT_HEAD_MACSTYLE_SHADOW
@ TT_HEAD_MACSTYLE_CONDENSED
#define GASP_SYMMETRIC_GRIDFIT
static void WINAPI test_geometrysink2_BeginFigure(ID2D1SimplifiedGeometrySink *iface, D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin)
static void test_font_properties(void)
static void test_GetFaceNames(void)
static HRESULT WINAPI fontfileloader_QueryInterface(IDWriteFontFileLoader *iface, REFIID riid, void **obj)
#define check_familymodel(a, b)
static void test_GetFamilyNames(void)
static IDWriteFontCollectionLoader * create_collection_loader(void)
static void test_GetRecommendedRenderingMode(void)
static void test_IsMonospacedFont(void)
static ULONG WINAPI fontfileloader_AddRef(IDWriteFontFileLoader *iface)
static const struct VDMX_group * find_vdmx_group(const struct VDMX_Header *hdr)
static HRESULT WINAPI fontcollectionloader_CreateEnumeratorFromKey(IDWriteFontCollectionLoader *iface, IDWriteFactory *factory, const void *key, UINT32 key_size, IDWriteFontFileEnumerator **ret)
static void WINAPI test_geometrysink2_AddLines(ID2D1SimplifiedGeometrySink *iface, const D2D1_POINT_2F *points, UINT32 count)
static void test_system_font_set(void)
static float get_scaled_metric(const DWRITE_GLYPH_RUN *run, float metric, const DWRITE_FONT_METRICS *m)
static BOOL float_eq(FLOAT left, FLOAT right)
static ULONG WINAPI fontfileenumerator_Release(IDWriteFontFileEnumerator *iface)
static void _expect_ref_broken(IUnknown *obj, ULONG ref, ULONG brokenref, int line)
static void test_GetPanose(void)
static const struct IDWriteFontFileLoaderVtbl dwritefontfileloadervtbl
static ULONG WINAPI resourcecollectionloader_Release(IDWriteFontCollectionLoader *iface)
static void test_CreateCustomRenderingParams(void)
static void test_CreateFontFaceFromHdc(void)
static void test_GetMetrics(void)
static void test_HasCharacter(void)
static void test_HasVerticalGlyphVariants(void)
static struct test_fontcollectionloader * impl_from_IDWriteFontFileCollectionLoader(IDWriteFontCollectionLoader *iface)
static void test_GetAlphaBlendParams(void)
#define DELETE_FONTFILE(filename)
static void test_CreateFontFromLOGFONT(void)
static HRESULT WINAPI test_geometrysink_QueryInterface(ID2D1SimplifiedGeometrySink *iface, REFIID riid, void **ret)
static void get_expected_font_metrics(IDWriteFontFace *fontface, DWRITE_FONT_METRICS1 *metrics)
static HRESULT WINAPI resourcecollectionloader_CreateEnumeratorFromKey(IDWriteFontCollectionLoader *iface, IDWriteFactory *factory, const void *collectionKey, UINT32 collectionKeySize, IDWriteFontFileEnumerator **fontFileEnumerator)
#define CHECK_EXPECT(func)
opentype_cmap_table_format
@ OPENTYPE_CMAP_TABLE_SEGMENT_MAPPING
@ OPENTYPE_CMAP_TABLE_SEGMENTED_COVERAGE
static const struct IDWriteFontCollectionLoaderVtbl dwritefontcollectionloadervtbl
static void test_ReadFileFragment(void)
static void _expect_ref(IUnknown *obj, ULONG ref, int line)
static void _check_familymodel(void *iface_ptr, DWRITE_FONT_FAMILY_MODEL expected_model, unsigned int line)
static void test_TryGetFontTable(void)
static void WINAPI test_geometrysink_BeginFigure(ID2D1SimplifiedGeometrySink *iface, D2D1_POINT_2F startPoint, D2D1_FIGURE_BEGIN figureBegin)
#define DEFINE_EXPECT(func)
static void get_expected_panose(IDWriteFont1 *font, DWRITE_PANOSE *panose)
static void test_GetInformationalStrings(void)
static HRESULT WINAPI singlefontfileenumerator_QueryInterface(IDWriteFontFileEnumerator *iface, REFIID riid, void **obj)
static WORD get_gasp_flags(IDWriteFontFace *fontface, FLOAT emsize, FLOAT ppdip)
static const ID2D1SimplifiedGeometrySinkVtbl test_geometrysink_vtbl
static void check_font_metrics(const WCHAR *nameW, IDWriteFontFace *fontface, const DWRITE_FONT_METRICS1 *expected)
static ULONG WINAPI resourcefontfileloader_AddRef(IDWriteFontFileLoader *iface)
static void get_expected_glyph_origins(D2D1_POINT_2F baseline_origin, const DWRITE_GLYPH_RUN *run, D2D1_POINT_2F *origins)
static void test_GetGdiCompatibleMetrics(void)
static void test_GetCaretMetrics(void)
static void test_CreateBitmapRenderTarget(void)
static const struct IDWriteFontFileLoaderVtbl resourcefontfileloadervtbl
static BOOL get_expected_is_monospaced(IDWriteFontFace1 *fontface, const DWRITE_PANOSE *panose)
static const struct recommendedmode_test recmode_tests[]
static void test_GetMatchingFonts(void)
static void WINAPI test_geometrysink_SetFillMode(ID2D1SimplifiedGeometrySink *iface, D2D1_FILL_MODE mode)
static void test_GetFontFromFontFace(void)
static void test_CreateFontCollectionFromFontSet(void)
static DWORD get_face_glyph_image_formats(IDWriteFontFace4 *fontface)
static WCHAR * create_testfontfile(const WCHAR *filename)
static void test_CreateAlphaTexture(void)
static void test_GetUnicodeRanges(void)
static ULONG WINAPI fontdatastream_AddRef(IDWriteFontFileStream *iface)
static void test_GetPaletteEntries(void)
static void testowner_init(struct testowner_object *object)
static INT32 get_gdi_font_advance(HDC hdc, FLOAT emsize)
static void test_CreateStreamFromKey(void)
static void get_enus_string(IDWriteLocalizedStrings *strings, WCHAR *buff, UINT32 size)
static void test_font_resource(void)
static void test_metrics_cmp(FLOAT emsize, const DWRITE_FONT_METRICS *metrics, const DWRITE_FONT_METRICS1 *expected)
static void test_system_fontcollection(void)
static BOOL has_vertical_glyph_variants(IDWriteFontFace1 *fontface)
static BOOL has_main_axis_values(const DWRITE_FONT_AXIS_VALUE *values, unsigned int count)
static HRESULT WINAPI resourcecollectionloader_QueryInterface(IDWriteFontCollectionLoader *iface, REFIID riid, void **obj)
static void test_GetVerticalGlyphVariants(void)
static void test_GetDesignGlyphAdvances(void)
@ OPENTYPE_CMAP_TABLE_PLATFORM_WIN
static ULONG WINAPI resourcecollectionloader_AddRef(IDWriteFontCollectionLoader *iface)
static void test_GetDesignGlyphMetrics(void)
static BOOL get_vdmx_size(const struct VDMX_group *group, int emsize, int *a, int *d)
static void opentype_cmap_read_table(const struct dwrite_fonttable *table, UINT16 cmap_index, UINT32 *count, size_t *capacity, DWRITE_UNICODE_RANGE **ranges)
static void test_object_lifetime(void)
static ULONG WINAPI fontcollectionloader_AddRef(IDWriteFontCollectionLoader *iface)
static void test_GetSimulations(void)
static void get_combined_font_name(const WCHAR *familyW, const WCHAR *faceW, WCHAR *nameW)
static HRESULT WINAPI fontfileenumerator_MoveNext(IDWriteFontFileEnumerator *iface, BOOL *current)
static int g_startpoint_count
static IDWriteFontFileLoader rloader
static void WINAPI test_geometrysink2_EndFigure(ID2D1SimplifiedGeometrySink *iface, D2D1_FIGURE_END figureEnd)
static void test_GetGlyphImageFormats(void)
static void WINAPI test_geometrysink_AddLines(ID2D1SimplifiedGeometrySink *iface, const D2D1_POINT_2F *points, UINT32 count)
static HRESULT WINAPI fontcollectionloader_QueryInterface(IDWriteFontCollectionLoader *iface, REFIID riid, void **obj)
static HRESULT WINAPI fontdatastream_QueryInterface(IDWriteFontFileStream *iface, REFIID riid, void **obj)
static BOOL has_face_variations(IDWriteFontFace *fontface)
static HRESULT WINAPI testowner_QueryInterface(IUnknown *iface, REFIID riid, void **obj)
static HRESULT WINAPI resourcefontfileloader_QueryInterface(IDWriteFontFileLoader *iface, REFIID riid, void **obj)
static void test_CreateGlyphRunAnalysis(void)
static DWRITE_RENDERING_MODE get_expected_rendering_mode(FLOAT emsize, WORD gasp, DWRITE_MEASURING_MODE mode, DWRITE_OUTLINE_THRESHOLD threshold)
static const struct IDWriteFontFileEnumeratorVtbl dwritefontfileenumeratorvtbl
static void test_GetFontSignature(void)
static D2D1_POINT_2F g_startpoints[2]
static void test_GetKerningPairAdjustments(void)
static IDWriteFactory * create_factory(void)
#define EXPECT_REF_BROKEN(obj, ref, brokenref)
static ULONG WINAPI fontfileloader_Release(IDWriteFontFileLoader *iface)
static HRESULT create_enumerator(IDWriteFontFile *font_file, IDWriteFontFileEnumerator **ret)
static void test_shared_isolated(void)
static void WINAPI fontdatastream_ReleaseFileFragment(IDWriteFontFileStream *iface, void *fragment_context)
#define EXPECT_REF(obj, ref)
static void * map_font_file(const WCHAR *filename, DWORD *file_size)
#define CHECK_CALLED(func)
static const struct IDWriteFontCollectionLoaderVtbl resourcecollectionloadervtbl
static void test_GetEudcFontCollection(void)
static void test_metrics1_cmp(FLOAT emsize, const DWRITE_FONT_METRICS1 *metrics, const DWRITE_FONT_METRICS1 *expected)
static HRESULT WINAPI singlefontfileenumerator_MoveNext(IDWriteFontFileEnumerator *iface, BOOL *current)
static struct compatmetrics_test compatmetrics_tests[]
static HRESULT WINAPI resourcefontfileloader_CreateStreamFromKey(IDWriteFontFileLoader *iface, const void *ref_key, UINT32 key_size, IDWriteFontFileStream **stream)
#define GASP_SYMMETRIC_SMOOTHING
static void *static const WCHAR test_fontfile[]
static void test_CreateFontFace(void)
static void test_IsSymbolFont(void)
static HRESULT WINAPI fontdatastream_GetFileSize(IDWriteFontFileStream *iface, UINT64 *size)
static const IDWriteFontFileStreamVtbl fontdatastreamvtbl
static void test_GetMatchingFontsByLOGFONT(void)
static HANDLE get_collection_expiration_event(IDWriteFontCollection *collection)
static void test_fontsetbuilder(void)
static void test_IsColorFont(void)
static DWRITE_GRID_FIT_MODE get_expected_gridfit_mode(FLOAT emsize, WORD gasp, DWRITE_MEASURING_MODE mode, DWRITE_OUTLINE_THRESHOLD threshold)
static void test_HasKerningPairs(void)
static HRESULT WINAPI fontfileloader_CreateStreamFromKey(IDWriteFontFileLoader *iface, const void *ref_key, UINT32 key_size, IDWriteFontFileStream **stream)
static void * create_factory_iid(REFIID riid)
static HRESULT WINAPI singlefontfileenumerator_GetCurrentFontFile(IDWriteFontFileEnumerator *iface, IDWriteFontFile **font_file)
static struct testowner_object * impl_from_IUnknown(IUnknown *iface)
static ULONG WINAPI testowner_AddRef(IUnknown *iface)
static void test_GetFirstMatchingFont(void)
static ULONG WINAPI fontfileenumerator_AddRef(IDWriteFontFileEnumerator *iface)
static void test_GetGdiInterop(void)
static DWORD get_cblc_formats(IDWriteFontFace4 *fontface)
static void test_CreateFontFileReference(void)
static DWORD get_sbix_formats(IDWriteFontFace4 *fontface)
static ULONG WINAPI resourcefontfileloader_Release(IDWriteFontFileLoader *iface)
@ OPENTYPE_CMAP_TABLE_ENCODING_UNICODE_BMP
@ OPENTYPE_CMAP_TABLE_ENCODING_SYMBOL
@ OPENTYPE_CMAP_TABLE_ENCODING_UNICODE_FULL
static void test_CustomFontCollection(void)
static void test_CreateRenderingParams(void)
static HRESULT WINAPI fontfileenumerator_GetCurrentFontFile(IDWriteFontFileEnumerator *iface, IDWriteFontFile **file)
static ULONG WINAPI testowner_Release(IUnknown *iface)
static UINT32 fontface_get_expected_unicode_ranges(IDWriteFontFace1 *fontface, DWRITE_UNICODE_RANGE **out)
static void test_family_font_set(void)
static void test_gdicompat_metrics(IDWriteFontFace *face)
@ OS2_FSSELECTION_STRIKEOUT
@ OS2_FSSELECTION_NEGATIVE
@ OS2_FSSELECTION_REGULAR
@ OS2_FSSELECTION_USE_TYPO_METRICS
@ OS2_FSSELECTION_OBLIQUE
@ OS2_FSSELECTION_UNDERSCORE
@ OS2_FSSELECTION_OUTLINED
static void test_localfontfileloader(void)
static void WINAPI test_geometrysink_AddBeziers(ID2D1SimplifiedGeometrySink *iface, const D2D1_BEZIER_SEGMENT *beziers, UINT32 count)
static ULONG WINAPI singlefontfileenumerator_Release(IDWriteFontFileEnumerator *iface)
static struct collection_loader * impl_from_IDWriteFontCollectionLoader(IDWriteFontCollectionLoader *iface)
static const void * table_read_ensure(const struct dwrite_fonttable *table, unsigned int offset, unsigned int size)
static const struct IDWriteFontFileEnumeratorVtbl singlefontfileenumeratorvtbl
static ULONG WINAPI fontcollectionloader_Release(IDWriteFontCollectionLoader *iface)
static void test_GetGdiCompatibleGlyphAdvances(void)
static void test_CreateCustomFontFileReference(void)
static const struct recommendedmode_test recmode_tests1[]
static HRESULT WINAPI test_geometrysink_Close(ID2D1SimplifiedGeometrySink *iface)
static const ID2D1SimplifiedGeometrySinkVtbl test_geometrysink2_vtbl
static void get_expected_metrics(IDWriteFontFace *fontface, struct compatmetrics_test *ptr, DWRITE_FONT_METRICS *expected)
static void test_GetGlyphRunOutline(void)
static WORD table_read_be_word(const struct dwrite_fonttable *table, void *ptr, DWORD offset)
static void test_ConvertFontToLOGFONT(void)
static const WCHAR localeW[]
static const WCHAR pathW[]
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY PSLIST_ENTRY last
INTERNETFEATURELIST feature
static const struct @663 sizes[]
struct tagFeatureList FeatureList
#define LOCALE_NAME_MAX_LENGTH
#define MAKEINTRESOURCE(i)
#define IsEqualIID(riid1, riid2)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
static unsigned int file_size
FD_TYPE file_type(FDSC **curr, char *fixed)
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
DWORD indexSubTableArrayOffset
DWORD numberofIndexSubTables
DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat
DWRITE_MEASURING_MODE measuringMode
DWRITE_GLYPH_RUN glyphRun
DWRITE_GLYPH_RUN_DESCRIPTION * glyphRunDescription
DWRITE_GLYPH_RUN glyphRun
DWRITE_GLYPH_RUN_DESCRIPTION * glyphRunDescription
DWRITE_FONT_AXIS_TAG axisTag
INT16 superscriptPositionY
UINT16 underlineThickness
UINT16 strikethroughThickness
INT16 superscriptPositionX
INT16 strikethroughPosition
BOOL hasTypographicMetrics
INT16 strikethroughPosition
UINT16 strikethroughThickness
UINT16 underlineThickness
IDWriteFontFace * fontFace
DWRITE_GLYPH_OFFSET const * glyphOffsets
UINT16 const * glyphIndices
FLOAT const * glyphAdvances
CHAR lfFaceName[LF_FACESIZE]
WCHAR lfFaceName[LF_FACESIZE]
OT_FeatureRecord FeatureRecord[1]
IDWriteFontCollectionLoader IDWriteFontCollectionLoader_iface
DWRITE_OUTLINE_THRESHOLD threshold
DWRITE_MEASURING_MODE measuring
DWORD glyphDataOffsets[1]
IDWriteFontCollectionLoader IDWriteFontFileCollectionLoader_iface
IDWriteFontFileLoader * loader
IDWriteFontFileStream IDWriteFontFileStream_iface
IDWriteFontFileEnumerator IDWriteFontFileEnumerator_iface
IDWriteFontFile * font_file
SHORT ySuperscriptXOffset
SHORT ySuperscriptYOffset
int16_t underlinePosition
int16_t underlineThickness
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
struct DWRITE_PANOSE::@3545 text
static const WCHAR props[]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
BOOL WINAPI RemoveFontMemResourceEx(HANDLE fh)
DWORD WINAPI GetLastError(void)
#define E_NOT_SUFFICIENT_BUFFER
#define DWRITE_E_ALREADYREGISTERED
#define DWRITE_E_UNSUPPORTEDOPERATION
#define DWRITE_E_FILEFORMAT
#define DWRITE_E_FILENOTFOUND
#define E_NOT_VALID_STATE
int WINAPI GetBkMode(_In_ HDC)
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
int WINAPI GetGraphicsMode(_In_ HDC)
COLORREF WINAPI GetTextColor(_In_ HDC)
#define PAN_FAMILY_PICTORIAL
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
COLORREF WINAPI GetBkColor(_In_ HDC)
BOOL WINAPI GetWorldTransform(_In_ HDC, _Out_ LPXFORM)
#define CLIP_DEFAULT_PRECIS
UINT WINAPI GetOutlineTextMetricsW(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICW potm)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
BOOL WINAPI DeleteDC(_In_ HDC)
#define CLEARTYPE_QUALITY
BOOL WINAPI GetCharABCWidthsW(_In_ HDC hdc, _In_ UINT wFirst, _In_ UINT wLast, _Out_writes_(wLast - wFirst+1) LPABC lpABC)
HANDLE WINAPI AddFontMemResourceEx(_In_reads_bytes_(cjSize) PVOID pvFileView, _In_ DWORD cjSize, _Reserved_ PVOID pvResrved, _In_ DWORD *pNumFonts)
#define OUT_OUTLINE_PRECIS
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList