RetroArch
dwrite_2.h
Go to the documentation of this file.
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_2_H_INCLUDED
11 #define DWRITE_2_H_INCLUDED
12 
13 #pragma once
14 
15 #include <dwrite_1.h>
16 
17 
18 interface IDWriteFontFallback;
19 
20 
25 {
30 
38 };
39 
40 
45 {
50 
55 
60 };
61 
62 
68 {
75 };
76 
77 
83 interface DWRITE_DECLARE_INTERFACE("D3E0E934-22A0-427E-AAE4-7D9574B59DB1") IDWriteTextRenderer1 : public IDWriteTextRenderer
84 {
117  STDMETHOD(DrawGlyphRun)(
118  _In_opt_ void* clientDrawingContext,
119  FLOAT baselineOriginX,
120  FLOAT baselineOriginY,
121  DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
122  DWRITE_MEASURING_MODE measuringMode,
123  _In_ DWRITE_GLYPH_RUN const* glyphRun,
124  _In_ DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
125  _In_opt_ IUnknown* clientDrawingEffect
126  ) PURE;
127 
157  STDMETHOD(DrawUnderline)(
158  _In_opt_ void* clientDrawingContext,
159  FLOAT baselineOriginX,
160  FLOAT baselineOriginY,
161  DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
162  _In_ DWRITE_UNDERLINE const* underline,
163  _In_opt_ IUnknown* clientDrawingEffect
164  ) PURE;
165 
190  STDMETHOD(DrawStrikethrough)(
191  _In_opt_ void* clientDrawingContext,
192  FLOAT baselineOriginX,
193  FLOAT baselineOriginY,
194  DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
195  _In_ DWRITE_STRIKETHROUGH const* strikethrough,
196  _In_opt_ IUnknown* clientDrawingEffect
197  ) PURE;
198 
229  STDMETHOD(DrawInlineObject)(
230  _In_opt_ void* clientDrawingContext,
231  FLOAT originX,
232  FLOAT originY,
233  DWRITE_GLYPH_ORIENTATION_ANGLE orientationAngle,
234  _In_ IDWriteInlineObject* inlineObject,
235  BOOL isSideways,
236  BOOL isRightToLeft,
237  _In_opt_ IUnknown* clientDrawingEffect
238  ) PURE;
239 
240  using IDWriteTextRenderer::DrawGlyphRun;
241  using IDWriteTextRenderer::DrawUnderline;
242  using IDWriteTextRenderer::DrawStrikethrough;
243  using IDWriteTextRenderer::DrawInlineObject;
244 };
245 
246 
253 interface DWRITE_DECLARE_INTERFACE("5F174B49-0D8B-4CFB-8BCA-F1CCE9D06C67") IDWriteTextFormat1 : public IDWriteTextFormat
254 {
262  STDMETHOD(SetVerticalGlyphOrientation)(
263  DWRITE_VERTICAL_GLYPH_ORIENTATION glyphOrientation
264  ) PURE;
265 
270  STDMETHOD_(DWRITE_VERTICAL_GLYPH_ORIENTATION, GetVerticalGlyphOrientation)() PURE;
271 
279  STDMETHOD(SetLastLineWrapping)(
280  BOOL isLastLineWrappingEnabled
281  ) PURE;
282 
286  STDMETHOD_(BOOL, GetLastLineWrapping)() PURE;
287 
297  STDMETHOD(SetOpticalAlignment)(
298  DWRITE_OPTICAL_ALIGNMENT opticalAlignment
299  ) PURE;
300 
304  STDMETHOD_(DWRITE_OPTICAL_ALIGNMENT, GetOpticalAlignment)() PURE;
305 
316  STDMETHOD(SetFontFallback)(
317  IDWriteFontFallback* fontFallback
318  ) PURE;
319 
323  STDMETHOD(GetFontFallback)(
324  __out IDWriteFontFallback** fontFallback
325  ) PURE;
326 };
327 
328 
335 interface DWRITE_DECLARE_INTERFACE("1093C18F-8D5E-43F0-B064-0917311B525E") IDWriteTextLayout2 : public IDWriteTextLayout1
336 {
350  STDMETHOD(GetMetrics)(
351  _Out_ DWRITE_TEXT_METRICS1* textMetrics
352  ) PURE;
353 
354  using IDWriteTextLayout::GetMetrics;
355 
363  STDMETHOD(SetVerticalGlyphOrientation)(
364  DWRITE_VERTICAL_GLYPH_ORIENTATION glyphOrientation
365  ) PURE;
366 
371  STDMETHOD_(DWRITE_VERTICAL_GLYPH_ORIENTATION, GetVerticalGlyphOrientation)() PURE;
372 
380  STDMETHOD(SetLastLineWrapping)(
381  BOOL isLastLineWrappingEnabled
382  ) PURE;
383 
387  STDMETHOD_(BOOL, GetLastLineWrapping)() PURE;
388 
398  STDMETHOD(SetOpticalAlignment)(
399  DWRITE_OPTICAL_ALIGNMENT opticalAlignment
400  ) PURE;
401 
405  STDMETHOD_(DWRITE_OPTICAL_ALIGNMENT, GetOpticalAlignment)() PURE;
406 
417  STDMETHOD(SetFontFallback)(
418  IDWriteFontFallback* fontFallback
419  ) PURE;
420 
424  STDMETHOD(GetFontFallback)(
425  __out IDWriteFontFallback** fontFallback
426  ) PURE;
427 };
428 
429 
435 interface DWRITE_DECLARE_INTERFACE("553A9FF3-5693-4DF7-B52B-74806F7F2EB9") IDWriteTextAnalyzer2 : public IDWriteTextAnalyzer1
436 {
455  STDMETHOD(GetGlyphOrientationTransform)(
456  DWRITE_GLYPH_ORIENTATION_ANGLE glyphOrientationAngle,
457  BOOL isSideways,
458  FLOAT originX,
459  FLOAT originY,
460  _Out_ DWRITE_MATRIX* transform
461  ) PURE;
462 
478  STDMETHOD(GetTypographicFeatures)(
479  IDWriteFontFace* fontFace,
480  DWRITE_SCRIPT_ANALYSIS scriptAnalysis,
481  _In_opt_z_ WCHAR const* localeName,
482  UINT32 maxTagCount,
483  _Out_ UINT32* actualTagCount,
484  _Out_writes_(maxTagCount) DWRITE_FONT_FEATURE_TAG* tags
485  ) PURE;
486 
507  STDMETHOD(CheckTypographicFeature)(
508  IDWriteFontFace* fontFace,
509  DWRITE_SCRIPT_ANALYSIS scriptAnalysis,
510  _In_opt_z_ WCHAR const* localeName,
511  DWRITE_FONT_FEATURE_TAG featureTag,
512  UINT32 glyphCount,
513  _In_reads_(glyphCount) UINT16 const* glyphIndices,
514  _Out_writes_(glyphCount) UINT8* featureApplies
515  ) PURE;
516 
517  using IDWriteTextAnalyzer1::GetGlyphOrientationTransform;
518 };
519 
520 
525 interface DWRITE_DECLARE_INTERFACE("EFA008F9-F7A1-48BF-B05C-F224713CC0FF") IDWriteFontFallback : public IUnknown
526 {
552  STDMETHOD(MapCharacters)(
553  IDWriteTextAnalysisSource* analysisSource,
554  UINT32 textPosition,
555  UINT32 textLength,
556  _In_opt_ IDWriteFontCollection* baseFontCollection,
557  _In_opt_z_ wchar_t const* baseFamilyName,
558  DWRITE_FONT_WEIGHT baseWeight,
559  DWRITE_FONT_STYLE baseStyle,
560  DWRITE_FONT_STRETCH baseStretch,
561  _Out_range_(0, textLength) UINT32* mappedLength,
562  _COM_Outptr_result_maybenull_ IDWriteFont** mappedFont,
563  _Out_ FLOAT* scale
564  ) PURE;
565 };
566 
567 
575 interface DWRITE_DECLARE_INTERFACE("FD882D06-8ABA-4FB8-B849-8BE8B73E14DE") IDWriteFontFallbackBuilder : public IUnknown
576 {
591  STDMETHOD(AddMapping)(
592  _In_reads_(rangesCount) DWRITE_UNICODE_RANGE const* ranges,
593  UINT32 rangesCount,
594  _In_reads_(targetFamilyNamesCount) WCHAR const** targetFamilyNames,
595  UINT32 targetFamilyNamesCount,
596  _In_opt_ IDWriteFontCollection* fontCollection = NULL,
597  _In_opt_z_ WCHAR const* localeName = NULL,
598  _In_opt_z_ WCHAR const* baseFamilyName = NULL,
599  FLOAT scale = 1.0f
600  ) PURE;
601 
609  STDMETHOD(AddMappings)(
610  IDWriteFontFallback* fontFallback
611  ) PURE;
612 
620  STDMETHOD(CreateFontFallback)(
621  _COM_Outptr_ IDWriteFontFallback** fontFallback
622  ) PURE;
623 };
624 
628 #ifndef D3DCOLORVALUE_DEFINED
629 
630 typedef struct _D3DCOLORVALUE {
631  union {
634  };
635  union {
638  };
639  union {
642  };
643  union {
646  };
647 } D3DCOLORVALUE;
648 
649 #define D3DCOLORVALUE_DEFINED
650 #endif // D3DCOLORVALUE_DEFINED
651 
653 
657 interface DWRITE_DECLARE_INTERFACE("29748ed6-8c9c-4a6a-be0b-d912e8538944") IDWriteFont2 : public IDWriteFont1
658 {
665  STDMETHOD_(BOOL, IsColorFont)() PURE;
666 };
667 
673 interface DWRITE_DECLARE_INTERFACE("d8b768ff-64bc-4e66-982b-ec8e87f693f7") IDWriteFontFace2 : public IDWriteFontFace1
674 {
681  STDMETHOD_(BOOL, IsColorFont)() PURE;
682 
688  STDMETHOD_(UINT32, GetColorPaletteCount)() PURE;
689 
695  STDMETHOD_(UINT32, GetPaletteEntryCount)() PURE;
696 
714  STDMETHOD(GetPaletteEntries)(
715  UINT32 colorPaletteIndex,
716  UINT32 firstEntryIndex,
717  UINT32 entryCount,
718  _Out_writes_(entryCount) DWRITE_COLOR_F* paletteEntries
719  ) PURE;
720 
746  STDMETHOD(GetRecommendedRenderingMode)(
747  FLOAT fontEmSize,
748  FLOAT dpiX,
749  FLOAT dpiY,
750  _In_opt_ DWRITE_MATRIX const* transform,
751  BOOL isSideways,
752  DWRITE_OUTLINE_THRESHOLD outlineThreshold,
753  DWRITE_MEASURING_MODE measuringMode,
754  _In_opt_ IDWriteRenderingParams* renderingParams,
755  _Out_ DWRITE_RENDERING_MODE* renderingMode,
756  _Out_ DWRITE_GRID_FIT_MODE* gridFitMode
757  ) PURE;
758 
759  using IDWriteFontFace1::GetRecommendedRenderingMode;
760 };
761 
769 {
774 
779 
785 
795 
802 };
803 
807 interface DWRITE_DECLARE_INTERFACE("d31fbe17-f157-41a2-8d24-cb779e0560e8") IDWriteColorGlyphRunEnumerator : public IUnknown
808 {
818  STDMETHOD(MoveNext)(
819  _Out_ BOOL* hasRun
820  ) PURE;
821 
833  STDMETHOD(GetCurrentRun)(
834  _Outptr_ DWRITE_COLOR_GLYPH_RUN const** colorGlyphRun
835  ) PURE;
836 };
837 
841 interface DWRITE_DECLARE_INTERFACE("F9D711C3-9777-40AE-87E8-3E5AF9BF0948") IDWriteRenderingParams2 : public IDWriteRenderingParams1
842 {
846  STDMETHOD_(DWRITE_GRID_FIT_MODE, GetGridFitMode)() PURE;
847 };
848 
852 interface DWRITE_DECLARE_INTERFACE("0439fc60-ca44-4994-8dee-3a9af7b732ec") IDWriteFactory2 : public IDWriteFactory1
853 {
861  STDMETHOD(GetSystemFontFallback)(
862  _COM_Outptr_ IDWriteFontFallback** fontFallback
863  ) PURE;
864 
872  STDMETHOD(CreateFontFallbackBuilder)(
873  _COM_Outptr_ IDWriteFontFallbackBuilder** fontFallbackBuilder
874  ) PURE;
875 
904  STDMETHOD(TranslateColorGlyphRun)(
905  FLOAT baselineOriginX,
906  FLOAT baselineOriginY,
907  _In_ DWRITE_GLYPH_RUN const* glyphRun,
908  _In_opt_ DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
909  DWRITE_MEASURING_MODE measuringMode,
910  _In_opt_ DWRITE_MATRIX const* worldToDeviceTransform,
911  UINT32 colorPaletteIndex,
912  _COM_Outptr_ IDWriteColorGlyphRunEnumerator** colorLayers
913  ) PURE;
914 
928  STDMETHOD(CreateCustomRenderingParams)(
929  FLOAT gamma,
930  FLOAT enhancedContrast,
931  FLOAT grayscaleEnhancedContrast,
932  FLOAT clearTypeLevel,
933  DWRITE_PIXEL_GEOMETRY pixelGeometry,
934  DWRITE_RENDERING_MODE renderingMode,
935  DWRITE_GRID_FIT_MODE gridFitMode,
936  _COM_Outptr_ IDWriteRenderingParams2** renderingParams
937  ) PURE;
938 
939  using IDWriteFactory::CreateCustomRenderingParams;
940  using IDWriteFactory1::CreateCustomRenderingParams;
941 
959  STDMETHOD(CreateGlyphRunAnalysis)(
960  _In_ DWRITE_GLYPH_RUN const* glyphRun,
961  _In_opt_ DWRITE_MATRIX const* transform,
962  DWRITE_RENDERING_MODE renderingMode,
963  DWRITE_MEASURING_MODE measuringMode,
964  DWRITE_GRID_FIT_MODE gridFitMode,
965  DWRITE_TEXT_ANTIALIAS_MODE antialiasMode,
966  FLOAT baselineOriginX,
967  FLOAT baselineOriginY,
968  _COM_Outptr_ IDWriteGlyphRunAnalysis** glyphRunAnalysis
969  ) PURE;
970 
971  using IDWriteFactory::CreateGlyphRunAnalysis;
972 };
973 
974 
975 #endif /* DWRITE_2_H_INCLUDED */
interface DWRITE_DECLARE_INTERFACE("D3E0E934-22A0-427E-AAE4-7D9574B59DB1") IDWriteTextRenderer1 interface DWRITE_DECLARE_INTERFACE("5F174B49-0D8B-4CFB-8BCA-F1CCE9D06C67") IDWriteTextFormat1 interface DWRITE_DECLARE_INTERFACE("1093C18F-8D5E-43F0-B064-0917311B525E") IDWriteTextLayout2 interface DWRITE_DECLARE_INTERFACE("553A9FF3-5693-4DF7-B52B-74806F7F2EB9") IDWriteTextAnalyzer2 interface DWRITE_DECLARE_INTERFACE("EFA008F9-F7A1-48BF-B05C-F224713CC0FF") IDWriteFontFallback interface DWRITE_DECLARE_INTERFACE("FD882D06-8ABA-4FB8-B849-8BE8B73E14DE") IDWriteFontFallbackBuilder struct _D3DCOLORVALUE D3DCOLORVALUE
The text renderer interface represents a set of application-defined callbacks that perform rendering ...
Choose grid fitting base on the font's gasp table information.
Definition: dwrite_2.h:49
DWRITE_OPTICAL_ALIGNMENT
How to align glyphs to the margin.
Definition: dwrite_2.h:24
FLOAT b
Definition: dwrite_2.h:640
The DWRITE_UNDERLINE structure contains information about the size and placement of underlines....
Definition: dwrite.h:3111
D3DCOLORVALUE DWRITE_COLOR_F
Definition: dwrite_2.h:652
Always disable grid fitting, using the ideal glyph outlines.
Definition: dwrite_2.h:54
Definition: glslang_tab.cpp:129
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9939
GLboolean GLboolean GLboolean b
Definition: glext.h:6844
DWRITE_VERTICAL_GLYPH_ORIENTATION
The desired kind of glyph orientation for the text. The client specifies this to the analyzer as the ...
Definition: dwrite_1.h:579
FLOAT dvG
Definition: dwrite_2.h:637
FLOAT baselineOriginY
Definition: dwrite_2.h:784
Range of Unicode codepoints.
Definition: dwrite_1.h:819
The DWRITE_GLYPH_RUN_DESCRIPTION structure contains additional properties related to those in DWRITE_...
Definition: dwrite.h:3075
#define DWRITE_DECLARE_INTERFACE(iid)
Definition: dwrite.h:25
DWRITE_FONT_FEATURE_TAG
Typographic feature of text supplied by the font.
Definition: dwrite.h:1877
#define NULL
Pointer to 0.
Definition: gctypes.h:65
FLOAT dvR
Definition: dwrite_2.h:633
Overall metrics associated with text after layout. All coordinates are in device independent pixels (...
Definition: dwrite.h:3309
DWRITE_OUTLINE_THRESHOLD
Specifies the policy used by GetRecommendedRenderingMode to determine whether to render glyphs in out...
Definition: dwrite_1.h:516
FLOAT r
Definition: dwrite_2.h:632
The DWRITE_STRIKETHROUGH structure contains information about the size and placement of strikethrough...
Definition: dwrite.h:3172
Align to the default metrics of the glyph.
Definition: dwrite_2.h:29
The IDWriteFont interface represents a physical font in a font collection.
Definition: dwrite_2.h:768
The interface implemented by the text analyzer's client to provide text to the analyzer....
Definition: dwrite.h:3021
FLOAT baselineOriginX
Location at which to draw this glyph run.
Definition: dwrite_2.h:783
_Maybenull_ DWRITE_GLYPH_RUN_DESCRIPTION * glyphRunDescription
Optional glyph run description.
Definition: dwrite_2.h:778
f32 a2
Definition: gx_regdef.h:5096
interface IDWriteFontFace IDWriteFontFace
Definition: d2d1_3.h:31
#define F0(x, y, z)
Definition: sha256.c:166
DWRITE_RENDERING_MODE
Represents a method of rendering glyphs.
Definition: dwrite.h:902
UINT16 paletteIndex
Zero-based index of this layer's color entry in the current color palette, or 0xFFFF if this layer is...
Definition: dwrite_2.h:801
The DWRITE_MATRIX structure specifies the graphics transform to be applied to rendered glyphs.
Definition: dwrite.h:967
unsigned int BOOL
Definition: gctypes.h:51
DWRITE_PIXEL_GEOMETRY
Font file loader interface handles loading font file resources of a particular type from a key....
Definition: dwrite.h:877
DWRITE_FONT_WEIGHT
The font weight enumeration describes common values for degree of blackness or thickness of strokes o...
Definition: dwrite.h:167
uint32_t UINT32
Definition: coretypes.h:10
Association of text and its writing system script as well as some display attributes.
Definition: dwrite.h:2347
FLOAT g
Definition: dwrite_2.h:636
Align glyphs to the margins. Without this, some small whitespace may be present between the text and ...
Definition: dwrite_2.h:37
uint16_t UINT16
Definition: coretypes.h:11
interface IDWriteRenderingParams IDWriteRenderingParams
Definition: d2d1.h:52
FLOAT dvA
Definition: dwrite_2.h:645
GLuint GLenum GLenum transform
Definition: glext.h:10314
DWRITE_TEXT_ANTIALIAS_MODE
The root factory interface for all DWrite objects.
Definition: dwrite_1.h:1877
DWRITE_GLYPH_RUN glyphRun
Glyph run to render.
Definition: dwrite_2.h:773
interface IDWriteTextFormat IDWriteTextFormat
Definition: d2d1.h:50
Overall metrics associated with text after layout. All coordinates are in device independent pixels (...
Definition: dwrite_2.h:67
DWRITE_GLYPH_ORIENTATION_ANGLE
How the glyph is oriented to the x-axis. This is an output from the text analyzer,...
Definition: dwrite_1.h:603
DWRITE_COLOR_F runColor
Color to use for this layer, if any. This is the same color that IDWriteFontFace2::GetPaletteEntries ...
Definition: dwrite_2.h:794
FLOAT a
Definition: dwrite_2.h:644
DWRITE_FONT_STYLE
The font style enumeration describes the slope style of a font face, such as Normal,...
Definition: dwrite.h:322
FLOAT heightIncludingTrailingWhitespace
The height of the formatted text taking into account the trailing whitespace at the end of each line,...
Definition: dwrite_2.h:74
DWRITE_GRID_FIT_MODE
Whether to enable grid-fitting of glyph outlines (a.k.a. hinting).
Definition: dwrite_2.h:44
FLOAT dvB
Definition: dwrite_2.h:641
The text renderer interface represents a set of application-defined callbacks that perform rendering ...
Definition: d3d8types.h:57
Enable grid fitting, adjusting glyph outlines for device pixel display.
Definition: dwrite_2.h:59
DWRITE_MEASURING_MODE
The measuring method used for text layout.
Definition: dcommon.h:35
DWRITE_FONT_STRETCH
The font stretch enumeration describes relative change from the normal aspect ratio as specified by a...
Definition: dwrite.h:260
uint8_t UINT8
Definition: coretypes.h:12