Atom
DWrite.h
1 //+--------------------------------------------------------------------------
2 //
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 //
5 // Abstract:
6 // DirectX Typography Services public API definitions.
7 //
8 //----------------------------------------------------------------------------
9 
10 #ifndef DWRITE_H_INCLUDED
11 #define DWRITE_H_INCLUDED
12 
13 #if _MSC_VER > 1000
14 #pragma once
15 #endif
16 
17 #ifndef DWRITE_NO_WINDOWS_H
18 
19 #include <specstrings.h>
20 #include <unknwn.h>
21 
22 #endif // DWRITE_NO_WINDOWS_H
23 
24 #include <dcommon.h>
25 
26 #ifndef DWRITE_DECLARE_INTERFACE
27 #define DWRITE_DECLARE_INTERFACE(iid) DECLSPEC_UUID(iid) DECLSPEC_NOVTABLE
28 #endif
29 
30 #ifndef DWRITE_EXPORT
31 #define DWRITE_EXPORT __declspec(dllimport) WINAPI
32 #endif
33 
39 enum DWRITE_FONT_FILE_TYPE
40 {
44  DWRITE_FONT_FILE_TYPE_UNKNOWN,
45 
49  DWRITE_FONT_FILE_TYPE_CFF,
50 
54  DWRITE_FONT_FILE_TYPE_TRUETYPE,
55 
59  DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION,
60 
64  DWRITE_FONT_FILE_TYPE_TYPE1_PFM,
65 
69  DWRITE_FONT_FILE_TYPE_TYPE1_PFB,
70 
74  DWRITE_FONT_FILE_TYPE_VECTOR,
75 
79  DWRITE_FONT_FILE_TYPE_BITMAP
80 };
81 
87 enum DWRITE_FONT_FACE_TYPE
88 {
92  DWRITE_FONT_FACE_TYPE_CFF,
93 
97  DWRITE_FONT_FACE_TYPE_TRUETYPE,
98 
102  DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION,
103 
107  DWRITE_FONT_FACE_TYPE_TYPE1,
108 
112  DWRITE_FONT_FACE_TYPE_VECTOR,
113 
117  DWRITE_FONT_FACE_TYPE_BITMAP,
118 
122  DWRITE_FONT_FACE_TYPE_UNKNOWN
123 };
124 
129 enum DWRITE_FONT_SIMULATIONS
130 {
134  DWRITE_FONT_SIMULATIONS_NONE = 0x0000,
135 
139  DWRITE_FONT_SIMULATIONS_BOLD = 0x0001,
140 
144  DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002
145 };
146 
147 #ifdef DEFINE_ENUM_FLAG_OPERATORS
148 DEFINE_ENUM_FLAG_OPERATORS(DWRITE_FONT_SIMULATIONS);
149 #endif
150 
155 enum DWRITE_FONT_WEIGHT
156 {
160  DWRITE_FONT_WEIGHT_THIN = 100,
161 
165  DWRITE_FONT_WEIGHT_EXTRA_LIGHT = 200,
166 
170  DWRITE_FONT_WEIGHT_ULTRA_LIGHT = 200,
171 
175  DWRITE_FONT_WEIGHT_LIGHT = 300,
176 
180  DWRITE_FONT_WEIGHT_NORMAL = 400,
181 
185  DWRITE_FONT_WEIGHT_REGULAR = 400,
186 
190  DWRITE_FONT_WEIGHT_MEDIUM = 500,
191 
195  DWRITE_FONT_WEIGHT_DEMI_BOLD = 600,
196 
200  DWRITE_FONT_WEIGHT_SEMI_BOLD = 600,
201 
205  DWRITE_FONT_WEIGHT_BOLD = 700,
206 
210  DWRITE_FONT_WEIGHT_EXTRA_BOLD = 800,
211 
215  DWRITE_FONT_WEIGHT_ULTRA_BOLD = 800,
216 
220  DWRITE_FONT_WEIGHT_BLACK = 900,
221 
225  DWRITE_FONT_WEIGHT_HEAVY = 900,
226 
230  DWRITE_FONT_WEIGHT_EXTRA_BLACK = 950,
231 
235  DWRITE_FONT_WEIGHT_ULTRA_BLACK = 950
236 };
237 
243 enum DWRITE_FONT_STRETCH
244 {
248  DWRITE_FONT_STRETCH_UNDEFINED = 0,
249 
253  DWRITE_FONT_STRETCH_ULTRA_CONDENSED = 1,
254 
258  DWRITE_FONT_STRETCH_EXTRA_CONDENSED = 2,
259 
263  DWRITE_FONT_STRETCH_CONDENSED = 3,
264 
268  DWRITE_FONT_STRETCH_SEMI_CONDENSED = 4,
269 
273  DWRITE_FONT_STRETCH_NORMAL = 5,
274 
278  DWRITE_FONT_STRETCH_MEDIUM = 5,
279 
283  DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6,
284 
288  DWRITE_FONT_STRETCH_EXPANDED = 7,
289 
293  DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8,
294 
298  DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9
299 };
300 
305 enum DWRITE_FONT_STYLE
306 {
310  DWRITE_FONT_STYLE_NORMAL,
311 
315  DWRITE_FONT_STYLE_OBLIQUE,
316 
320  DWRITE_FONT_STYLE_ITALIC
321 
322 };
323 
327 enum DWRITE_INFORMATIONAL_STRING_ID
328 {
332  DWRITE_INFORMATIONAL_STRING_NONE,
333 
337  DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE,
338 
342  DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS,
343 
347  DWRITE_INFORMATIONAL_STRING_TRADEMARK,
348 
352  DWRITE_INFORMATIONAL_STRING_MANUFACTURER,
353 
357  DWRITE_INFORMATIONAL_STRING_DESIGNER,
358 
362  DWRITE_INFORMATIONAL_STRING_DESIGNER_URL,
363 
367  DWRITE_INFORMATIONAL_STRING_DESCRIPTION,
368 
372  DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL,
373 
377  DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION,
378 
382  DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL,
383 
388  DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES,
389 
393  DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES,
394 
399  DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES,
400 
404  DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES,
405 
409  DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT
410 };
411 
412 
418 {
428 
433  UINT16 ascent;
434 
439  UINT16 descent;
440 
448  INT16 lineGap;
449 
455  UINT16 capHeight;
456 
461  UINT16 xHeight;
462 
469 
474 
481 
486 };
487 
493 {
500 
504  UINT32 advanceWidth;
505 
511 
517 
525 
532 
539 };
540 
546 {
552 
558 };
559 
570 enum DWRITE_FACTORY_TYPE
571 {
576  DWRITE_FACTORY_TYPE_SHARED,
577 
581  DWRITE_FACTORY_TYPE_ISOLATED
582 };
583 
584 // Creates an OpenType tag as a 32bit integer such that
585 // the first character in the tag is the lowest byte,
586 // (least significant on little endian architectures)
587 // which can be used to compare with tags in the font file.
588 // This macro is compatible with DWRITE_FONT_FEATURE_TAG.
589 //
590 // Example: DWRITE_MAKE_OPENTYPE_TAG('c','c','m','p')
591 // Dword: 0x706D6363
592 //
593 #define DWRITE_MAKE_OPENTYPE_TAG(a,b,c,d) ( \
594  (static_cast<UINT32>(static_cast<UINT8>(d)) << 24) | \
595  (static_cast<UINT32>(static_cast<UINT8>(c)) << 16) | \
596  (static_cast<UINT32>(static_cast<UINT8>(b)) << 8) | \
597  static_cast<UINT32>(static_cast<UINT8>(a)))
598 
599 interface IDWriteFontFileStream;
600 
610 interface DWRITE_DECLARE_INTERFACE("727cad4e-d6af-4c9e-8a08-d695b11caa49") IDWriteFontFileLoader : public IUnknown
611 {
623  STDMETHOD(CreateStreamFromKey)(
624  __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
625  UINT32 fontFileReferenceKeySize,
626  __out IDWriteFontFileStream** fontFileStream
627  ) PURE;
628 };
629 
635 interface DWRITE_DECLARE_INTERFACE("b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2") IDWriteLocalFontFileLoader : public IDWriteFontFileLoader
636 {
647  STDMETHOD(GetFilePathLengthFromKey)(
648  __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
649  UINT32 fontFileReferenceKeySize,
650  __out UINT32* filePathLength
651  ) PURE;
652 
664  STDMETHOD(GetFilePathFromKey)(
665  __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
666  UINT32 fontFileReferenceKeySize,
667  __out_ecount_z(filePathSize) WCHAR* filePath,
668  UINT32 filePathSize
669  ) PURE;
670 
681  STDMETHOD(GetLastWriteTimeFromKey)(
682  __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
683  UINT32 fontFileReferenceKeySize,
684  __out FILETIME* lastWriteTime
685  ) PURE;
686 };
687 
691 interface DWRITE_DECLARE_INTERFACE("6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0") IDWriteFontFileStream : public IUnknown
692 {
707  STDMETHOD(ReadFileFragment)(
708  __deref_out_bcount(fragmentSize) void const** fragmentStart,
709  UINT64 fileOffset,
710  UINT64 fragmentSize,
711  __out void** fragmentContext
712  ) PURE;
713 
718  STDMETHOD_(void, ReleaseFileFragment)(
719  void* fragmentContext
720  ) PURE;
721 
735  STDMETHOD(GetFileSize)(
736  __out UINT64* fileSize
737  ) PURE;
738 
749  STDMETHOD(GetLastWriteTime)(
750  __out UINT64* lastWriteTime
751  ) PURE;
752 };
753 
757 interface DWRITE_DECLARE_INTERFACE("739d886a-cef5-47dc-8769-1a8b41bebbb0") IDWriteFontFile : public IUnknown
758 {
768  STDMETHOD(GetReferenceKey)(
769  __deref_out_bcount(*fontFileReferenceKeySize) void const** fontFileReferenceKey,
770  __out UINT32* fontFileReferenceKeySize
771  ) PURE;
772 
780  STDMETHOD(GetLoader)(
781  __out IDWriteFontFileLoader** fontFileLoader
782  ) PURE;
783 
803  STDMETHOD(Analyze)(
804  __out BOOL* isSupportedFontType,
805  __out DWRITE_FONT_FILE_TYPE* fontFileType,
806  __out_opt DWRITE_FONT_FACE_TYPE* fontFaceType,
807  __out UINT32* numberOfFaces
808  ) PURE;
809 };
810 
815 #ifndef DWRITE_PIXEL_GEOMETRY_DEFINED
816 enum DWRITE_PIXEL_GEOMETRY
817 {
821  DWRITE_PIXEL_GEOMETRY_FLAT,
822 
827  DWRITE_PIXEL_GEOMETRY_RGB,
828 
833  DWRITE_PIXEL_GEOMETRY_BGR
834 };
835 #define DWRITE_PIXEL_GEOMETRY_DEFINED
836 #endif
837 
841 enum DWRITE_RENDERING_MODE
842 {
846  DWRITE_RENDERING_MODE_DEFAULT,
847 
852  DWRITE_RENDERING_MODE_ALIASED,
853 
858  DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC,
859 
865  DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL,
866 
871  DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL,
872 
878  DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
879 
884  DWRITE_RENDERING_MODE_OUTLINE
885 };
886 
892 {
896  FLOAT m11;
897 
901  FLOAT m12;
902 
906  FLOAT m21;
907 
911  FLOAT m22;
912 
916  FLOAT dx;
917 
921  FLOAT dy;
922 };
923 
927 interface DWRITE_DECLARE_INTERFACE("2f0da53a-2add-47cd-82ee-d9ec34688e75") IDWriteRenderingParams : public IUnknown
928 {
933  STDMETHOD_(FLOAT, GetGamma)() PURE;
934 
939  STDMETHOD_(FLOAT, GetEnhancedContrast)() PURE;
940 
945  STDMETHOD_(FLOAT, GetClearTypeLevel)() PURE;
946 
950  STDMETHOD_(DWRITE_PIXEL_GEOMETRY, GetPixelGeometry)() PURE;
951 
955  STDMETHOD_(DWRITE_RENDERING_MODE, GetRenderingMode)() PURE;
956 };
957 
958 // Forward declarations of D2D types
959 interface ID2D1SimplifiedGeometrySink;
960 
961 typedef ID2D1SimplifiedGeometrySink IDWriteGeometrySink;
962 
968 interface DWRITE_DECLARE_INTERFACE("5f49804d-7024-4d43-bfa9-d25984f53849") IDWriteFontFace : public IUnknown
969 {
973  STDMETHOD_(DWRITE_FONT_FACE_TYPE, GetType)() PURE;
974 
986  STDMETHOD(GetFiles)(
987  __inout UINT32* numberOfFiles,
988  __out_ecount_opt(*numberOfFiles) IDWriteFontFile** fontFiles
989  ) PURE;
990 
995  STDMETHOD_(UINT32, GetIndex)() PURE;
996 
1000  STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE;
1001 
1005  STDMETHOD_(BOOL, IsSymbolFont)() PURE;
1006 
1013  STDMETHOD_(void, GetMetrics)(
1014  __out DWRITE_FONT_METRICS* fontFaceMetrics
1015  ) PURE;
1016 
1020  STDMETHOD_(UINT16, GetGlyphCount)() PURE;
1021 
1036  STDMETHOD(GetDesignGlyphMetrics)(
1037  __in_ecount(glyphCount) UINT16 const* glyphIndices,
1038  UINT32 glyphCount,
1039  __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
1040  BOOL isSideways = FALSE
1041  ) PURE;
1042 
1057  STDMETHOD(GetGlyphIndices)(
1058  __in_ecount(codePointCount) UINT32 const* codePoints,
1059  UINT32 codePointCount,
1060  __out_ecount(codePointCount) UINT16* glyphIndices
1061  ) PURE;
1062 
1097  STDMETHOD(TryGetFontTable)(
1098  __in UINT32 openTypeTableTag,
1099  __deref_out_bcount(*tableSize) const void** tableData,
1100  __out UINT32* tableSize,
1101  __out void** tableContext,
1102  __out BOOL* exists
1103  ) PURE;
1104 
1112  STDMETHOD_(void, ReleaseFontTable)(
1113  __in void* tableContext
1114  ) PURE;
1115 
1133  STDMETHOD(GetGlyphRunOutline)(
1134  FLOAT emSize,
1135  __in_ecount(glyphCount) UINT16 const* glyphIndices,
1136  __in_ecount_opt(glyphCount) FLOAT const* glyphAdvances,
1137  __in_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets,
1138  UINT32 glyphCount,
1139  BOOL isSideways,
1140  BOOL isRightToLeft,
1141  IDWriteGeometrySink* geometrySink
1142  ) PURE;
1143 
1163  STDMETHOD(GetRecommendedRenderingMode)(
1164  FLOAT emSize,
1165  FLOAT pixelsPerDip,
1166  DWRITE_MEASURING_MODE measuringMode,
1167  IDWriteRenderingParams* renderingParams,
1168  __out DWRITE_RENDERING_MODE* renderingMode
1169  ) PURE;
1170 
1182  STDMETHOD(GetGdiCompatibleMetrics)(
1183  FLOAT emSize,
1184  FLOAT pixelsPerDip,
1185  __in_opt DWRITE_MATRIX const* transform,
1186  __out DWRITE_FONT_METRICS* fontFaceMetrics
1187  ) PURE;
1188 
1189 
1215  STDMETHOD(GetGdiCompatibleGlyphMetrics)(
1216  FLOAT emSize,
1217  FLOAT pixelsPerDip,
1218  __in_opt DWRITE_MATRIX const* transform,
1219  BOOL useGdiNatural,
1220  __in_ecount(glyphCount) UINT16 const* glyphIndices,
1221  UINT32 glyphCount,
1222  __out_ecount(glyphCount) DWRITE_GLYPH_METRICS* glyphMetrics,
1223  BOOL isSideways = FALSE
1224  ) PURE;
1225 };
1226 
1227 interface IDWriteFactory;
1228 interface IDWriteFontFileEnumerator;
1229 
1239 interface DWRITE_DECLARE_INTERFACE("cca920e4-52f0-492b-bfa8-29c72ee0a468") IDWriteFontCollectionLoader : public IUnknown
1240 {
1253  STDMETHOD(CreateEnumeratorFromKey)(
1254  IDWriteFactory* factory,
1255  __in_bcount(collectionKeySize) void const* collectionKey,
1256  UINT32 collectionKeySize,
1257  __out IDWriteFontFileEnumerator** fontFileEnumerator
1258  ) PURE;
1259 };
1260 
1265 interface DWRITE_DECLARE_INTERFACE("72755049-5ff7-435d-8348-4be97cfa6c7c") IDWriteFontFileEnumerator : public IUnknown
1266 {
1276  STDMETHOD(MoveNext)(
1277  __out BOOL* hasCurrentFile
1278  ) PURE;
1279 
1287  STDMETHOD(GetCurrentFontFile)(
1288  __out IDWriteFontFile** fontFile
1289  ) PURE;
1290 };
1291 
1295 interface DWRITE_DECLARE_INTERFACE("08256209-099a-4b34-b86d-c22b110e7771") IDWriteLocalizedStrings : public IUnknown
1296 {
1300  STDMETHOD_(UINT32, GetCount)() PURE;
1301 
1312  STDMETHOD(FindLocaleName)(
1313  __in_z WCHAR const* localeName,
1314  __out UINT32* index,
1315  __out BOOL* exists
1316  ) PURE;
1317 
1326  STDMETHOD(GetLocaleNameLength)(
1327  UINT32 index,
1328  __out UINT32* length
1329  ) PURE;
1330 
1341  STDMETHOD(GetLocaleName)(
1342  UINT32 index,
1343  __out_ecount_z(size) WCHAR* localeName,
1344  UINT32 size
1345  ) PURE;
1346 
1355  STDMETHOD(GetStringLength)(
1356  UINT32 index,
1357  __out UINT32* length
1358  ) PURE;
1359 
1370  STDMETHOD(GetString)(
1371  UINT32 index,
1372  __out_ecount_z(size) WCHAR* stringBuffer,
1373  UINT32 size
1374  ) PURE;
1375 };
1376 
1377 interface IDWriteFontFamily;
1378 interface IDWriteFont;
1379 
1383 interface DWRITE_DECLARE_INTERFACE("a84cee02-3eea-4eee-a827-87c1a02a0fcc") IDWriteFontCollection : public IUnknown
1384 {
1388  STDMETHOD_(UINT32, GetFontFamilyCount)() PURE;
1389 
1398  STDMETHOD(GetFontFamily)(
1399  UINT32 index,
1400  __out IDWriteFontFamily** fontFamily
1401  ) PURE;
1402 
1412  STDMETHOD(FindFamilyName)(
1413  __in_z WCHAR const* familyName,
1414  __out UINT32* index,
1415  __out BOOL* exists
1416  ) PURE;
1417 
1427  STDMETHOD(GetFontFromFontFace)(
1428  IDWriteFontFace* fontFace,
1429  __out IDWriteFont** font
1430  ) PURE;
1431 };
1432 
1436 interface DWRITE_DECLARE_INTERFACE("1a0d8438-1d97-4ec1-aef9-a2fb86ed6acb") IDWriteFontList : public IUnknown
1437 {
1445  STDMETHOD(GetFontCollection)(
1446  __out IDWriteFontCollection** fontCollection
1447  ) PURE;
1448 
1452  STDMETHOD_(UINT32, GetFontCount)() PURE;
1453 
1462  STDMETHOD(GetFont)(
1463  UINT32 index,
1464  __out IDWriteFont** font
1465  ) PURE;
1466 };
1467 
1472 interface DWRITE_DECLARE_INTERFACE("da20d8ef-812a-4c43-9802-62ec4abd7add") IDWriteFontFamily : public IDWriteFontList
1473 {
1481  STDMETHOD(GetFamilyNames)(
1482  __out IDWriteLocalizedStrings** names
1483  ) PURE;
1484 
1495  STDMETHOD(GetFirstMatchingFont)(
1496  DWRITE_FONT_WEIGHT weight,
1497  DWRITE_FONT_STRETCH stretch,
1498  DWRITE_FONT_STYLE style,
1499  __out IDWriteFont** matchingFont
1500  ) PURE;
1501 
1512  STDMETHOD(GetMatchingFonts)(
1513  DWRITE_FONT_WEIGHT weight,
1514  DWRITE_FONT_STRETCH stretch,
1515  DWRITE_FONT_STYLE style,
1516  __out IDWriteFontList** matchingFonts
1517  ) PURE;
1518 };
1519 
1523 interface DWRITE_DECLARE_INTERFACE("acd16696-8c14-4f5d-877e-fe3fc1d32737") IDWriteFont : public IUnknown
1524 {
1532  STDMETHOD(GetFontFamily)(
1533  __out IDWriteFontFamily** fontFamily
1534  ) PURE;
1535 
1539  STDMETHOD_(DWRITE_FONT_WEIGHT, GetWeight)() PURE;
1540 
1544  STDMETHOD_(DWRITE_FONT_STRETCH, GetStretch)() PURE;
1545 
1549  STDMETHOD_(DWRITE_FONT_STYLE, GetStyle)() PURE;
1550 
1554  STDMETHOD_(BOOL, IsSymbolFont)() PURE;
1555 
1563  STDMETHOD(GetFaceNames)(
1564  __out IDWriteLocalizedStrings** names
1565  ) PURE;
1566 
1577  STDMETHOD(GetInformationalStrings)(
1578  DWRITE_INFORMATIONAL_STRING_ID informationalStringID,
1579  __out IDWriteLocalizedStrings** informationalStrings,
1580  __out BOOL* exists
1581  ) PURE;
1582 
1586  STDMETHOD_(DWRITE_FONT_SIMULATIONS, GetSimulations)() PURE;
1587 
1592  STDMETHOD_(void, GetMetrics)(
1593  __out DWRITE_FONT_METRICS* fontMetrics
1594  ) PURE;
1595 
1604  STDMETHOD(HasCharacter)(
1605  UINT32 unicodeValue,
1606  __out BOOL* exists
1607  ) PURE;
1608 
1616  STDMETHOD(CreateFontFace)(
1617  __out IDWriteFontFace** fontFace
1618  ) PURE;
1619 };
1620 
1624 enum DWRITE_READING_DIRECTION
1625 {
1629  DWRITE_READING_DIRECTION_LEFT_TO_RIGHT,
1630 
1634  DWRITE_READING_DIRECTION_RIGHT_TO_LEFT
1635 };
1636 
1640 enum DWRITE_FLOW_DIRECTION
1641 {
1645  DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM
1646 };
1647 
1652 enum DWRITE_TEXT_ALIGNMENT
1653 {
1657  DWRITE_TEXT_ALIGNMENT_LEADING,
1658 
1662  DWRITE_TEXT_ALIGNMENT_TRAILING,
1663 
1667  DWRITE_TEXT_ALIGNMENT_CENTER
1668 };
1669 
1674 enum DWRITE_PARAGRAPH_ALIGNMENT
1675 {
1679  DWRITE_PARAGRAPH_ALIGNMENT_NEAR,
1680 
1684  DWRITE_PARAGRAPH_ALIGNMENT_FAR,
1685 
1689  DWRITE_PARAGRAPH_ALIGNMENT_CENTER
1690 };
1691 
1695 enum DWRITE_WORD_WRAPPING
1696 {
1700  DWRITE_WORD_WRAPPING_WRAP,
1701 
1706  DWRITE_WORD_WRAPPING_NO_WRAP
1707 };
1708 
1712 enum DWRITE_LINE_SPACING_METHOD
1713 {
1717  DWRITE_LINE_SPACING_METHOD_DEFAULT,
1718 
1723  DWRITE_LINE_SPACING_METHOD_UNIFORM
1724 };
1725 
1729 enum DWRITE_TRIMMING_GRANULARITY
1730 {
1734  DWRITE_TRIMMING_GRANULARITY_NONE,
1735 
1739  DWRITE_TRIMMING_GRANULARITY_CHARACTER,
1740 
1744  DWRITE_TRIMMING_GRANULARITY_WORD
1745 };
1746 
1750 enum DWRITE_FONT_FEATURE_TAG
1751 {
1752  DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS = 0x63726661, // 'afrc'
1753  DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS = 0x63703263, // 'c2pc'
1754  DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS = 0x63733263, // 'c2sc'
1755  DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES = 0x746c6163, // 'calt'
1756  DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS = 0x65736163, // 'case'
1757  DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION = 0x706d6363, // 'ccmp'
1758  DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES = 0x67696c63, // 'clig'
1759  DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING = 0x70737063, // 'cpsp'
1760  DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH = 0x68777363, // 'cswh'
1761  DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING = 0x73727563, // 'curs'
1762  DWRITE_FONT_FEATURE_TAG_DEFAULT = 0x746c6664, // 'dflt'
1763  DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES = 0x67696c64, // 'dlig'
1764  DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS = 0x74707865, // 'expt'
1765  DWRITE_FONT_FEATURE_TAG_FRACTIONS = 0x63617266, // 'frac'
1766  DWRITE_FONT_FEATURE_TAG_FULL_WIDTH = 0x64697766, // 'fwid'
1767  DWRITE_FONT_FEATURE_TAG_HALF_FORMS = 0x666c6168, // 'half'
1768  DWRITE_FONT_FEATURE_TAG_HALANT_FORMS = 0x6e6c6168, // 'haln'
1769  DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH = 0x746c6168, // 'halt'
1770  DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS = 0x74736968, // 'hist'
1771  DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES = 0x616e6b68, // 'hkna'
1772  DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES = 0x67696c68, // 'hlig'
1773  DWRITE_FONT_FEATURE_TAG_HALF_WIDTH = 0x64697768, // 'hwid'
1774  DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS = 0x6f6a6f68, // 'hojo'
1775  DWRITE_FONT_FEATURE_TAG_JIS04_FORMS = 0x3430706a, // 'jp04'
1776  DWRITE_FONT_FEATURE_TAG_JIS78_FORMS = 0x3837706a, // 'jp78'
1777  DWRITE_FONT_FEATURE_TAG_JIS83_FORMS = 0x3338706a, // 'jp83'
1778  DWRITE_FONT_FEATURE_TAG_JIS90_FORMS = 0x3039706a, // 'jp90'
1779  DWRITE_FONT_FEATURE_TAG_KERNING = 0x6e72656b, // 'kern'
1780  DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES = 0x6167696c, // 'liga'
1781  DWRITE_FONT_FEATURE_TAG_LINING_FIGURES = 0x6d756e6c, // 'lnum'
1782  DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS = 0x6c636f6c, // 'locl'
1783  DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING = 0x6b72616d, // 'mark'
1784  DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK = 0x6b72676d, // 'mgrk'
1785  DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING = 0x6b6d6b6d, // 'mkmk'
1786  DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS = 0x746c616e, // 'nalt'
1787  DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS = 0x6b636c6e, // 'nlck'
1788  DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES = 0x6d756e6f, // 'onum'
1789  DWRITE_FONT_FEATURE_TAG_ORDINALS = 0x6e64726f, // 'ordn'
1790  DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH = 0x746c6170, // 'palt'
1791  DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS = 0x70616370, // 'pcap'
1792  DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES = 0x6d756e70, // 'pnum'
1793  DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS = 0x64697770, // 'pwid'
1794  DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS = 0x64697771, // 'qwid'
1795  DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES = 0x67696c72, // 'rlig'
1796  DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS = 0x79627572, // 'ruby'
1797  DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES = 0x746c6173, // 'salt'
1798  DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS = 0x666e6973, // 'sinf'
1799  DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS = 0x70636d73, // 'smcp'
1800  DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS = 0x6c706d73, // 'smpl'
1801  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1 = 0x31307373, // 'ss01'
1802  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2 = 0x32307373, // 'ss02'
1803  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3 = 0x33307373, // 'ss03'
1804  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4 = 0x34307373, // 'ss04'
1805  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5 = 0x35307373, // 'ss05'
1806  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6 = 0x36307373, // 'ss06'
1807  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7 = 0x37307373, // 'ss07'
1808  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8 = 0x38307373, // 'ss08'
1809  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9 = 0x39307373, // 'ss09'
1810  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10 = 0x30317373, // 'ss10'
1811  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11 = 0x31317373, // 'ss11'
1812  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12 = 0x32317373, // 'ss12'
1813  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13 = 0x33317373, // 'ss13'
1814  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14 = 0x34317373, // 'ss14'
1815  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15 = 0x35317373, // 'ss15'
1816  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16 = 0x36317373, // 'ss16'
1817  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17 = 0x37317373, // 'ss17'
1818  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18 = 0x38317373, // 'ss18'
1819  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19 = 0x39317373, // 'ss19'
1820  DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20 = 0x30327373, // 'ss20'
1821  DWRITE_FONT_FEATURE_TAG_SUBSCRIPT = 0x73627573, // 'subs'
1822  DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT = 0x73707573, // 'sups'
1823  DWRITE_FONT_FEATURE_TAG_SWASH = 0x68737773, // 'swsh'
1824  DWRITE_FONT_FEATURE_TAG_TITLING = 0x6c746974, // 'titl'
1825  DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS = 0x6d616e74, // 'tnam'
1826  DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES = 0x6d756e74, // 'tnum'
1827  DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS = 0x64617274, // 'trad'
1828  DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS = 0x64697774, // 'twid'
1829  DWRITE_FONT_FEATURE_TAG_UNICASE = 0x63696e75, // 'unic'
1830  DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO = 0x6f72657a, // 'zero'
1831 };
1832 
1837 {
1842 
1846  UINT32 length;
1847 };
1848 
1853 {
1857  DWRITE_FONT_FEATURE_TAG nameTag;
1858 
1866  UINT32 parameter;
1867 };
1868 
1875 {
1879  __field_ecount(featureCount) DWRITE_FONT_FEATURE* features;
1880 
1885 };
1886 
1891 {
1895  DWRITE_TRIMMING_GRANULARITY granularity;
1896 
1901  UINT32 delimiter;
1902 
1907 };
1908 
1909 
1910 interface IDWriteTypography;
1911 interface IDWriteInlineObject;
1912 
1919 interface DWRITE_DECLARE_INTERFACE("9c906818-31d7-4fd3-a151-7c5e225db55a") IDWriteTextFormat : public IUnknown
1920 {
1928  STDMETHOD(SetTextAlignment)(
1929  DWRITE_TEXT_ALIGNMENT textAlignment
1930  ) PURE;
1931 
1939  STDMETHOD(SetParagraphAlignment)(
1940  DWRITE_PARAGRAPH_ALIGNMENT paragraphAlignment
1941  ) PURE;
1942 
1950  STDMETHOD(SetWordWrapping)(
1951  DWRITE_WORD_WRAPPING wordWrapping
1952  ) PURE;
1953 
1961  STDMETHOD(SetReadingDirection)(
1962  DWRITE_READING_DIRECTION readingDirection
1963  ) PURE;
1964 
1972  STDMETHOD(SetFlowDirection)(
1973  DWRITE_FLOW_DIRECTION flowDirection
1974  ) PURE;
1975 
1983  STDMETHOD(SetIncrementalTabStop)(
1984  FLOAT incrementalTabStop
1985  ) PURE;
1986 
2001  STDMETHOD(SetTrimming)(
2002  __in DWRITE_TRIMMING const* trimmingOptions,
2003  IDWriteInlineObject* trimmingSign
2004  ) PURE;
2005 
2019  STDMETHOD(SetLineSpacing)(
2020  DWRITE_LINE_SPACING_METHOD lineSpacingMethod,
2021  FLOAT lineSpacing,
2022  FLOAT baseline
2023  ) PURE;
2024 
2028  STDMETHOD_(DWRITE_TEXT_ALIGNMENT, GetTextAlignment)() PURE;
2029 
2033  STDMETHOD_(DWRITE_PARAGRAPH_ALIGNMENT, GetParagraphAlignment)() PURE;
2034 
2038  STDMETHOD_(DWRITE_WORD_WRAPPING, GetWordWrapping)() PURE;
2039 
2043  STDMETHOD_(DWRITE_READING_DIRECTION, GetReadingDirection)() PURE;
2044 
2048  STDMETHOD_(DWRITE_FLOW_DIRECTION, GetFlowDirection)() PURE;
2049 
2053  STDMETHOD_(FLOAT, GetIncrementalTabStop)() PURE;
2054 
2063  STDMETHOD(GetTrimming)(
2064  __out DWRITE_TRIMMING* trimmingOptions,
2065  __out IDWriteInlineObject** trimmingSign
2066  ) PURE;
2067 
2077  STDMETHOD(GetLineSpacing)(
2078  __out DWRITE_LINE_SPACING_METHOD* lineSpacingMethod,
2079  __out FLOAT* lineSpacing,
2080  __out FLOAT* baseline
2081  ) PURE;
2082 
2090  STDMETHOD(GetFontCollection)(
2091  __out IDWriteFontCollection** fontCollection
2092  ) PURE;
2093 
2097  STDMETHOD_(UINT32, GetFontFamilyNameLength)() PURE;
2098 
2107  STDMETHOD(GetFontFamilyName)(
2108  __out_ecount_z(nameSize) WCHAR* fontFamilyName,
2109  UINT32 nameSize
2110  ) PURE;
2111 
2115  STDMETHOD_(DWRITE_FONT_WEIGHT, GetFontWeight)() PURE;
2116 
2120  STDMETHOD_(DWRITE_FONT_STYLE, GetFontStyle)() PURE;
2121 
2125  STDMETHOD_(DWRITE_FONT_STRETCH, GetFontStretch)() PURE;
2126 
2130  STDMETHOD_(FLOAT, GetFontSize)() PURE;
2131 
2135  STDMETHOD_(UINT32, GetLocaleNameLength)() PURE;
2136 
2145  STDMETHOD(GetLocaleName)(
2146  __out_ecount_z(nameSize) WCHAR* localeName,
2147  UINT32 nameSize
2148  ) PURE;
2149 };
2150 
2151 
2155 interface DWRITE_DECLARE_INTERFACE("55f1112b-1dc2-4b3c-9541-f46894ed85b6") IDWriteTypography : public IUnknown
2156 {
2164  STDMETHOD(AddFontFeature)(
2165  DWRITE_FONT_FEATURE fontFeature
2166  ) PURE;
2167 
2171  STDMETHOD_(UINT32, GetFontFeatureCount)() PURE;
2172 
2181  STDMETHOD(GetFontFeature)(
2182  UINT32 fontFeatureIndex,
2183  __out DWRITE_FONT_FEATURE* fontFeature
2184  ) PURE;
2185 };
2186 
2187 enum DWRITE_SCRIPT_SHAPES
2188 {
2192  DWRITE_SCRIPT_SHAPES_DEFAULT = 0,
2193 
2197  DWRITE_SCRIPT_SHAPES_NO_VISUAL = 1
2198 };
2199 
2200 #ifdef DEFINE_ENUM_FLAG_OPERATORS
2201 DEFINE_ENUM_FLAG_OPERATORS(DWRITE_SCRIPT_SHAPES);
2202 #endif
2203 
2208 {
2212  UINT16 script;
2213 
2217  DWRITE_SCRIPT_SHAPES shapes;
2218 };
2219 
2224 enum DWRITE_BREAK_CONDITION
2225 {
2230  DWRITE_BREAK_CONDITION_NEUTRAL,
2231 
2237  DWRITE_BREAK_CONDITION_CAN_BREAK,
2238 
2243  DWRITE_BREAK_CONDITION_MAY_NOT_BREAK,
2244 
2249  DWRITE_BREAK_CONDITION_MUST_BREAK
2250 };
2251 
2256 {
2260  UINT8 breakConditionBefore : 2;
2261 
2265  UINT8 breakConditionAfter : 2;
2266 
2271  UINT8 isWhitespace : 1;
2272 
2277  UINT8 isSoftHyphen : 1;
2278 
2279  UINT8 padding : 2;
2280 };
2281 
2285 enum DWRITE_NUMBER_SUBSTITUTION_METHOD
2286 {
2291  DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE,
2292 
2299  DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL,
2300 
2305  DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE,
2306 
2311  DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL,
2312 
2320  DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL
2321 };
2322 
2326 interface DECLSPEC_UUID("14885CC9-BAB0-4f90-B6ED-5C366A2CD03D") DECLSPEC_NOVTABLE IDWriteNumberSubstitution : public IUnknown
2327 {
2328 };
2329 
2334 {
2339  UINT16 isShapedAlone : 1;
2340 
2344  UINT16 reserved : 15;
2345 };
2346 
2351 {
2357  UINT16 justification : 4;
2358 
2362  UINT16 isClusterStart : 1;
2363 
2367  UINT16 isDiacritic : 1;
2368 
2372  UINT16 isZeroWidthSpace : 1;
2373 
2377  UINT16 reserved : 9;
2378 };
2379 
2391 interface DECLSPEC_UUID("688e1a58-5094-47c8-adc8-fbcea60ae92b") DECLSPEC_NOVTABLE IDWriteTextAnalysisSource : public IUnknown
2392 {
2419  STDMETHOD(GetTextAtPosition)(
2420  UINT32 textPosition,
2421  __out WCHAR const** textString,
2422  __out UINT32* textLength
2423  ) PURE;
2424 
2444  STDMETHOD(GetTextBeforePosition)(
2445  UINT32 textPosition,
2446  __out WCHAR const** textString,
2447  __out UINT32* textLength
2448  ) PURE;
2449 
2453  STDMETHOD_(DWRITE_READING_DIRECTION, GetParagraphReadingDirection)() PURE;
2454 
2467  STDMETHOD(GetLocaleName)(
2468  UINT32 textPosition,
2469  __out UINT32* textLength,
2470  __out_z WCHAR const** localeName
2471  ) PURE;
2472 
2487  STDMETHOD(GetNumberSubstitution)(
2488  UINT32 textPosition,
2489  __out UINT32* textLength,
2490  __out IDWriteNumberSubstitution** numberSubstitution
2491  ) PURE;
2492 };
2493 
2500 interface DECLSPEC_UUID("5810cd44-0ca0-4701-b3fa-bec5182ae4f6") DECLSPEC_NOVTABLE IDWriteTextAnalysisSink : public IUnknown
2501 {
2511  STDMETHOD(SetScriptAnalysis)(
2512  UINT32 textPosition,
2513  UINT32 textLength,
2514  __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis
2515  ) PURE;
2516 
2527  STDMETHOD(SetLineBreakpoints)(
2528  UINT32 textPosition,
2529  UINT32 textLength,
2530  __in_ecount(textLength) DWRITE_LINE_BREAKPOINT const* lineBreakpoints
2531  ) PURE;
2532 
2547  STDMETHOD(SetBidiLevel)(
2548  UINT32 textPosition,
2549  UINT32 textLength,
2550  UINT8 explicitLevel,
2551  UINT8 resolvedLevel
2552  ) PURE;
2553 
2571  STDMETHOD(SetNumberSubstitution)(
2572  UINT32 textPosition,
2573  UINT32 textLength,
2574  __notnull IDWriteNumberSubstitution* numberSubstitution
2575  ) PURE;
2576 };
2577 
2581 interface DWRITE_DECLARE_INTERFACE("b7e6163e-7f46-43b4-84b3-e4e6249c365d") IDWriteTextAnalyzer : public IUnknown
2582 {
2595  STDMETHOD(AnalyzeScript)(
2596  IDWriteTextAnalysisSource* analysisSource,
2597  UINT32 textPosition,
2598  UINT32 textLength,
2599  IDWriteTextAnalysisSink* analysisSink
2600  ) PURE;
2601 
2622  STDMETHOD(AnalyzeBidi)(
2623  IDWriteTextAnalysisSource* analysisSource,
2624  UINT32 textPosition,
2625  UINT32 textLength,
2626  IDWriteTextAnalysisSink* analysisSink
2627  ) PURE;
2628 
2650  STDMETHOD(AnalyzeNumberSubstitution)(
2651  IDWriteTextAnalysisSource* analysisSource,
2652  UINT32 textPosition,
2653  UINT32 textLength,
2654  IDWriteTextAnalysisSink* analysisSink
2655  ) PURE;
2656 
2685  STDMETHOD(AnalyzeLineBreakpoints)(
2686  IDWriteTextAnalysisSource* analysisSource,
2687  UINT32 textPosition,
2688  UINT32 textLength,
2689  IDWriteTextAnalysisSink* analysisSink
2690  ) PURE;
2691 
2738  STDMETHOD(GetGlyphs)(
2739  __in_ecount(textLength) WCHAR const* textString,
2740  UINT32 textLength,
2741  IDWriteFontFace* fontFace,
2742  BOOL isSideways,
2743  BOOL isRightToLeft,
2744  __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
2745  __in_z_opt WCHAR const* localeName,
2746  __maybenull IDWriteNumberSubstitution* numberSubstitution,
2747  __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
2748  __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
2749  UINT32 featureRanges,
2750  UINT32 maxGlyphCount,
2751  __out_ecount(textLength) UINT16* clusterMap,
2752  __out_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
2753  __out_ecount(maxGlyphCount) UINT16* glyphIndices,
2754  __out_ecount(maxGlyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES* glyphProps,
2755  __out UINT32* actualGlyphCount
2756  ) PURE;
2757 
2790  STDMETHOD(GetGlyphPlacements)(
2791  __in_ecount(textLength) WCHAR const* textString,
2792  __in_ecount(textLength) UINT16 const* clusterMap,
2793  __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
2794  UINT32 textLength,
2795  __in_ecount(glyphCount) UINT16 const* glyphIndices,
2796  __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps,
2797  UINT32 glyphCount,
2798  IDWriteFontFace * fontFace,
2799  FLOAT fontEmSize,
2800  BOOL isSideways,
2801  BOOL isRightToLeft,
2802  __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
2803  __in_z_opt WCHAR const* localeName,
2804  __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
2805  __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
2806  UINT32 featureRanges,
2807  __out_ecount(glyphCount) FLOAT* glyphAdvances,
2808  __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
2809  ) PURE;
2810 
2852  STDMETHOD(GetGdiCompatibleGlyphPlacements)(
2853  __in_ecount(textLength) WCHAR const* textString,
2854  __in_ecount(textLength) UINT16 const* clusterMap,
2855  __in_ecount(textLength) DWRITE_SHAPING_TEXT_PROPERTIES* textProps,
2856  UINT32 textLength,
2857  __in_ecount(glyphCount) UINT16 const* glyphIndices,
2858  __in_ecount(glyphCount) DWRITE_SHAPING_GLYPH_PROPERTIES const* glyphProps,
2859  UINT32 glyphCount,
2860  IDWriteFontFace * fontFace,
2861  FLOAT fontEmSize,
2862  FLOAT pixelsPerDip,
2863  __in_opt DWRITE_MATRIX const* transform,
2864  BOOL useGdiNatural,
2865  BOOL isSideways,
2866  BOOL isRightToLeft,
2867  __in DWRITE_SCRIPT_ANALYSIS const* scriptAnalysis,
2868  __in_z_opt WCHAR const* localeName,
2869  __in_ecount_opt(featureRanges) DWRITE_TYPOGRAPHIC_FEATURES const** features,
2870  __in_ecount_opt(featureRanges) UINT32 const* featureRangeLengths,
2871  UINT32 featureRanges,
2872  __out_ecount(glyphCount) FLOAT* glyphAdvances,
2873  __out_ecount(glyphCount) DWRITE_GLYPH_OFFSET* glyphOffsets
2874  ) PURE;
2875 };
2876 
2882 {
2886  __notnull IDWriteFontFace* fontFace;
2887 
2891  FLOAT fontEmSize;
2892 
2896  UINT32 glyphCount;
2897 
2901  __field_ecount(glyphCount) UINT16 const* glyphIndices;
2902 
2906  __field_ecount_opt(glyphCount) FLOAT const* glyphAdvances;
2907 
2911  __field_ecount_opt(glyphCount) DWRITE_GLYPH_OFFSET const* glyphOffsets;
2912 
2919  BOOL isSideways;
2920 
2928  UINT32 bidiLevel;
2929 };
2930 
2936 {
2940  __nullterminated WCHAR const* localeName;
2941 
2945  __field_ecount(stringLength) WCHAR const* string;
2946 
2951  UINT32 stringLength;
2952 
2957  __field_ecount(stringLength) UINT16 const* clusterMap;
2958 
2963  UINT32 textPosition;
2964 };
2965 
2971 {
2975  FLOAT width;
2976 
2981  FLOAT thickness;
2982 
2988  FLOAT offset;
2989 
2993  FLOAT runHeight;
2994 
3000  DWRITE_READING_DIRECTION readingDirection;
3001 
3007  DWRITE_FLOW_DIRECTION flowDirection;
3008 
3016  __nullterminated WCHAR const* localeName;
3017 
3023  DWRITE_MEASURING_MODE measuringMode;
3024 };
3025 
3031 {
3035  FLOAT width;
3036 
3041  FLOAT thickness;
3042 
3048  FLOAT offset;
3049 
3055  DWRITE_READING_DIRECTION readingDirection;
3056 
3062  DWRITE_FLOW_DIRECTION flowDirection;
3063 
3067  __nullterminated WCHAR const* localeName;
3068 
3074  DWRITE_MEASURING_MODE measuringMode;
3075 };
3076 
3082 {
3087  UINT32 length;
3088 
3094 
3101 
3105  FLOAT height;
3106 
3110  FLOAT baseline;
3111 
3116 };
3117 
3118 
3123 {
3127  FLOAT width;
3128 
3132  UINT16 length;
3133 
3137  UINT16 canWrapLineAfter : 1;
3138 
3142  UINT16 isWhitespace : 1;
3143 
3147  UINT16 isNewline : 1;
3148 
3152  UINT16 isSoftHyphen : 1;
3153 
3157  UINT16 isRightToLeft : 1;
3158 
3159  UINT16 padding : 11;
3160 };
3161 
3162 
3168 {
3173  FLOAT left;
3174 
3179  FLOAT top;
3180 
3185  FLOAT width;
3186 
3192 
3197  FLOAT height;
3198 
3205 
3211 
3219 
3223  UINT32 lineCount;
3224 };
3225 
3226 
3232 {
3236  FLOAT width;
3237 
3241  FLOAT height;
3242 
3247  FLOAT baseline;
3248 
3254 };
3255 
3256 
3269 {
3273  FLOAT left;
3274 
3278  FLOAT top;
3279 
3283  FLOAT right;
3284 
3288  FLOAT bottom;
3289 };
3290 
3291 
3296 {
3301 
3305  UINT32 length;
3306 
3310  FLOAT left;
3311 
3315  FLOAT top;
3316 
3320  FLOAT width;
3321 
3325  FLOAT height;
3326 
3330  UINT32 bidiLevel;
3331 
3335  BOOL isText;
3336 
3341 };
3342 
3343 
3344 interface IDWriteTextRenderer;
3345 
3346 
3351 interface DWRITE_DECLARE_INTERFACE("8339FDE3-106F-47ab-8373-1C6295EB10B3") IDWriteInlineObject : public IUnknown
3352 {
3368  STDMETHOD(Draw)(
3369  __maybenull void* clientDrawingContext,
3370  IDWriteTextRenderer* renderer,
3371  FLOAT originX,
3372  FLOAT originY,
3373  BOOL isSideways,
3374  BOOL isRightToLeft,
3375  __maybenull IUnknown* clientDrawingEffect
3376  ) PURE;
3377 
3385  STDMETHOD(GetMetrics)(
3386  __out DWRITE_INLINE_OBJECT_METRICS* metrics
3387  ) PURE;
3388 
3405  STDMETHOD(GetOverhangMetrics)(
3406  __out DWRITE_OVERHANG_METRICS* overhangs
3407  ) PURE;
3408 
3418  STDMETHOD(GetBreakConditions)(
3419  __out DWRITE_BREAK_CONDITION* breakConditionBefore,
3420  __out DWRITE_BREAK_CONDITION* breakConditionAfter
3421  ) PURE;
3422 };
3423 
3427 interface DWRITE_DECLARE_INTERFACE("eaf3a2da-ecf4-4d24-b644-b34f6842024b") IDWritePixelSnapping : public IUnknown
3428 {
3438  STDMETHOD(IsPixelSnappingDisabled)(
3439  __maybenull void* clientDrawingContext,
3440  __out BOOL* isDisabled
3441  ) PURE;
3442 
3452  STDMETHOD(GetCurrentTransform)(
3453  __maybenull void* clientDrawingContext,
3454  __out DWRITE_MATRIX* transform
3455  ) PURE;
3456 
3467  STDMETHOD(GetPixelsPerDip)(
3468  __maybenull void* clientDrawingContext,
3469  __out FLOAT* pixelsPerDip
3470  ) PURE;
3471 };
3472 
3478 interface DWRITE_DECLARE_INTERFACE("ef8a8135-5cc6-45fe-8825-c5a0724eb819") IDWriteTextRenderer : public IDWritePixelSnapping
3479 {
3503  STDMETHOD(DrawGlyphRun)(
3504  __maybenull void* clientDrawingContext,
3505  FLOAT baselineOriginX,
3506  FLOAT baselineOriginY,
3507  DWRITE_MEASURING_MODE measuringMode,
3508  __in DWRITE_GLYPH_RUN const* glyphRun,
3509  __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
3510  __maybenull IUnknown* clientDrawingEffect
3511  ) PURE;
3512 
3540  STDMETHOD(DrawUnderline)(
3541  __maybenull void* clientDrawingContext,
3542  FLOAT baselineOriginX,
3543  FLOAT baselineOriginY,
3544  __in DWRITE_UNDERLINE const* underline,
3545  __maybenull IUnknown* clientDrawingEffect
3546  ) PURE;
3547 
3571  STDMETHOD(DrawStrikethrough)(
3572  __maybenull void* clientDrawingContext,
3573  FLOAT baselineOriginX,
3574  FLOAT baselineOriginY,
3575  __in DWRITE_STRIKETHROUGH const* strikethrough,
3576  __maybenull IUnknown* clientDrawingEffect
3577  ) PURE;
3578 
3599  STDMETHOD(DrawInlineObject)(
3600  __maybenull void* clientDrawingContext,
3601  FLOAT originX,
3602  FLOAT originY,
3603  IDWriteInlineObject* inlineObject,
3604  BOOL isSideways,
3605  BOOL isRightToLeft,
3606  __maybenull IUnknown* clientDrawingEffect
3607  ) PURE;
3608 };
3609 
3616 interface DWRITE_DECLARE_INTERFACE("53737037-6d14-410b-9bfe-0b182bb70961") IDWriteTextLayout : public IDWriteTextFormat
3617 {
3625  STDMETHOD(SetMaxWidth)(
3626  FLOAT maxWidth
3627  ) PURE;
3628 
3636  STDMETHOD(SetMaxHeight)(
3637  FLOAT maxHeight
3638  ) PURE;
3639 
3648  STDMETHOD(SetFontCollection)(
3649  IDWriteFontCollection* fontCollection,
3650  DWRITE_TEXT_RANGE textRange
3651  ) PURE;
3652 
3661  STDMETHOD(SetFontFamilyName)(
3662  __in_z WCHAR const* fontFamilyName,
3663  DWRITE_TEXT_RANGE textRange
3664  ) PURE;
3665 
3674  STDMETHOD(SetFontWeight)(
3675  DWRITE_FONT_WEIGHT fontWeight,
3676  DWRITE_TEXT_RANGE textRange
3677  ) PURE;
3678 
3687  STDMETHOD(SetFontStyle)(
3688  DWRITE_FONT_STYLE fontStyle,
3689  DWRITE_TEXT_RANGE textRange
3690  ) PURE;
3691 
3700  STDMETHOD(SetFontStretch)(
3701  DWRITE_FONT_STRETCH fontStretch,
3702  DWRITE_TEXT_RANGE textRange
3703  ) PURE;
3704 
3713  STDMETHOD(SetFontSize)(
3714  FLOAT fontSize,
3715  DWRITE_TEXT_RANGE textRange
3716  ) PURE;
3717 
3726  STDMETHOD(SetUnderline)(
3727  BOOL hasUnderline,
3728  DWRITE_TEXT_RANGE textRange
3729  ) PURE;
3730 
3739  STDMETHOD(SetStrikethrough)(
3740  BOOL hasStrikethrough,
3741  DWRITE_TEXT_RANGE textRange
3742  ) PURE;
3743 
3756  STDMETHOD(SetDrawingEffect)(
3757  IUnknown* drawingEffect,
3758  DWRITE_TEXT_RANGE textRange
3759  ) PURE;
3760 
3774  STDMETHOD(SetInlineObject)(
3775  IDWriteInlineObject* inlineObject,
3776  DWRITE_TEXT_RANGE textRange
3777  ) PURE;
3778 
3787  STDMETHOD(SetTypography)(
3788  IDWriteTypography* typography,
3789  DWRITE_TEXT_RANGE textRange
3790  ) PURE;
3791 
3800  STDMETHOD(SetLocaleName)(
3801  __in_z WCHAR const* localeName,
3802  DWRITE_TEXT_RANGE textRange
3803  ) PURE;
3804 
3808  STDMETHOD_(FLOAT, GetMaxWidth)() PURE;
3809 
3813  STDMETHOD_(FLOAT, GetMaxHeight)() PURE;
3814 
3824  STDMETHOD(GetFontCollection)(
3825  UINT32 currentPosition,
3826  __out IDWriteFontCollection** fontCollection,
3827  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3828  ) PURE;
3829 
3839  STDMETHOD(GetFontFamilyNameLength)(
3840  UINT32 currentPosition,
3841  __out UINT32* nameLength,
3842  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3843  ) PURE;
3844 
3855  STDMETHOD(GetFontFamilyName)(
3856  UINT32 currentPosition,
3857  __out_ecount_z(nameSize) WCHAR* fontFamilyName,
3858  UINT32 nameSize,
3859  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3860  ) PURE;
3861 
3871  STDMETHOD(GetFontWeight)(
3872  UINT32 currentPosition,
3873  __out DWRITE_FONT_WEIGHT* fontWeight,
3874  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3875  ) PURE;
3876 
3886  STDMETHOD(GetFontStyle)(
3887  UINT32 currentPosition,
3888  __out DWRITE_FONT_STYLE* fontStyle,
3889  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3890  ) PURE;
3891 
3901  STDMETHOD(GetFontStretch)(
3902  UINT32 currentPosition,
3903  __out DWRITE_FONT_STRETCH* fontStretch,
3904  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3905  ) PURE;
3906 
3916  STDMETHOD(GetFontSize)(
3917  UINT32 currentPosition,
3918  __out FLOAT* fontSize,
3919  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3920  ) PURE;
3921 
3931  STDMETHOD(GetUnderline)(
3932  UINT32 currentPosition,
3933  __out BOOL* hasUnderline,
3934  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3935  ) PURE;
3936 
3946  STDMETHOD(GetStrikethrough)(
3947  UINT32 currentPosition,
3948  __out BOOL* hasStrikethrough,
3949  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3950  ) PURE;
3951 
3961  STDMETHOD(GetDrawingEffect)(
3962  UINT32 currentPosition,
3963  __out IUnknown** drawingEffect,
3964  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3965  ) PURE;
3966 
3976  STDMETHOD(GetInlineObject)(
3977  UINT32 currentPosition,
3978  __out IDWriteInlineObject** inlineObject,
3979  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3980  ) PURE;
3981 
3991  STDMETHOD(GetTypography)(
3992  UINT32 currentPosition,
3993  __out IDWriteTypography** typography,
3994  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
3995  ) PURE;
3996 
4006  STDMETHOD(GetLocaleNameLength)(
4007  UINT32 currentPosition,
4008  __out UINT32* nameLength,
4009  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
4010  ) PURE;
4011 
4022  STDMETHOD(GetLocaleName)(
4023  UINT32 currentPosition,
4024  __out_ecount_z(nameSize) WCHAR* localeName,
4025  UINT32 nameSize,
4026  __out_opt DWRITE_TEXT_RANGE* textRange = NULL
4027  ) PURE;
4028 
4041  STDMETHOD(Draw)(
4042  __maybenull void* clientDrawingContext,
4043  IDWriteTextRenderer* renderer,
4044  FLOAT originX,
4045  FLOAT originY
4046  ) PURE;
4047 
4064  STDMETHOD(GetLineMetrics)(
4065  __out_ecount_opt(maxLineCount) DWRITE_LINE_METRICS* lineMetrics,
4066  UINT32 maxLineCount,
4067  __out UINT32* actualLineCount
4068  ) PURE;
4069 
4083  STDMETHOD(GetMetrics)(
4084  __out DWRITE_TEXT_METRICS* textMetrics
4085  ) PURE;
4086 
4100  STDMETHOD(GetOverhangMetrics)(
4101  __out DWRITE_OVERHANG_METRICS* overhangs
4102  ) PURE;
4103 
4119  STDMETHOD(GetClusterMetrics)(
4120  __out_ecount_opt(maxClusterCount) DWRITE_CLUSTER_METRICS* clusterMetrics,
4121  UINT32 maxClusterCount,
4122  __out UINT32* actualClusterCount
4123  ) PURE;
4124 
4133  STDMETHOD(DetermineMinWidth)(
4134  __out FLOAT* minWidth
4135  ) PURE;
4136 
4157  STDMETHOD(HitTestPoint)(
4158  FLOAT pointX,
4159  FLOAT pointY,
4160  __out BOOL* isTrailingHit,
4161  __out BOOL* isInside,
4162  __out DWRITE_HIT_TEST_METRICS* hitTestMetrics
4163  ) PURE;
4164 
4192  STDMETHOD(HitTestTextPosition)(
4193  UINT32 textPosition,
4194  BOOL isTrailingHit,
4195  __out FLOAT* pointX,
4196  __out FLOAT* pointY,
4197  __out DWRITE_HIT_TEST_METRICS* hitTestMetrics
4198  ) PURE;
4199 
4240  STDMETHOD(HitTestTextRange)(
4241  UINT32 textPosition,
4242  UINT32 textLength,
4243  FLOAT originX,
4244  FLOAT originY,
4245  __out_ecount_opt(maxHitTestMetricsCount) DWRITE_HIT_TEST_METRICS* hitTestMetrics,
4246  UINT32 maxHitTestMetricsCount,
4247  __out UINT32* actualHitTestMetricsCount
4248  ) PURE;
4249 };
4250 
4254 interface DWRITE_DECLARE_INTERFACE("5e5a32a3-8dff-4773-9ff6-0696eab77267") IDWriteBitmapRenderTarget : public IUnknown
4255 {
4275  STDMETHOD(DrawGlyphRun)(
4276  FLOAT baselineOriginX,
4277  FLOAT baselineOriginY,
4278  DWRITE_MEASURING_MODE measuringMode,
4279  __in DWRITE_GLYPH_RUN const* glyphRun,
4280  IDWriteRenderingParams* renderingParams,
4281  COLORREF textColor,
4282  __out_opt RECT* blackBoxRect = NULL
4283  ) PURE;
4284 
4297  STDMETHOD_(HDC, GetMemoryDC)() PURE;
4298 
4306  STDMETHOD_(FLOAT, GetPixelsPerDip)() PURE;
4307 
4316  STDMETHOD(SetPixelsPerDip)(
4317  FLOAT pixelsPerDip
4318  ) PURE;
4319 
4329  STDMETHOD(GetCurrentTransform)(
4330  __out DWRITE_MATRIX* transform
4331  ) PURE;
4332 
4342  STDMETHOD(SetCurrentTransform)(
4343  __in_opt DWRITE_MATRIX const* transform
4344  ) PURE;
4345 
4353  STDMETHOD(GetSize)(
4354  __out SIZE* size
4355  ) PURE;
4356 
4365  STDMETHOD(Resize)(
4366  UINT32 width,
4367  UINT32 height
4368  ) PURE;
4369 };
4370 
4374 interface DWRITE_DECLARE_INTERFACE("1edd9491-9853-4299-898f-6432983b6f3a") IDWriteGdiInterop : public IUnknown
4375 {
4384  STDMETHOD(CreateFontFromLOGFONT)(
4385  __in LOGFONTW const* logFont,
4386  __out IDWriteFont** font
4387  ) PURE;
4388 
4399  STDMETHOD(ConvertFontToLOGFONT)(
4400  IDWriteFont* font,
4401  __out LOGFONTW* logFont,
4402  __out BOOL* isSystemFont
4403  ) PURE;
4404 
4413  STDMETHOD(ConvertFontFaceToLOGFONT)(
4414  IDWriteFontFace* font,
4415  __out LOGFONTW* logFont
4416  ) PURE;
4417 
4428  STDMETHOD(CreateFontFaceFromHdc)(
4429  HDC hdc,
4430  __out IDWriteFontFace** fontFace
4431  ) PURE;
4432 
4440  STDMETHOD(CreateBitmapRenderTarget)(
4441  __in_opt HDC hdc,
4442  UINT32 width,
4443  UINT32 height,
4444  __out IDWriteBitmapRenderTarget** renderTarget
4445  ) PURE;
4446 };
4447 
4452 enum DWRITE_TEXTURE_TYPE
4453 {
4458  DWRITE_TEXTURE_ALIASED_1x1,
4459 
4464  DWRITE_TEXTURE_CLEARTYPE_3x1
4465 };
4466 
4470 #define DWRITE_ALPHA_MAX 255
4471 
4475 interface DWRITE_DECLARE_INTERFACE("7d97dbf7-e085-42d4-81e3-6a883bded118") IDWriteGlyphRunAnalysis : public IUnknown
4476 {
4488  STDMETHOD(GetAlphaTextureBounds)(
4489  DWRITE_TEXTURE_TYPE textureType,
4490  __out RECT* textureBounds
4491  ) PURE;
4492 
4506  STDMETHOD(CreateAlphaTexture)(
4507  DWRITE_TEXTURE_TYPE textureType,
4508  __in RECT const* textureBounds,
4509  __out_bcount(bufferSize) BYTE* alphaValues,
4510  UINT32 bufferSize
4511  ) PURE;
4512 
4522  STDMETHOD(GetAlphaBlendParams)(
4523  IDWriteRenderingParams* renderingParams,
4524  __out FLOAT* blendGamma,
4525  __out FLOAT* blendEnhancedContrast,
4526  __out FLOAT* blendClearTypeLevel
4527  ) PURE;
4528 };
4529 
4533 interface DWRITE_DECLARE_INTERFACE("b859ee5a-d838-4b5b-a2e8-1adc7d93db48") IDWriteFactory : public IUnknown
4534 {
4546  STDMETHOD(GetSystemFontCollection)(
4547  __out IDWriteFontCollection** fontCollection,
4548  BOOL checkForUpdates = FALSE
4549  ) PURE;
4550 
4562  STDMETHOD(CreateCustomFontCollection)(
4563  IDWriteFontCollectionLoader* collectionLoader,
4564  __in_bcount(collectionKeySize) void const* collectionKey,
4565  UINT32 collectionKeySize,
4566  __out IDWriteFontCollection** fontCollection
4567  ) PURE;
4568 
4576  STDMETHOD(RegisterFontCollectionLoader)(
4577  IDWriteFontCollectionLoader* fontCollectionLoader
4578  ) PURE;
4579 
4587  STDMETHOD(UnregisterFontCollectionLoader)(
4588  IDWriteFontCollectionLoader* fontCollectionLoader
4589  ) PURE;
4590 
4604  STDMETHOD(CreateFontFileReference)(
4605  __in_z WCHAR const* filePath,
4606  __in_opt FILETIME const* lastWriteTime,
4607  __out IDWriteFontFile** fontFile
4608  ) PURE;
4609 
4629  STDMETHOD(CreateCustomFontFileReference)(
4630  __in_bcount(fontFileReferenceKeySize) void const* fontFileReferenceKey,
4631  UINT32 fontFileReferenceKeySize,
4632  IDWriteFontFileLoader* fontFileLoader,
4633  __out IDWriteFontFile** fontFile
4634  ) PURE;
4635 
4650  STDMETHOD(CreateFontFace)(
4651  DWRITE_FONT_FACE_TYPE fontFaceType,
4652  UINT32 numberOfFiles,
4653  __in_ecount(numberOfFiles) IDWriteFontFile* const* fontFiles,
4654  UINT32 faceIndex,
4655  DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags,
4656  __out IDWriteFontFace** fontFace
4657  ) PURE;
4658 
4666  STDMETHOD(CreateRenderingParams)(
4667  __out IDWriteRenderingParams** renderingParams
4668  ) PURE;
4669 
4678  STDMETHOD(CreateMonitorRenderingParams)(
4679  HMONITOR monitor,
4680  __out IDWriteRenderingParams** renderingParams
4681  ) PURE;
4682 
4695  STDMETHOD(CreateCustomRenderingParams)(
4696  FLOAT gamma,
4697  FLOAT enhancedContrast,
4698  FLOAT clearTypeLevel,
4699  DWRITE_PIXEL_GEOMETRY pixelGeometry,
4700  DWRITE_RENDERING_MODE renderingMode,
4701  __out IDWriteRenderingParams** renderingParams
4702  ) PURE;
4703 
4723  STDMETHOD(RegisterFontFileLoader)(
4724  IDWriteFontFileLoader* fontFileLoader
4725  ) PURE;
4726 
4745  STDMETHOD(UnregisterFontFileLoader)(
4746  IDWriteFontFileLoader* fontFileLoader
4747  ) PURE;
4748 
4763  STDMETHOD(CreateTextFormat)(
4764  __in_z WCHAR const* fontFamilyName,
4765  __maybenull IDWriteFontCollection* fontCollection,
4766  DWRITE_FONT_WEIGHT fontWeight,
4767  DWRITE_FONT_STYLE fontStyle,
4768  DWRITE_FONT_STRETCH fontStretch,
4769  FLOAT fontSize,
4770  __in_z WCHAR const* localeName,
4771  __out IDWriteTextFormat** textFormat
4772  ) PURE;
4773 
4781  STDMETHOD(CreateTypography)(
4782  __out IDWriteTypography** typography
4783  ) PURE;
4784 
4792  STDMETHOD(GetGdiInterop)(
4793  __out IDWriteGdiInterop** gdiInterop
4794  ) PURE;
4795 
4810  STDMETHOD(CreateTextLayout)(
4811  __in_ecount(stringLength) WCHAR const* string,
4812  UINT32 stringLength,
4813  IDWriteTextFormat* textFormat,
4814  FLOAT maxWidth,
4815  FLOAT maxHeight,
4816  __out IDWriteTextLayout** textLayout
4817  ) PURE;
4818 
4843  STDMETHOD(CreateGdiCompatibleTextLayout)(
4844  __in_ecount(stringLength) WCHAR const* string,
4845  UINT32 stringLength,
4846  IDWriteTextFormat* textFormat,
4847  FLOAT layoutWidth,
4848  FLOAT layoutHeight,
4849  FLOAT pixelsPerDip,
4850  __in_opt DWRITE_MATRIX const* transform,
4851  BOOL useGdiNatural,
4852  __out IDWriteTextLayout** textLayout
4853  ) PURE;
4854 
4865  STDMETHOD(CreateEllipsisTrimmingSign)(
4866  IDWriteTextFormat* textFormat,
4867  __out IDWriteInlineObject** trimmingSign
4868  ) PURE;
4869 
4877  STDMETHOD(CreateTextAnalyzer)(
4878  __out IDWriteTextAnalyzer** textAnalyzer
4879  ) PURE;
4880 
4890  STDMETHOD(CreateNumberSubstitution)(
4891  __in DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod,
4892  __in_z WCHAR const* localeName,
4893  __in BOOL ignoreUserOverride,
4894  __out IDWriteNumberSubstitution** numberSubstitution
4895  ) PURE;
4896 
4915  STDMETHOD(CreateGlyphRunAnalysis)(
4916  __in DWRITE_GLYPH_RUN const* glyphRun,
4917  FLOAT pixelsPerDip,
4918  __in_opt DWRITE_MATRIX const* transform,
4919  DWRITE_RENDERING_MODE renderingMode,
4920  DWRITE_MEASURING_MODE measuringMode,
4921  FLOAT baselineOriginX,
4922  FLOAT baselineOriginY,
4923  __out IDWriteGlyphRunAnalysis** glyphRunAnalysis
4924  ) PURE;
4925 
4926 }; // interface IDWriteFactory
4927 
4947 EXTERN_C HRESULT DWRITE_EXPORT DWriteCreateFactory(
4948  __in DWRITE_FACTORY_TYPE factoryType,
4949  __in REFIID iid,
4950  __out IUnknown **factory
4951  );
4952 
4953 // Macros used to define DirectWrite error codes.
4954 #define FACILITY_DWRITE 0x898
4955 #define DWRITE_ERR_BASE 0x5000
4956 #define MAKE_DWRITE_HR(severity, code) MAKE_HRESULT(severity, FACILITY_DWRITE, (DWRITE_ERR_BASE + code))
4957 #define MAKE_DWRITE_HR_ERR(code) MAKE_DWRITE_HR(SEVERITY_ERROR, code)
4958 
4962 #define DWRITE_E_FILEFORMAT MAKE_DWRITE_HR_ERR(0x000)
4963 
4967 #define DWRITE_E_UNEXPECTED MAKE_DWRITE_HR_ERR(0x001)
4968 
4972 #define DWRITE_E_NOFONT MAKE_DWRITE_HR_ERR(0x002)
4973 
4978 #define DWRITE_E_FILENOTFOUND MAKE_DWRITE_HR_ERR(0x003)
4979 
4983 #define DWRITE_E_FILEACCESS MAKE_DWRITE_HR_ERR(0x004)
4984 
4988 #define DWRITE_E_FONTCOLLECTIONOBSOLETE MAKE_DWRITE_HR_ERR(0x005)
4989 
4993 #define DWRITE_E_ALREADYREGISTERED MAKE_DWRITE_HR_ERR(0x006)
4994 
4995 #endif /* DWRITE_H_INCLUDED */
FLOAT top
Top-most point of formatted text relative to layout box (excluding any glyph overhang).
Definition: DWrite.h:3179
UINT16 script
Zero-based index representation of writing system script.
Definition: DWrite.h:2212
UINT16 ascent
Ascent value of the font face in font design units.
Definition: DWrite.h:433
DWRITE_MEASURING_MODE measuringMode
The measuring mode can be useful to the renderer to determine how underlines are rendered, e.g.
Definition: DWrite.h:3074
UINT16 length
The number of text positions in the cluster.
Definition: DWrite.h:3132
FLOAT fontEmSize
Logical size of the font in DIPs, not points (equals 1/96 inch).
Definition: DWrite.h:2891
FLOAT baseline
Distance from the top of the object to the baseline where it is lined up with the adjacent text...
Definition: DWrite.h:3247
The DWRITE_CLUSTER_METRICS structure contains information about a glyph cluster.
Definition: DWrite.h:3122
INT32 topSideBearing
Specifies the vertical offset from the vertical origin to the top of the black box.
Definition: DWrite.h:516
UINT16 capHeight
Cap height value of the font face in font design units.
Definition: DWrite.h:455
DWRITE_FONT_FEATURE_TAG nameTag
The feature OpenType name identifier.
Definition: DWrite.h:1857
UINT32 lineCount
Total number of lines.
Definition: DWrite.h:3223
Holds the appropriate digits and numeric punctuation for a given locale.
Definition: DWrite.h:2333
The DWRITE_TEXT_RANGE structure specifies a range of text positions where format is applied...
Definition: DWrite.h:1836
UINT16 xHeight
x-height value of the font face in font design units.
Definition: DWrite.h:461
INT32 rightSideBearing
Specifies the X offset from the right edge of the black box to the origin of the next glyph when writ...
Definition: DWrite.h:510
__nullterminated WCHAR const * localeName
Locale of the text the underline is being drawn under.
Definition: DWrite.h:3016
FLOAT height
Geometry&#39;s height.
Definition: DWrite.h:3325
FLOAT offset
Offset of the stikethrough from the baseline.
Definition: DWrite.h:3048
FLOAT width
Width of the strikethrough, measured parallel to the baseline.
Definition: DWrite.h:3035
__nullterminated WCHAR const * localeName
Locale of the range.
Definition: DWrite.h:3067
DWRITE_MEASURING_MODE measuringMode
The measuring mode can be useful to the renderer to determine how underlines are rendered, e.g.
Definition: DWrite.h:3023
UINT32 advanceWidth
Specifies the X offset from the origin of the current glyph to the origin of the next glyph when writ...
Definition: DWrite.h:504
FLOAT left
The distance from the left-most visible DIP to its left alignment edge.
Definition: DWrite.h:3273
UINT16 underlineThickness
The suggested underline thickness value of the font face in font design units.
Definition: DWrite.h:473
FLOAT baseline
Distance from the top of the line to its baseline.
Definition: DWrite.h:3110
__nullterminated WCHAR const * localeName
The locale name associated with this run.
Definition: DWrite.h:2940
INT16 lineGap
Line gap in font design units.
Definition: DWrite.h:448
FLOAT width
Width of the inline object.
Definition: DWrite.h:3236
FLOAT thickness
Thickness of the strikethrough, measured perpendicular to the baseline.
Definition: DWrite.h:3041
FLOAT ascenderOffset
Offset in the ascent direction, i.e., the direction ascenders point.
Definition: DWrite.h:557
FLOAT m11
Horizontal scaling / cosine of rotation
Definition: DWrite.h:896
BOOL isTrimmed
The line is trimmed.
Definition: DWrite.h:3115
INT32 verticalOriginY
Specifies the Y coordinate of a glyph&#39;s vertical origin, in the font&#39;s design coordinate system...
Definition: DWrite.h:538
FLOAT thickness
Thickness of the underline, measured perpendicular to the baseline.
Definition: DWrite.h:2981
FLOAT runHeight
Height of the tallest run where the underline applies.
Definition: DWrite.h:2993
The DWRITE_MATRIX structure specifies the graphics transform to be applied to rendered glyphs...
Definition: DWrite.h:891
UINT32 bidiLevel
Bidi level of text positions enclosed within the geometry.
Definition: DWrite.h:3330
FLOAT layoutHeight
Initial height given to the layout.
Definition: DWrite.h:3210
BOOL isText
Geometry encloses text?
Definition: DWrite.h:3335
FLOAT layoutWidth
Initial width given to the layout.
Definition: DWrite.h:3204
UINT16 descent
Descent value of the font face in font design units.
Definition: DWrite.h:439
FLOAT height
Height of the line as measured from top to bottom.
Definition: DWrite.h:3105
The DWRITE_GLYPH_RUN_DESCRIPTION structure contains additional properties related to those in DWRITE_...
Definition: DWrite.h:2935
__notnull IDWriteFontFace * fontFace
The physical font face to draw with.
Definition: DWrite.h:2886
Defines a set of typographic features to be applied during shaping.
Definition: DWrite.h:1874
INT32 leftSideBearing
Specifies the X offset from the glyph origin to the left edge of the black box.
Definition: DWrite.h:499
UINT32 delimiter
Character code used as the delimiter signaling the beginning of the portion of text to be preserved...
Definition: DWrite.h:1901
UINT16 strikethroughThickness
The suggested strikethrough thickness value of the font face in font design units.
Definition: DWrite.h:485
The DWRITE_LINE_METRICS structure contains information about a formatted line of text.
Definition: DWrite.h:3081
FLOAT m21
Horizontal shear / negative sine of rotation
Definition: DWrite.h:906
Overall metrics associated with text after layout.
Definition: DWrite.h:3167
The interface implemented by the text analyzer&#39;s client to provide text to the analyzer.
Definition: DWrite.h:2881
FLOAT bottom
The distance from the bottom-most visible DIP to its bottom alignment edge.
Definition: DWrite.h:3288
FLOAT height
Height of the inline object as measured from top to bottom.
Definition: DWrite.h:3241
FLOAT right
The distance from the right-most visible DIP to its right alignment edge.
Definition: DWrite.h:3283
UINT32 textPosition
First text position within the geometry.
Definition: DWrite.h:3300
FLOAT left
Left-most point of formatted text relative to layout box (excluding any glyph overhang).
Definition: DWrite.h:3173
DWRITE_FLOW_DIRECTION flowDirection
Flow direction of the text associated with the underline.
Definition: DWrite.h:3007
UINT32 maxBidiReorderingDepth
The maximum reordering count of any line of text, used to calculate the most number of hit-testing bo...
Definition: DWrite.h:3218
FLOAT m22
Vertical scaling / cosine of rotation
Definition: DWrite.h:911
The DWRITE_OVERHANG_METRICS structure holds how much any visible pixels (in DIPs) overshoot each side...
Definition: DWrite.h:3268
Line breakpoint characteristics of a character.
Definition: DWrite.h:2255
FLOAT advanceOffset
Offset in the advance direction of the run.
Definition: DWrite.h:551
FLOAT top
The distance from the top-most visible DIP to its top alignment edge.
Definition: DWrite.h:3278
BOOL supportsSideways
Flag indicating whether the object is to be placed upright or alongside the text baseline for vertica...
Definition: DWrite.h:3253
FLOAT width
Geometry&#39;s width.
Definition: DWrite.h:3320
UINT32 startPosition
The start text position of the range.
Definition: DWrite.h:1841
Optional adjustment to a glyph&#39;s position.
Definition: DWrite.h:545
The DWRITE_FONT_FEATURE structure specifies properties used to identify and execute typographic featu...
Definition: DWrite.h:1852
FLOAT left
Left position of the top-left coordinate of the geometry.
Definition: DWrite.h:3310
UINT32 trailingWhitespaceLength
The number of whitespace positions at the end of the line.
Definition: DWrite.h:3093
DWRITE_READING_DIRECTION readingDirection
Reading direction of the text associated with the underline.
Definition: DWrite.h:3000
UINT32 parameter
Execution parameter of the feature.
Definition: DWrite.h:1866
INT16 strikethroughPosition
The strikethrough position value of the font face in font design units.
Definition: DWrite.h:480
Geometry enclosing of text positions.
Definition: DWrite.h:3295
UINT32 length
The number of text positions in the range.
Definition: DWrite.h:1846
The DWRITE_STRIKETHROUGH structure contains about the size and placement of strickthroughs.
Definition: DWrite.h:3030
The DWRITE_UNDERLINE structure contains about the size and placement of underlines.
Definition: DWrite.h:2970
UINT32 delimiterCount
How many occurences of the delimiter to step back.
Definition: DWrite.h:1906
INT32 bottomSideBearing
Specifies the vertical distance from the black box&#39;s bottom edge to the advance height.
Definition: DWrite.h:531
UINT16 designUnitsPerEm
The number of font design units per em unit.
Definition: DWrite.h:427
INT16 underlinePosition
The underline position value of the font face in font design units.
Definition: DWrite.h:468
Properties describing the geometric measurement of an application-defined inline object.
Definition: DWrite.h:3231
FLOAT height
The height of the formatted text.
Definition: DWrite.h:3197
The DWRITE_GLYPH_METRICS structure specifies the metrics of an individual glyph.
Definition: DWrite.h:492
Shaping output properties per output glyph.
Definition: DWrite.h:2350
DWRITE_READING_DIRECTION readingDirection
Reading direction of the text associated with the strikethrough.
Definition: DWrite.h:3055
BOOL isTrimmed
Range is trimmed.
Definition: DWrite.h:3340
FLOAT width
Width of the underline, measured parallel to the baseline.
Definition: DWrite.h:2975
DWRITE_FLOW_DIRECTION flowDirection
Flow direction of the text associated with the strikethrough.
Definition: DWrite.h:3062
FLOAT m12
Vertical shear / sine of rotation
Definition: DWrite.h:901
Association of text and its writing system script as well as some display attributes.
Definition: DWrite.h:2207
FLOAT dx
Horizontal shift (always orthogonal regardless of rotation)
Definition: DWrite.h:916
FLOAT widthIncludingTrailingWhitespace
The width of the formatted text taking into account the trailing whitespace at the end of each line...
Definition: DWrite.h:3191
UINT32 length
Number of text positions within the geometry.
Definition: DWrite.h:3305
UINT32 featureCount
The number of features.
Definition: DWrite.h:1884
FLOAT width
The width of the formatted text ignoring trailing whitespace at the end of each line.
Definition: DWrite.h:3185
FLOAT width
The total advance width of all glyphs in the cluster.
Definition: DWrite.h:3127
UINT32 glyphCount
The number of glyphs.
Definition: DWrite.h:2896
DWRITE_SCRIPT_SHAPES shapes
Additional shaping requirement of text.
Definition: DWrite.h:2217
The DWRITE_FONT_METRICS structure specifies the metrics of a font face that are applicable to all gly...
Definition: DWrite.h:417
FLOAT dy
Vertical shift (always orthogonal regardless of rotation)
Definition: DWrite.h:921
UINT32 newlineLength
The number of characters in the newline sequence at the end of the line.
Definition: DWrite.h:3100
DWRITE_TRIMMING_GRANULARITY granularity
Text granularity of which trimming applies.
Definition: DWrite.h:1895
UINT32 advanceHeight
Specifies the Y offset from the vertical origin of the current glyph to the vertical origin of the ne...
Definition: DWrite.h:524
FLOAT top
Top position of the top-left coordinate of the geometry.
Definition: DWrite.h:3315
FLOAT offset
Offset of the underline from the baseline.
Definition: DWrite.h:2988
The DWRITE_TRIMMING structure specifies the trimming option for text overflowing the layout box...
Definition: DWrite.h:1890
UINT32 length
The number of total text positions in the line.
Definition: DWrite.h:3087