1 module aurora.directx.dwrite.dwrite_3; 2 3 version(Windows): 4 5 public import aurora.directx.com; 6 public import aurora.directx.dwrite.dwrite_2; 7 8 public: 9 10 /// 11 /// Constants 12 /// 13 14 alias DWRITE_MAKE_OPENTYPE_TAG DWRITE_MAKE_FONT_AXIS_TAG; 15 16 enum DWRITE_E_REMOTEFONT = 0x8898500DL; 17 enum DWRITE_E_DOWNLOADCANCELLED = 0x8898500EL; 18 enum DWRITE_E_DOWNLOADFAILED = 0x8898500FL; 19 enum DWRITE_E_TOOMANYDOWNLOADS = 0x88985010L; 20 21 /// 22 /// Functions 23 /// 24 25 /// 26 /// Enumerations 27 /// 28 29 enum DWRITE_FONT_PROPERTY_ID : int 30 { 31 NONE, 32 WEIGHT_STRETCH_STYLE_FAMILY_NAME, 33 TYPOGRAPHIC_FAMILY_NAME, 34 WEIGHT_STRETCH_STYLE_FACE_NAME, 35 FULL_NAME, 36 WIN32_FAMILY_NAME, 37 POSTSCRIPT_NAME, 38 DESIGN_SCRIPT_LANGUAGE_TAG, 39 SUPPORTED_SCRIPT_LANGUAGE_TAG, 40 SEMANTIC_TAG, 41 WEIGHT, 42 STRETCH, 43 STYLE, 44 TYPOGRAPHIC_FACE_NAME, 45 TOTAL = STYLE + 1, 46 TOTAL_RS3 = TYPOGRAPHIC_FACE_NAME + 1, 47 48 // Obsolete aliases kept to avoid breaking existing code. 49 PREFERRED_FAMILY_NAME = TYPOGRAPHIC_FAMILY_NAME, 50 FAMILY_NAME = WEIGHT_STRETCH_STYLE_FAMILY_NAME, 51 FACE_NAME = WEIGHT_STRETCH_STYLE_FACE_NAME, 52 } 53 54 enum DWRITE_LOCALITY : int 55 { 56 REMOTE, 57 PARTIAL, 58 LOCAL, 59 } 60 61 enum DWRITE_RENDERING_MODE1 : int 62 { 63 DEFAULT = DWRITE_RENDERING_MODE.DEFAULT, 64 ALIASED = DWRITE_RENDERING_MODE.ALIASED, 65 GDI_CLASSIC = DWRITE_RENDERING_MODE.GDI_CLASSIC, 66 GDI_NATURAL = DWRITE_RENDERING_MODE.GDI_NATURAL, 67 NATURAL = DWRITE_RENDERING_MODE.NATURAL, 68 NATURAL_SYMMETRIC = DWRITE_RENDERING_MODE.NATURAL_SYMMETRIC, 69 OUTLINE = DWRITE_RENDERING_MODE.OUTLINE, 70 NATURAL_SYMMETRIC_DOWNSAMPLED, 71 } 72 73 enum DWRITE_FONT_LINE_GAP_USAGE : int 74 { 75 DEFAULT, 76 DISABLED, 77 ENABLED 78 } 79 80 enum DWRITE_CONTAINER_TYPE : int 81 { 82 UNKNOWN, 83 WOFF, 84 WOFF2 85 } 86 87 enum DWRITE_FONT_AXIS_TAG : uint 88 { 89 WEIGHT = DWRITE_MAKE_FONT_AXIS_TAG('w','g','h','t'), 90 WIDTH = DWRITE_MAKE_FONT_AXIS_TAG('w','d','t','h'), 91 SLANT = DWRITE_MAKE_FONT_AXIS_TAG('s','l','n','t'), 92 OPTICAL_SIZE = DWRITE_MAKE_FONT_AXIS_TAG('o','p','s','z'), 93 ITALIC = DWRITE_MAKE_FONT_AXIS_TAG('i','t','a','l'), 94 } 95 96 enum DWRITE_FONT_FAMILY_MODEL : int 97 { 98 TYPOGRAPHIC, 99 WEIGHT_STRETCH_STYLE, 100 } 101 102 enum DWRITE_AUTOMATIC_FONT_AXES : int 103 { 104 NONE = 0x0000, 105 OPTICAL_SIZE = 0x0001, 106 } 107 108 enum DWRITE_FONT_AXIS_ATTRIBUTES : int 109 { 110 NONE = 0x0000, 111 VARIABLE = 0x0001, 112 HIDDEN = 0x0002, 113 } 114 115 enum DWRITE_GLYPH_IMAGE_FORMATS : int 116 { 117 NONE = 0x00000000, 118 TRUETYPE = 0x00000001, 119 CFF = 0x00000002, 120 COLR = 0x00000004, 121 SVG = 0x00000008, 122 PNG = 0x00000010, 123 JPEG = 0x00000020, 124 TIFF = 0x00000040, 125 PREMULTIPLIED_B8G8R8A8 = 0x00000080 126 } 127 128 /// 129 /// Structures 130 /// 131 132 struct DWRITE_FONT_PROPERTY 133 { 134 DWRITE_FONT_PROPERTY_ID propertyId; 135 const wchar* propertyValue; 136 const wchar* localeName; 137 } 138 139 struct DWRITE_LINE_SPACING 140 { 141 DWRITE_LINE_SPACING_METHOD method; 142 float height; 143 float baseline; 144 float leadingBefore; 145 DWRITE_FONT_LINE_GAP_USAGE fontLineGapUsage; 146 } 147 148 struct DWRITE_LINE_METRICS1 149 { 150 uint length; 151 uint trailingWhitespaceLength; 152 uint newlineLength; 153 float height; 154 float baseline; 155 bool isTrimmed; 156 float leadingBefore; 157 float leadingAfter; 158 } 159 160 struct DWRITE_COLOR_GLYPH_RUN1 161 { 162 DWRITE_GLYPH_RUN glyphRun; 163 DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription; 164 float baselineOriginX; 165 float baselineOriginY; 166 DWRITE_COLOR_F runColor; 167 uint paletteIndex; 168 DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat; 169 DWRITE_MEASURING_MODE measuringMode; 170 } 171 172 struct DWRITE_GLYPH_IMAGE_DATA 173 { 174 const void *imageData; 175 uint imageDataSize; 176 uint uniqueDataId; 177 uint pixelsPerEm; 178 D2D1_SIZE_U pixelSize; 179 D2D1_POINT_2L horizontalLeftOrigin; 180 D2D1_POINT_2L horizontalRightOrigin; 181 D2D1_POINT_2L verticalTopOrigin; 182 D2D1_POINT_2L verticalBottomOrigin; 183 } 184 185 struct DWRITE_FILE_FRAGMENT 186 { 187 ulong fileOffset; 188 ulong fragmentSize; 189 } 190 191 struct DWRITE_FONT_AXIS_VALUE 192 { 193 DWRITE_FONT_AXIS_TAG axisTag; 194 float value; 195 } 196 197 struct DWRITE_FONT_AXIS_RANGE 198 { 199 DWRITE_FONT_AXIS_TAG axisTag; 200 float minValue; 201 float maxValue; 202 } 203 204 /// 205 /// Interfaces 206 /// 207 208 mixin(uuid!(IDWriteRenderingParams3, "B7924BAA-391B-412A-8C5C-E44CC2D867DC")); 209 public interface IDWriteRenderingParams3 : IDWriteRenderingParams2 210 { 211 extern(Windows): 212 DWRITE_RENDERING_MODE1 GetRenderingMode1(); 213 } 214 215 mixin(uuid!(IDWriteFactory3, "9A1B41C3-D3BB-466A-87FC-FE67556A3B65")); 216 public interface IDWriteFactory3 : IDWriteFactory2 217 { 218 extern(Windows): 219 HRESULT CreateCustomRenderingParams(float gamma, float enhancedContrast, float grayscaleEnhancedContrast, float clearTypeLevel, DWRITE_PIXEL_GEOMETRY pixelGeometry, DWRITE_RENDERING_MODE1 renderingMode, DWRITE_GRID_FIT_MODE gridFitMode, IDWriteRenderingParams3 *renderingParams); 220 HRESULT CreateFontCollectionFromFontSet(IDWriteFontSet fontset, IDWriteFontCollection1 *fontCollection); 221 HRESULT CreateFontFaceReference(const wchar* filePath, const FILETIME* lastWriteTime, uint faceIndex, DWRITE_FONT_SIMULATIONS fontSimulations, IDWriteFontFaceReference *fontFaceReference); 222 HRESULT CreateFontFaceReference(IDWriteFontFile fontFile, uint faceIndex, DWRITE_FONT_SIMULATIONS fontSimulations, IDWriteFontFaceReference *fontFaceReference); 223 HRESULT CreateFontSetBuilder(IDWriteFontSetBuilder *fontSetBuilder); 224 HRESULT CreateGlyphRunAnalysis(const DWRITE_GLYPH_RUN *glyphRun, const DWRITE_MATRIX *transform, DWRITE_RENDERING_MODE1 renderingMode, DWRITE_MEASURING_MODE measuringMode, DWRITE_GRID_FIT_MODE gridFitMode, DWRITE_TEXT_ANTIALIAS_MODE antialiasMode, float baselineOriginX, float baselineOriginY, IDWriteGlyphRunAnalysis *glyphRunAnalysis); 225 HRESULT GetSystemFontCollection(bool includeDownloadableFonts, IDWriteFontCollection1 *fontCollection, bool includeDownloadableFonts = false); 226 HRESULT GetFontDownloadQueue(IDWriteFontDownloadQueue *fontDownloadQueue); 227 HRESULT GetSystemFontSet(IDWriteFontSet *fontSet); 228 } 229 230 mixin(uuid!(IDWriteFontSet, "53585141-D9F8-4095-8321-D73CF6BD116B")); 231 public interface IDWriteFontSet : IUnknown 232 { 233 extern(Windows): 234 uint GetFontCount(); 235 HRESULT GetFontFaceReference(uint listIndex, IDWriteFontFaceReference *fontFaceReference); 236 HRESULT FindFontFace(IDWriteFontFace fontFace, uint *listIndex, bool *exists); 237 HRESULT FindFontFaceReference(IDWriteFontFaceReference fontFaceReference, uint *listIndex, bool *exists); 238 HRESULT GetPropertyValues(uint listIndex, DWRITE_FONT_PROPERTY_ID propertyId, bool *exists, IDWriteLocalizedStrings *values); 239 HRESULT GetPropertyValues(DWRITE_FONT_PROPERTY_ID propertyId, const wchar *preferredLocaleNames, IDWriteStringList *values); 240 HRESULT GetPropertyValues(DWRITE_FONT_PROPERTY_ID propertyId, IDWriteStringList *values); 241 HRESULT GetPropertyOccurrenceCount(const DWRITE_FONT_PROPERTY *property, uint *propertyOccurrenceCount); 242 HRESULT GetMatchingFonts(const wchar *familyName, DWRITE_FONT_WEIGHT fontWeight, DWRITE_FONT_STRETCH fontStretch, DWRITE_FONT_STYLE fontStyle, IDWriteFontSet *filteredSet); 243 } 244 245 mixin(uuid!(IDWriteFontSetBuilder, "2F642AFE-9C68-4F40-B8BE-457401AFCB3D")); 246 public interface IDWriteFontSetBuilder : IUnknown 247 { 248 extern(Windows): 249 HRESULT AddFontFaceReference(IDWriteFontFaceReference fontFaceReference); 250 HRESULT AddFontFaceReference(IDWriteFontFaceReference fontFaceReference, const DWRITE_FONT_PROPERTY *properties, uint propertyCount); 251 HRESULT AddFontSet(IDWriteFontSet fontSet); 252 HRESULT CreateFontSet(IDWriteFontSet *fontSet); 253 } 254 255 mixin(uuid!(IDWriteFontCollection1, "53585141-D9F8-4095-8321-D73CF6BD116C")); 256 public interface IDWriteFontCollection1 : IDWriteFontCollection 257 { 258 extern(Windows): 259 HRESULT GetFontSet(IDWriteFontSet *fontSet); 260 HRESULT GetFontFamily(uint index, IDWriteFontFamily1* fontFamily); 261 } 262 263 mixin(uuid!(IDWriteFontFamily1, "DA20D8EF-812A-4C43-9802-62EC4ABD7ADF")); 264 public interface IDWriteFontFamily1 : IDWriteFontFamily 265 { 266 extern(Windows): 267 HRESULT GetFont(uint listIndex, IDWriteFont3 *font); 268 DWRITE_LOCALITY GetFontLocality(uint listIndex); 269 HRESULT GetFontFaceReference(uint listIndex, IDWriteFontFaceReference *fontFaceReference); 270 } 271 272 mixin(uuid!(IDWriteFontList1, "DA20D8EF-812A-4C43-9802-62EC4ABD7ADE")); 273 public interface IDWriteFontList1 : IDWriteFontList 274 { 275 extern(Windows): 276 HRESULT GetFont(uint listIndex, IDWriteFont3 *font); 277 DWRITE_LOCALITY GetFontLocality(uint listIndex); 278 HRESULT GetFontFaceReference(uint listIndex, IDWriteFontFaceReference *fontFaceReference); 279 } 280 281 mixin(uuid!(IDWriteFontFaceReference, "5E7FA7CA-DDE3-424C-89F0-9FCD6FED58CD")); 282 public interface IDWriteFontFaceReference : IUnknown 283 { 284 extern(Windows): 285 HRESULT CreateFontFace(IDWriteFontFace3 *fontFace); 286 HRESULT CreateFontFaceWithSimulations(DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags, IDWriteFontFace3 *fontFace); 287 HRESULT EnqueueCharacterDownloadRequest(const wchar *characters, uint characterCount); 288 HRESULT EnqueueFileFragmentDownloadRequest(ulong fileOffset, ulong fragmentSize); 289 HRESULT EnqueueFontDownloadRequest(); 290 HRESULT EnqueueGlyphDownloadRequest(const ushort *glyphIndices, uint glyphCount); 291 ulong GetFileSize(); 292 HRESULT GetFileTime(FILETIME *lastWriteTime); 293 uint GetFontFaceIndex(); 294 HRESULT GetFontFile(IDWriteFontFile *fontFile); 295 ulong GetLocalFileSize(); 296 DWRITE_LOCALITY GetLocality(); 297 DWRITE_FONT_SIMULATIONS GetSimulations(); 298 } 299 300 mixin(uuid!(IDWriteFont3, "DA20D8EF-812A-4C43-9802-62EC4ABD7ADE")); 301 public interface IDWriteFont3 : IDWriteFont2 302 { 303 extern(Windows): 304 HRESULT CreateFontFace(IDWriteFontFace3 *fontFace); 305 bool Equals(IDWriteFont font); 306 HRESULT GetFontFaceReference(IDWriteFontFaceReference *fontFaceReference); 307 DWRITE_LOCALITY GetLocality(); 308 } 309 310 mixin(uuid!(IDWriteFontFace3, "D37D7598-09BE-4222-A236-2081341CC1F2")); 311 public interface IDWriteFontFace3 : IDWriteFontFace2 312 { 313 extern(Windows): 314 HRESULT AreCharactersLocal(const wchar* characters, uint characterCount, bool enqueueIfNotLocal, bool *isLocal); 315 HRESULT AreGlyphsLocal(const ushort* glyphIndices, uint glyphCount, bool enqueueIfNotLocal, bool *isLocal); 316 HRESULT GetFontFaceReference(IDWriteFontFaceReference *fontFaceReference); 317 void GetPanose(DWRITE_PANOSE *panose); 318 DWRITE_FONT_WEIGHT GetWeight(); 319 DWRITE_FONT_STRETCH GetStretch(); 320 DWRITE_FONT_STYLE GetStyle(); 321 HRESULT GetFamilyNames(IDWriteLocalizedStrings *names); 322 HRESULT GetFaceNames(IDWriteLocalizedStrings *names); 323 HRESULT GetInformationalStrings(DWRITE_INFORMATIONAL_STRING_ID informationalStringID, IDWriteLocalizedStrings *informationalStrings, bool *exists); 324 bool HasCharacter(uint unicodeValue); 325 HRESULT GetRecommendedRenderingMode(float fontEmSize, float dpiX, float dpiY, const DWRITE_MATRIX *transform, bool isSideways, DWRITE_OUTLINE_THRESHOLD outlineThreshold, DWRITE_MEASURING_MODE measuringMode, IDWriteRenderingParams *renderingParams, DWRITE_RENDERING_MODE1 *renderingMode, DWRITE_GRID_FIT_MODE *gridFitMode); 326 bool IsCharacterLocal(uint unicodeValue); 327 bool IsGlyphLocal(ushort glyphId); 328 } 329 330 mixin(uuid!(IDWriteStringList, "CFEE3140-1157-47CA-8B85-31BFCF3F2D0E")); 331 public interface IDWriteStringList : IUnknown 332 { 333 extern(Windows): 334 uint GetCount(); 335 HRESULT GetLocaleName(uint listIndex, wchar *localeName, uint size); 336 HRESULT GetLocaleNameLength(uint listIndex, uint *length); 337 HRESULT GetString(uint listIndex, wchar *stringBuffer, uint stringBufferSize); 338 HRESULT GetStringLength(uint listIndex, uint *length); 339 } 340 341 mixin(uuid!(IDWriteFontDownloadListener, "B06FE5B9-43EC-4393-881B-DBE4DC72FDA7")); 342 public interface IDWriteFontDownloadListener : IUnknown 343 { 344 extern(Windows): 345 void DownloadCompleted(IDWriteFontDownloadQueue downloadQueue, IUnknown context, HRESULT downloadResult); 346 } 347 348 mixin(uuid!(IDWriteFontDownloadQueue, "B71E6052-5AEA-4FA3-832E-F60D431F7E91")); 349 public interface IDWriteFontDownloadQueue : IUnknown 350 { 351 extern(Windows): 352 HRESULT AddListener(IDWriteFontDownloadListener listener, uint *token); 353 HRESULT BeginDownload(IUnknown context = null); 354 HRESULT CancelDownload(); 355 ulong GetGenerationCount(); 356 bool IsEmpty(); 357 HRESULT RemoveListener(uint token); 358 } 359 360 mixin(uuid!(IDWriteGdiInterop1, "4556BE70-3ABD-4F70-90BE-421780A6F515")); 361 public interface IDWriteGdiInterop1 : IDWriteGdiInterop 362 { 363 extern(Windows): 364 HRESULT CreateFontFromLOGFONT(LOGFONTW logFont, IDWriteFontCollection fontCollection, IDWriteFont *font); 365 HRESULT GetMatchingFontsByLOGFONT(LOGFONT logFont, IDWriteFontSet fontSet, IDWriteFontSet *filteredSet); 366 HRESULT GetFontSignature(IDWriteFont font, FONTSIGNATURE *fontSignature); 367 HRESULT GetFontSignature(IDWriteFontFace fontFace, FONTSIGNATURE *fontSignature); 368 } 369 370 mixin(uuid!(IDWriteTextFormat2, "F67E0EDD-9E3D-4ECC-8C32-4183253DFE70")); 371 public interface IDWriteTextFormat2 : IDWriteTextFormat1 372 { 373 extern(Windows): 374 HRESULT GetLineSpacing(DWRITE_LINE_SPACING *lineSpacingMethod); 375 HRESULT SetLineSpacing(const DWRITE_LINE_SPACING *lineSpacingOptions); 376 } 377 378 mixin(uuid!(IDWriteTextLayout3, "07DDCD52-020E-4DE8-AC33-6C953D83F92D")); 379 public interface IDWriteTextLayout3 : IDWriteTextLayout2 380 { 381 extern(Windows): 382 HRESULT GetLineMetrics(DWRITE_LINE_METRICS1 *lineMetrics, uint maxLineCount, uint *actualLineCount); 383 HRESULT GetLineSpacing(DWRITE_LINE_SPACING *lineSpacingOptions); 384 HRESULT InvalidateLayout(); 385 HRESULT SetLineSpacing(const DWRITE_LINE_SPACING *lineSpacingOptions); 386 } 387 388 mixin(uuid!(IDWriteColorGlyphRunEnumerator1, "7C5F86DA-C7A1-4F05-B8E1-55A179FE5A35")); 389 public interface IDWriteColorGlyphRunEnumerator1 : IDWriteColorGlyphRunEnumerator 390 { 391 extern(Windows): 392 HRESULT GetCurrentRun(DWRITE_COLOR_GLYPH_RUN1 colorGlyphRun); 393 } 394 395 mixin(uuid!(IDWriteFontFace4, "27F2A904-4EB8-441D-9678-0563F53E3E2F")); 396 public interface IDWriteFontFace4 : IDWriteFontFace3 397 { 398 extern(Windows): 399 HRESULT GetGlyphImageData(ushort glyphId, uint pixelsPerEm, DWRITE_GLYPH_IMAGE_FORMATS glyphImageFormat, DWRITE_GLYPH_IMAGE_DATA *glyphData, void **glyphDataContext); 400 DWRITE_GLYPH_IMAGE_FORMATS GetGlyphImageFormats(); 401 HRESULT GetGlyphImageFormats(ushort glyphId, uint pixelsPerEmFirst, uint pixelsPerEmLast, DWRITE_GLYPH_IMAGE_FORMATS *glyphImageFormats); 402 void ReleaseGlyphImageData(void *glyphDataContext); 403 } 404 405 mixin(uuid!(IDWriteFactory4, "4B0B5BD3-0797-4549-8AC5-FE915CC53856")); 406 public interface IDWriteFactory4 : IDWriteFactory3 407 { 408 extern(Windows): 409 HRESULT ComputeGlyphOrigins(DWRITE_GLYPH_RUN glyphRun, DWRITE_MEASURING_MODE measuringMode, D2D1_POINT_2F baselineOrigin, DWRITE_MATRIX worldAndDpiTransform, D2D1_POINT_2F *glyphOrigins); 410 HRESULT ComputeGlyphOrigins(DWRITE_GLYPH_RUN glyphRun, D2D1_POINT_2F baselineOrigin, D2D1_POINT_2F *glyphOrigins); 411 HRESULT TranslateColorGlyphRun(D2D1_POINT_2F baselineOrigin, DWRITE_GLYPH_RUN glyphRun, DWRITE_GLYPH_RUN_DESCRIPTION glyphRunDescription, DWRITE_GLYPH_IMAGE_FORMATS desiredGlyphImageFormats, DWRITE_MEASURING_MODE measuringMode, DWRITE_MATRIX worldAndDpiTransform, uint colorPaletteIndex, IDWriteColorGlyphRunEnumerator1 *colorLayers); 412 } 413 414 mixin(uuid!(IDWriteFontSetBuilder1, "3FF7715F-3CDC-4DC6-9B72-EC5621DCCAFD")); 415 public interface IDWriteFontSetBuilder1 : IDWriteFontSetBuilder 416 { 417 extern(Windows): 418 HRESULT AddFontFile(IDWriteFontFile fontFile); 419 } 420 421 mixin(uuid!(IDWriteAsyncResult, "CE25F8FD-863B-4D13-9651-C1F88DC73FE2")); 422 public interface IDWriteAsyncResult : IUnknown 423 { 424 extern(Windows): 425 HRESULT GetResult(); 426 HANDLE GetWaitHandle(); 427 } 428 429 mixin(uuid!(IDWriteRemoteFontFileStream, "4DB3757A-2C72-4ED9-B2B6-1ABABE1AFF9C")); 430 public interface IDWriteRemoteFontFileStream : IDWriteFontFileStream 431 { 432 extern(Windows): 433 HRESULT BeginDownload(UUID downloadOperationID, DWRITE_FILE_FRAGMENT fileFragments, uint fragmentCount, IDWriteAsyncResult* asyncResult); 434 HRESULT GetFileFragmentLocality(ulong fileOffset, ulong fragmentSize, bool *isLocal, ulong *partialSize); 435 HRESULT GetLocalFileSize(ulong *localFileSize); 436 DWRITE_LOCALITY GetLocality(); 437 } 438 439 mixin(uuid!(IDWriteRemoteFontFileLoader, "68648C83-6EDE-46C0-AB46-20083A887FDE")); 440 public interface IDWriteRemoteFontFileLoader : IDWriteFontFileLoader 441 { 442 extern(Windows): 443 HRESULT CreateFontFileReferenceFromUrl(IDWriteFactory factory, const wchar* baseUrl, const wchar* fontFileUrl, IDWriteFontFile *fontFile); 444 HRESULT CreateRemoteStreamFromKey(const void *fontFileReferenceKey, uint fontFileReferenceKeySize, IDWriteRemoteFontFileStream *fontFileStream); 445 HRESULT GetLocalityFromKey(const void *fontFileReferenceKey, uint fontFileReferenceKeySize, DWRITE_LOCALITY *locality); 446 } 447 448 mixin(uuid!(IDWriteInMemoryFontFileLoader, "DC102F47-A12D-4B1C-822D-9E117E33043F")); 449 public interface IDWriteInMemoryFontFileLoader : IDWriteFontFileLoader 450 { 451 extern(Windows): 452 HRESULT CreateInMemoryFontFileReference(IDWriteFactory factory, const void *fontData, uint fontDataSize, IUnknown ownerObject, IDWriteFontFile *fontFile); 453 uint GetFileCount(); 454 } 455 456 mixin(uuid!(IDWriteFactory5, "958DB99A-BE2A-4F09-AF7D-65189803D1D3")); 457 public interface IDWriteFactory5 : IDWriteFactory4 458 { 459 extern(Windows): 460 DWRITE_CONTAINER_TYPE AnalyzeContainerType(void *fileData, uint fileDataSize); 461 HRESULT CreateFontSetBuilder(IDWriteFontSetBuilder1 *fontSetBuilder); 462 HRESULT CreateHttpFontFileLoader(const wchar *referrerUrl, const wchar *extraHeaders, IDWriteRemoteFontFileLoader *newLoader); 463 HRESULT CreateInMemoryFontFileLoader(IDWriteInMemoryFontFileLoader *newLoader); 464 HRESULT UnpackFontFile(DWRITE_CONTAINER_TYPE containerType, void *fileData, uint fileDataSize, IDWriteFontFileStream *unpackedFontStream); 465 } 466 467 mixin(uuid!(IDWriteFactory6, "F3744D80-21F7-42EB-B35D-995BC72FC223")); 468 interface IDWriteFactory6 : IDWriteFactory5 469 { 470 extern(Windows): 471 HRESULT CreateFontFaceReference(IDWriteFontFile fontFile, uint faceIndex, DWRITE_FONT_SIMULATIONS fontSimulations, const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, IDWriteFontFaceReference1* fontFaceReference); 472 HRESULT CreateFontResource(IDWriteFontFile fontFile, uint faceIndex, IDWriteFontResource* fontResource); 473 HRESULT GetSystemFontSet(bool includeDownloadableFonts, IDWriteFontSet1* fontSet); 474 HRESULT GetSystemFontCollection( bool includeDownloadableFonts, DWRITE_FONT_FAMILY_MODEL fontFamilyModel, IDWriteFontCollection2* fontCollection); 475 HRESULT CreateFontCollectionFromFontSet(IDWriteFontSet* fontSet, DWRITE_FONT_FAMILY_MODEL fontFamilyModel, IDWriteFontCollection2* fontCollection); 476 HRESULT CreateFontSetBuilder(IDWriteFontSetBuilder2* fontSetBuilder); 477 HRESULT CreateTextFormat(const wchar* fontFamilyName, IDWriteFontCollection fontCollection, const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, float fontSize, const wchar* localeName, IDWriteTextFormat3* textFormat); 478 } 479 480 mixin(uuid!(IDWriteFontFace5, "98EFF3A5-B667-479A-B145-E2FA5B9FDC29")); 481 interface IDWriteFontFace5 : IDWriteFontFace4 482 { 483 extern(Windows): 484 uint GetFontAxisValueCount(); 485 HRESULT GetFontAxisValues(DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount); 486 bool HasVariations(); 487 HRESULT GetFontResource(IDWriteFontResource* fontResource); 488 bool Equals(IDWriteFontFace* fontFace); 489 } 490 491 mixin(uuid!(IDWriteFontResource, "1F803A76-6871-48E8-987F-B975551C50F2")); 492 interface IDWriteFontResource : IUnknown 493 { 494 extern(Windows): 495 HRESULT GetFontFile(IDWriteFontFile* fontFile); 496 uint GetFontFaceIndex(); 497 uint GetFontAxisCount(); 498 HRESULT GetDefaultFontAxisValues(DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount); 499 HRESULT GetFontAxisRanges(DWRITE_FONT_AXIS_RANGE* fontAxisRanges, uint fontAxisRangeCount); 500 DWRITE_FONT_AXIS_ATTRIBUTES GetFontAxisAttributes(uint axisIndex); 501 HRESULT GetAxisNames(uint axisIndex, IDWriteLocalizedStrings* names); 502 uint GetAxisValueNameCount(uint axisIndex); 503 HRESULT GetAxisValueNames(uint axisIndex, uint axisValueIndex, DWRITE_FONT_AXIS_RANGE* fontAxisRange, IDWriteLocalizedStrings* names); 504 bool HasVariations(); 505 HRESULT CreateFontFace( DWRITE_FONT_SIMULATIONS fontSimulations, const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, IDWriteFontFace5* fontFace); 506 HRESULT CreateFontFaceReference(DWRITE_FONT_SIMULATIONS fontSimulations, const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, IDWriteFontFaceReference1* fontFaceReference ); 507 } 508 509 mixin(uuid!(IDWriteFontFaceReference1, "C081FE77-2FD1-41AC-A5A3-34983C4BA61A")); 510 interface IDWriteFontFaceReference1 : IDWriteFontFaceReference 511 { 512 extern(Windows): 513 HRESULT CreateFontFace(IDWriteFontFace5* fontFace); 514 uint GetFontAxisValueCount(); 515 HRESULT GetFontAxisValues(DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount); 516 } 517 518 mixin(uuid!(IDWriteFontSetBuilder2, "EE5BA612-B131-463C-8F4F-3189B9401E45")); 519 interface IDWriteFontSetBuilder2 : IDWriteFontSetBuilder1 520 { 521 extern(Windows): 522 HRESULT AddFont(IDWriteFontFile fontFile, uint fontFaceIndex, DWRITE_FONT_SIMULATIONS fontSimulations, const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, const DWRITE_FONT_AXIS_RANGE* fontAxisRanges, uint fontAxisRangeCount, const DWRITE_FONT_PROPERTY* properties, uint propertyCount); 523 HRESULT AddFontFile(const wchar* filePath); 524 } 525 526 527 mixin(uuid!(IDWriteFontSet1, "7E9FDA85-6C92-4053-BC47-7AE3530DB4D3")); 528 interface IDWriteFontSet1 : IDWriteFontSet 529 { 530 extern(Windows): 531 HRESULT GetMatchingFonts(const DWRITE_FONT_PROPERTY* fontProperty, const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, IDWriteFontSet1* matchingFonts); 532 HRESULT GetFirstFontResources(IDWriteFontSet1* filteredFontSet); 533 HRESULT GetFilteredFonts(const DWRITE_FONT_PROPERTY* properties, uint propertyCount, bool selectAnyProperty, IDWriteFontSet1* filteredFontSet); 534 HRESULT GetFilteredFonts(const DWRITE_FONT_AXIS_RANGE* fontAxisRanges, uint fontAxisRangeCount, bool selectAnyRange, IDWriteFontSet1* filteredFontSet); 535 HRESULT GetFilteredFonts(const uint* indices, uint indexCount, IDWriteFontSet1* filteredFontSet); 536 HRESULT GetFilteredFontIndices(const DWRITE_FONT_PROPERTY* properties, uint propertyCount, bool selectAnyProperty, uint* indices, uint maxIndexCount, uint* actualIndexCount); 537 HRESULT GetFilteredFontIndices(const DWRITE_FONT_AXIS_RANGE* fontAxisRanges, uint fontAxisRangeCount, bool selectAnyRange, uint* indices, uint maxIndexCount, uint* actualIndexCount); 538 HRESULT GetFontAxisRanges(DWRITE_FONT_AXIS_RANGE* fontAxisRanges, uint maxFontAxisRangeCount, uint* actualFontAxisRangeCount); 539 HRESULT GetFontAxisRanges(uint listIndex, DWRITE_FONT_AXIS_RANGE* fontAxisRanges, uint maxFontAxisRangeCount, uint* actualFontAxisRangeCount); 540 HRESULT GetFontFaceReference(uint listIndex, IDWriteFontFaceReference1* fontFaceReference); 541 HRESULT CreateFontResource(uint listIndex, IDWriteFontResource* fontResource ); 542 HRESULT CreateFontFace(uint listIndex, IDWriteFontFace5* fontFace); 543 DWRITE_LOCALITY GetFontLocality(uint listIndex); 544 } 545 546 mixin(uuid!(IDWriteFontList2, "C0763A34-77AF-445A-B735-08C37B0A5BF5")); 547 interface IDWriteFontList2 : IDWriteFontList1 548 { 549 extern(Windows): 550 HRESULT GetFontSet(IDWriteFontSet1* fontSet); 551 } 552 553 mixin(uuid!(IDWriteFontFamily2, "3ED49E77-A398-4261-B9CF-C126C2131EF3")); 554 interface IDWriteFontFamily2 : IDWriteFontFamily1 555 { 556 extern(Windows): 557 HRESULT GetMatchingFonts(const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, IDWriteFontList2* matchingFonts); 558 HRESULT GetFontSet(IDWriteFontSet1* fontSet); 559 } 560 561 mixin(uuid!(IDWriteFontCollection2, "514039C6-4617-4064-BF8B-92EA83E506E0")); 562 interface IDWriteFontCollection2 : IDWriteFontCollection1 563 { 564 extern(Windows): 565 HRESULT GetFontFamily(uint index, IDWriteFontFamily2* fontFamily); 566 HRESULT GetMatchingFonts(const wchar* familyName, const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, IDWriteFontList2* fontList); 567 DWRITE_FONT_FAMILY_MODEL GetFontFamilyModel(); 568 HRESULT GetFontSet(IDWriteFontSet1* fontSet); 569 } 570 571 mixin(uuid!(IDWriteTextLayout4, "05A9BF42-223F-4441-B5FB-8263685F55E9")); 572 interface IDWriteTextLayout4 : IDWriteTextLayout3 573 { 574 extern(Windows): 575 HRESULT SetFontAxisValues(const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, DWRITE_TEXT_RANGE textRange); 576 uint GetFontAxisValueCount(uint currentPosition); 577 HRESULT GetFontAxisValues(uint currentPosition, DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, DWRITE_TEXT_RANGE* textRange = null); 578 HRESULT SetAutomaticFontAxes(DWRITE_AUTOMATIC_FONT_AXES automaticFontAxes); 579 } 580 581 mixin(uuid!(IDWriteTextFormat3, "6D3B5641-E550-430D-A85B-B7BF48A93427")); 582 interface IDWriteTextFormat3 : IDWriteTextFormat2 583 { 584 extern(Windows): 585 HRESULT SetFontAxisValues(const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount); 586 uint GetFontAxisValueCount(); 587 HRESULT GetFontAxisValues(DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount); 588 DWRITE_AUTOMATIC_FONT_AXES GetAutomaticFontAxes(); 589 HRESULT SetAutomaticFontAxes(DWRITE_AUTOMATIC_FONT_AXES automaticFontAxes); 590 } 591 592 mixin(uuid!(IDWriteFontFallback1, "2397599D-DD0D-4681-BD6A-F4F31EAADE77")); 593 interface IDWriteFontFallback1 : IDWriteFontFallback 594 { 595 extern(Windows): 596 HRESULT MapCharacters(IDWriteTextAnalysisSource analysisSource, uint textPosition, uint textLength, IDWriteFontCollection baseFontCollection, const wchar* baseFamilyName, const DWRITE_FONT_AXIS_VALUE* fontAxisValues, uint fontAxisValueCount, uint* mappedLength, float* scale, IDWriteFontFace5* mappedFontFace); 597 } 598 599 //Windows 1803 600 601 mixin(uuid!(IDWriteFontSet2, "DC7EAD19-E54C-43AF-B2DA-4E2B79BA3F7F")); 602 interface IDWriteFontSet2 : IDWriteFontSet1 603 { 604 extern(Windows): 605 HANDLE GetExpirationEvent(); 606 } 607 608 mixin(uuid!(IDWriteFontCollection3, "A4D055A6-F9E3-4E25-93B7-9E309F3AF8E9")); 609 interface IDWriteFontCollection3 : IDWriteFontCollection2 610 { 611 extern(Windows): 612 HANDLE GetExpirationEvent(); 613 } 614 615 mixin(uuid!(IDWriteFactory7, "35D0E0B3-9076-4D2E-A016-A91B568A06B4")); 616 interface IDWriteFactory7 : IDWriteFactory6 617 { 618 extern(Windows): 619 HRESULT GetSystemFontSet(bool includeDownloadableFonts, IDWriteFontSet2* fontSet); 620 HRESULT GetSystemFontCollection(bool includeDownloadableFonts, DWRITE_FONT_FAMILY_MODEL fontFamilyModel, IDWriteFontCollection3* fontCollection); 621 } 622 623 //Windows 1809 624 625 enum DWRITE_FONT_SOURCE_TYPE 626 { 627 DWRITE_FONT_SOURCE_TYPE_UNKNOWN, 628 DWRITE_FONT_SOURCE_TYPE_PER_MACHINE, 629 DWRITE_FONT_SOURCE_TYPE_PER_USER, 630 DWRITE_FONT_SOURCE_TYPE_APPX_PACKAGE, 631 DWRITE_FONT_SOURCE_TYPE_REMOTE_FONT_PROVIDER 632 }; 633 634 mixin(uuid!(IDWriteFontSet3, "7C073EF2-A7F4-4045-8C32-8AB8AE640F90")); 635 interface IDWriteFontSet3 : IDWriteFontSet2 636 { 637 extern(Windows): 638 DWRITE_FONT_SOURCE_TYPE GetFontSourceType(uint fontIndex); 639 uint GetFontSourceNameLength(uint listIndex); 640 HRESULT GetFontSourceName(uint listIndex, wchar* stringBuffer, uint stringBufferSize); 641 }