1 module aurora.directx.dwrite.dwrite_2;
2 
3 version(Windows):
4 
5 public import aurora.directx.com;
6 public import aurora.directx.dwrite.dwrite_1;
7 
8 public:
9 
10 ///
11 /// Constants
12 ///
13 
14 ///
15 /// Functions
16 ///
17 
18 ///
19 ///	Enumerations
20 ///
21 
22 enum DWRITE_GRID_FIT_MODE {
23 	DEFAULT, 
24 	DISABLED, 
25 	ENABLED
26 }
27 
28 public enum DWRITE_OPTICAL_ALIGNMENT : int { 
29 	NONE,
30 	NO_SIDE_BEARINGS,
31 }
32 
33 ///
34 /// Structures
35 ///
36 
37 alias D3DCOLORVALUE DWRITE_COLOR_F;
38 
39 public struct DWRITE_COLOR_GLYPH_RUN {
40 	DWRITE_GLYPH_RUN             glyphRun;
41 	DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription;
42 	float                        baselineOriginX;
43 	float                        baselineOriginY;
44 	DWRITE_COLOR_F               runColor;
45 	uint                       paletteIndex;
46 }
47 
48 public struct DWRITE_TEXT_METRICS1  {
49 	DWRITE_TEXT_METRICS base;
50 	alias base this;
51 	float heightIncludingTrailingWhitespace;
52 }
53 
54 ///
55 /// Interfaces
56 ///
57 
58 mixin(uuid!(IDWriteFont2, "29748ed6-8c9c-4a6a-be0b-d912e8538944"));
59 public interface IDWriteFont2 : IDWriteFont1
60 {
61 extern(Windows):
62 	BOOL IsColorFont();
63 }
64 
65 mixin(uuid!(IDWriteColorGlyphRunEnumerator, "d31fbe17-f157-41a2-8d24-cb779e0560e8"));
66 public interface IDWriteColorGlyphRunEnumerator : IUnknown
67 {
68 extern(Windows):
69 	HRESULT GetCurrentRun(DWRITE_COLOR_GLYPH_RUN **ColorGlyphRun);
70 	HRESULT MoveNext(BOOL *HaveRun);
71 }
72 
73 mixin(uuid!(IDWriteFontFace2, "d8b768ff-64bc-4e66-982b-ec8e87f693f7"));
74 public interface IDWriteFontFace2 : IDWriteFontFace1
75 {
76 extern(Windows):
77 	uint GetColorPaletteCount();
78 	HRESULT GetPaletteEntries(uint ColorPaletteIndex, uint FirstEntryIndex, uint EntryCount, DWRITE_COLOR_F *PaletteEntries);
79 	uint GetPaletteEntryCount();
80 	BOOL IsColorFont();
81 }
82 
83 mixin(uuid!(IDWriteFontFallback, "EFA008F9-F7A1-48BF-B05C-F224713CC0FF"));
84 public interface IDWriteFontFallback : IUnknown
85 {
86 extern(Windows):
87 	HRESULT MapCharacters(IDWriteTextAnalysisSource Source, uint TextPosition, uint TextLength, IDWriteFontCollection BaseFontCollection, const wchar *BaseFamilyName, DWRITE_FONT_WEIGHT BaseWeight, DWRITE_FONT_STYLE BaseStyle, DWRITE_FONT_STRETCH BaseStretch, uint *MappedLength, IDWriteFont *MappedFont, float *Scale);
88 }
89 
90 mixin(uuid!(IDWriteFontFallbackBuilder, "FD882D06-8ABA-4FB8-B849-8BE8B73E14DE"));
91 public interface IDWriteFontFallbackBuilder : IUnknown
92 {
93 extern(Windows):
94 	HRESULT AddMapping(DWRITE_UNICODE_RANGE *Ranges, uint RangesCount, const wchar **TargetFamilyNames, uint targetFamilyNamesCount, IDWriteFontCollection FontCollection = null, const wchar *LocaleName = null, const WCHAR *BaseFamilyName = null, float Scale = 1);
95 	HRESULT AddMappings(IDWriteFontFallback FontFallback);
96 	HRESULT CreateFontFallback(IDWriteFontFallback *FontFallback);
97 }
98 
99 mixin(uuid!(IDWriteTextAnalyzer2, "553A9FF3-5693-4DF7-B52B-74806F7F2EB9"));
100 public interface IDWriteTextAnalyzer2 : IDWriteTextAnalyzer1
101 {
102 extern(Windows):
103 	HRESULT CheckTypographicFeature(DWRITE_SCRIPT_ANALYSIS ScriptAnalysis, const WCHAR *LocaleName, DWRITE_FONT_FEATURE_TAG Tag, uint GlyphCount, const ushort *GlyphIndices, ubyte *FeatureApplies);
104 	HRESULT GetGlyphOrientationTransform(DWRITE_GLYPH_ORIENTATION_ANGLE GlyphOrientationAngle, BOOL IsSideways, float OriginX, float OriginY, DWRITE_MATRIX *Transform);
105 	HRESULT GetTypographicFeatures(DWRITE_SCRIPT_ANALYSIS ScriptAnalysis, const wchar *LocaleName, uint MaxTagCount, uint *ActualTagCount, DWRITE_FONT_FEATURE_TAG *Tags);
106 }
107 
108 mixin(uuid!(IDWriteTextFormat1, "5F174B49-0D8B-4CFB-8BCA-F1CCE9D06C67"));
109 public interface IDWriteTextFormat1 : IDWriteTextFormat
110 {
111 extern(Windows):
112 	HRESULT GetFontFallback(IDWriteFontFallback *FontFallback);
113 	HRESULT SetFontFallback(IDWriteFontFallback FontFallback);
114 	HRESULT SetOpticalAlignment(DWRITE_OPTICAL_ALIGNMENT OpticalAlignment);
115 	HRESULT SetVerticalGlyphOrientation(DWRITE_VERTICAL_GLYPH_ORIENTATION GlyphOrientation);
116 	HRESULT SetWrapOnLastLine(BOOL IsLastLineWrappingEnabled);
117 }
118 
119 mixin(uuid!(IDWriteTextLayout2, "1093C18F-8D5E-43F0-B064-0917311B525E"));
120 public interface IDWriteTextLayout2 : IDWriteTextLayout1
121 {
122 extern(Windows):
123 	HRESULT GetFontFallback(IDWriteFontFallback *FontFallback);
124 	BOOL GetLastLineWrapping();
125 	HRESULT GetMetrics(DWRITE_TEXT_METRICS1 *TextMetrics);
126 	DWRITE_OPTICAL_ALIGNMENT GetOpticalAlignment();
127 	DWRITE_VERTICAL_GLYPH_ORIENTATION GetVerticalGlyphOrientation();
128 	HRESULT SetFontFallback(IDWriteFontFallback FontFallback);
129 	HRESULT SetLastLineWrapping(BOOL IsLastLineWrappingEnabled);
130 	HRESULT SetOpticalAlignment(DWRITE_OPTICAL_ALIGNMENT OpticalAlignment);
131 	HRESULT SetVerticalGlyphOrientation(DWRITE_VERTICAL_GLYPH_ORIENTATION GlyphOrientation);
132 }
133 
134 mixin(uuid!(IDWriteTextRenderer1, "D3E0E934-22A0-427E-AAE4-7D9574B59DB1"));
135 public interface IDWriteTextRenderer1 : IDWriteTextRenderer
136 {
137 extern(Windows):
138 	HRESULT SetCurrentOrientation(void *ClientDrawingContext, DWRITE_GLYPH_ORIENTATION_ANGLE Orientation);	
139 }
140 
141 mixin(uuid!(IDWriteFactory2, "0439fc60-ca44-4994-8dee-3a9af7b732ec"));
142 public interface IDWriteFactory2 : IDWriteFactory1
143 {
144 extern(Windows):
145 	HRESULT CreateFontFallbackBuilder(IDWriteFontFallbackBuilder *FontFallbackBuilder);
146 	HRESULT GetSystemFontFallback(IDWriteFontFallback *FontFallback);
147 	HRESULT TranslateColorGlyphRun(float BaselineOriginX, float BaselineOriginY, const DWRITE_GLYPH_RUN *GlyphRun, const DWRITE_GLYPH_RUN_DESCRIPTION *GlyphRunDescription, DWRITE_MEASURING_MODE MeasuringMode, const DWRITE_MATRIX *WorldToDeviceTransform, uint ColorPaletteIndex, IDWriteColorGlyphRunEnumerator *ColorLayers);
148 }
149 
150 mixin(uuid!(IDWriteRenderingParams2, "F9D711C3-9777-40AE-87E8-3E5AF9BF0948"));
151 interface IDWriteRenderingParams2 : IDWriteRenderingParams1
152 {
153 extern(Windows):
154     DWRITE_GRID_FIT_MODE GetGridFitMode();
155 };
156