-
Notifications
You must be signed in to change notification settings - Fork 72
/
dwrite (2).ahk
1867 lines (1662 loc) · 77.6 KB
/
dwrite (2).ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#Include base.ahk
class IDWriteFactory extends IUnknown
{
iid := "{b859ee5a-d838-4b5b-a2e8-1adc7d93db48}"
__new(ptr){
if (p=""){
DllCall("LoadLibrary","str","dwrite.dll")
DllCall("dwrite\DWriteCreateFactory","uint",0,"ptr",GUID(CLSID,"{b859ee5a-d838-4b5b-a2e8-1adc7d93db48}"),"ptr*",pIFactory)
if this.__:=pIFactory
this._v:=NumGet(this.__+0)
else return
}else if !p
return
else this.__:=p,this._v:=NumGet(this.__+0)
}
; Gets an object which represents the set of installed fonts.
GetSystemFontCollection(checkForUpdates){
DWrite_hr(DllCall(this.vt(3),"ptr",this.__
,"ptr*",fontCollection
,"int",checkForUpdates
,"uint"),"GetSystemFontCollection")
return new IDWriteFontCollection(fontCollection)
}
; Creates a font collection using a custom font collection loader.
CreateCustomFontCollection(collectionLoader,collectionKey,collectionKeySize){ ; IDWriteFontCollectionLoader
DWrite_hr(DllCall(this.vt(4),"ptr",this.__
,"ptr",IsObject(collectionLoader)?collectionLoader.__:collectionLoader
,"ptr",IsObject(collectionKey)?collectionKey[]:collectionKey
,"uint",collectionKeySize
,"ptr*",fontCollection
,"uint"),"CreateCustomFontCollection")
return new IDWriteFontCollection(fontCollection)
}
; Registers a custom font collection loader with the factory object.
; This function registers a font collection loader with DirectWrite. The font collection loader interface, which should be implemented by a singleton object, handles enumerating font files in a font collection given a particular type of key. A given instance can only be registered once. Succeeding attempts will return an error, indicating that it has already been registered. Note that font file loader implementations must not register themselves with DirectWrite inside their constructors, and must not unregister themselves inside their destructors, because registration and unregistraton operations increment and decrement the object reference count respectively. Instead, registration and unregistration with DirectWrite of font file loaders should be performed outside of the font file loader implementation.
RegisterFontCollectionLoader(fontCollectionLoader){ ; IDWriteFontCollectionLoader
return DWrite_hr(DllCall(this.vt(5),"ptr",this.__
,"ptr",IsObject(fontCollectionLoader)?fontCollectionLoader.__:fontCollectionLoader
,"uint"),"RegisterFontCollectionLoader")
}
; Unregisters a custom font collection loader that was previously registered using RegisterFontCollectionLoader.
UnregisterFontCollectionLoader(fontCollectionLoader){ ; IDWriteFontCollectionLoader
return DWrite_hr(DllCall(this.vt(6),"ptr",this.__
,"ptr",IsObject(fontCollectionLoader)?fontCollectionLoader.__:fontCollectionLoader
,"uint"),"UnregisterFontCollectionLoader")
}
; Creates a font file reference object from a local font file.
; Example demonstrates creating a font face from a font file's file name. http://msdn.microsoft.com/en-us/library/windows/desktop/dd368197%28v=vs.85%29.aspx
CreateFontFileReference(filePath,lastWriteTime=0){ ; FILETIME
DWrite_hr(DllCall(this.vt(7),"ptr",this.__
,"str",filePath
,"ptr",IsObject(lastWriteTime)?lastWriteTime[]:lastWriteTime
,"ptr*",fontFile
,"uint"),"CreateFontFileReference")
return new IDWriteFontFile(fontFile)
}
; Creates a reference to an application-specific font file resource.
; This function is provided for cases when an application or a document needs to use a private font without having to install it on the system. fontFileReferenceKey has to be unique only in the scope of the fontFileLoader used in this call.
CreateCustomFontFileReference(fontFileReferenceKey,fontFileReferenceKeySize,fontFileLoader){ IDWriteFontFileLoader
DWrite_hr(DllCall(this.vt(8),"ptr",this.__
,"ptr",IsObject(fontFileReferenceKey)?fontFileReferenceKey[]:fontFileReferenceKey
,"uint",fontFileReferenceKeySize
,"ptr",IsObject(fontFileLoader)?fontFileLoader.__:fontFileLoader
,"ptr*",fontFile
,"uint"),"CreateCustomFontFileReference")
return new IDWriteFontFile(fontFile)
}
; Creates an object that represents a font face.
CreateFontFace(fontFaceType,numberOfFiles,fontFiles,faceIndex,fontFaceSimulationFlags){ ; DWRITE_FONT_FACE_TYPE , IDWriteFontFile , DWRITE_FONT_SIMULATIONS
DWrite_hr(DllCall(this.vt(9),"ptr",this.__
,"int",fontFaceType
,"uint",numberOfFiles
,"ptr",IsObject(fontFiles)?fontFiles.__:fontFiles
,"uint",faceIndex
,"uint",fontFaceSimulationFlags
,"ptr*",fontFace
,"uint"),"CreateFontFace")
return new IDWriteFontFace(fontFace)
}
; Creates a rendering parameters object with default settings for the primary monitor. Different monitors may have different rendering parameters.
CreateRenderingParams(){
DWrite_hr(DllCall(this.vt(10),"ptr",this.__
,"ptr*",renderingParams
,"uint"),"CreateRenderingParams")
return new IDWriteRenderingParams(renderingParams)
}
; Creates a rendering parameters object with default settings for the specified monitor. In most cases, this is the preferred way to create a rendering parameters object.
CreateMonitorRenderingParams(monitor){ ; HMONITOR
DWrite_hr(DllCall(this.vt(11),"ptr",this.__
,"ptr",monitor
,"ptr*",renderingParams
,"uint"),"CreateMonitorRenderingParams")
return new IDWriteRenderingParams(renderingParams)
}
; Creates a rendering parameters object with the specified properties.
CreateCustomRenderingParams(gamma,enhancedContrast,clearTypeLevel,pixelGeometry,renderingMode){ ; DWRITE_PIXEL_GEOMETRY , DWRITE_RENDERING_MODE
DWrite_hr(DllCall(this.vt(12),"ptr",this.__
,"float",gamma
,"float",enhancedContrast
,"float",clearTypeLevel
,"int",pixelGeometry
,"int",renderingMode
,"ptr*",renderingParams
,"uint"),"CreateCustomRenderingParams")
return new IDWriteRenderingParams(renderingParams)
}
; Registers a font file loader with DirectWrite.
; This function registers a font file loader with DirectWrite. The font file loader interface, which should be implemented by a singleton object, handles loading font file resources of a particular type from a key. A given instance can only be registered once. Succeeding attempts will return an error, indicating that it has already been registered. Note that font file loader implementations must not register themselves with DirectWrite inside their constructors, and must not unregister themselves inside their destructors, because registration and unregistraton operations increment and decrement the object reference count respectively. Instead, registration and unregistration with DirectWrite of font file loaders should be performed outside of the font file loader implementation.
RegisterFontFileLoader(fontFileLoader){ ; IDWriteFontFileLoader
return DWrite_hr(DllCall(this.vt(13),"ptr",this.__
,"ptr",IsObject(fontFileLoader)?fontFileLoader.__:fontFileLoader
,"uint"),"RegisterFontFileLoader")
}
; Unregisters a font file loader that was previously registered with the DirectWrite font system using RegisterFontFileLoader.
UnregisterFontFileLoader(fontFileLoader){ ; IDWriteFontFileLoader
return DWrite_hr(DllCall(this.vt(14),"ptr",this.__
,"ptr",IsObject(fontFileLoader)?fontFileLoader.__:fontFileLoader
,"uint"),"UnregisterFontFileLoader")
}
; Creates a text format object used for text layout.
CreateTextFormat(fontFamilyName,fontCollection,fontWeight,fontStyle,fontStretch,fontSize,localeName){ ; IDWriteFontCollection , DWRITE_FONT_WEIGHT , DWRITE_FONT_STYLE , DWRITE_FONT_STRETCH
DWrite_hr(DllCall(this.vt(15),"ptr",this.__
,"str",fontFamilyName
,"ptr",IsObject(fontCollection)?fontCollection.__:fontCollection
,"int",fontWeight
,"int",fontStyle
,"int",fontStretch
,"float",fontSize
,"str",localeName
,"ptr*",textFormat
,"uint"),"CreateTextFormat")
return new IDWriteTextFormat(textFormat)
}
; Creates a typography object for use in a text layout.
CreateTypography(){
DWrite_hr(DllCall(this.vt(16),"ptr",this.__
,"ptr*",typography
,"uint"),"CreateTypography")
return new IDWriteTypography(typography)
}
; Creates an object that is used for interoperability with GDI.
GetGdiInterop(){
DWrite_hr(DllCall(this.vt(17),"ptr",this.__
,"ptr*",gdiInterop
,"uint"),"GetGdiInterop")
return new IDWriteGdiInterop(gdiInterop)
}
; Takes a string, text format, and associated constraints, and produces an object that represents the fully analyzed and formatted result.
CreateTextLayout(string,stringLength,textFormat,maxWidth,maxHeight){ ; IDWriteTextFormat
DWrite_hr(DllCall(this.vt(18),"ptr",this.__
,"str",string
,"uint",stringLength
,"ptr",IsObject(textFormat)?textFormat.__:textFormat
,"float",maxWidth
,"float",maxHeight
,"ptr*",textLayout
,"uint"),"CreateTextLayout")
return new IDWriteTextLayout(textLayout)
}
; Takes a string, format, and associated constraints, and produces an object representing the result, formatted for a particular display resolution and measuring mode.
; The resulting text layout should only be used for the intended resolution, and for cases where text scalability is desired CreateTextLayout should be used instead.
CreateGdiCompatibleTextLayout(string,stringLength,textFormat,layoutWidth,layoutHeight,pixelsPerDip,transform,useGdiNatural){ ; IDWriteTextFormat , DWRITE_MATRIX
DWrite_hr(DllCall(this.vt(19),"ptr",this.__
,"str",string
,"uint",stringLength
,"ptr",IsObject(textFormat)?textFormat.__:textFormat
,"float",layoutWidth
,"float",layoutHeight
,"float",pixelsPerDip
,"ptr",IsObject(transform)?transform[]:transform
,"int",useGdiNatural
,"ptr*",textLayout
,"uint"),"CreateGdiCompatibleTextLayout")
return new IDWriteTextLayout(textLayout)
}
; Creates an inline object for trimming, using an ellipsis as the omission sign.
; The ellipsis will be created using the current settings of the format, including base font, style, and any effects. Alternate omission signs can be created by the application by implementing IDWriteInlineObject.
CreateEllipsisTrimmingSign(textFormat){ ; IDWriteTextFormat
DWrite_hr(DllCall(this.vt(20),"ptr",this.__
,"ptr",IsObject(textFormat)?textFormat.__:textFormat
,"ptr*",trimmingSign
,"uint"),"CreateEllipsisTrimmingSign")
return new IDWriteInlineObject(trimmingSign)
}
; Returns an interface for performing text analysis.
; Example shows how a text analyzer object is created. http://msdn.microsoft.com/en-us/library/windows/desktop/dd368202%28v=vs.85%29.aspx
CreateTextAnalyzer(){
DWrite_hr(DllCall(this.vt(21),"ptr",this.__
,"ptr*",textAnalyzer
,"uint"),"CreateTextAnalyzer")
return new IDWriteTextAnalyzer(textAnalyzer)
}
; Creates a number substitution object using a locale name, substitution method, and an indicator whether to ignore user overrides (use NLS defaults for the given culture instead).
; Example shows how to create a number substitution for traditional Arabic Egyptian digits, which always display regardless of surrounding context. http://msdn.microsoft.com/en-us/library/windows/desktop/dd368200%28v=vs.85%29.aspx
CreateNumberSubstitution(substitutionMethod,localeName,ignoreUserOverride){ ; DWRITE_NUMBER_SUBSTITUTION_METHOD
DWrite_hr(DllCall(this.vt(22),"ptr",this.__
,"int",substitutionMethod
,"str",localeName
,"int",ignoreUserOverride
,"ptr*",numberSubstitution
,"uint"),"CreateNumberSubstitution")
return new IDWriteNumberSubstitution(numberSubstitution)
}
; Creates a glyph run analysis object, which encapsulates information used to render a glyph run.
; The glyph run analysis object contains the results of analyzing the glyph run, including the positions of all the glyphs and references to all of the rasterized glyphs in the font cache.
; Example shows how to create a glyph run analysis object. http://msdn.microsoft.com/en-us/library/windows/desktop/dd368198%28v=vs.85%29.aspx
CreateGlyphRunAnalysis(glyphRun,pixelsPerDip,transform,renderingMode,measuringMode,baselineOriginX,baselineOriginY){ ; DWRITE_GLYPH_RUN , DWRITE_MATRIX , DWRITE_RENDERING_MODE , DWRITE_MEASURING_MODE
DWrite_hr(DllCall(this.vt(23),"ptr",this.__
,"ptr",IsObject(glyphRun)?glyphRun[]:glyphRun
,"float",pixelsPerDip
,"ptr",IsObject(transform)?transform[]:transform
,"int",renderingMode
,"int",measuringMode
,"float",baselineOriginX
,"float",baselineOriginY
,"ptr*",glyphRunAnalysis
,"uint"),"CreateGlyphRunAnalysis")
return new IDWriteGlyphRunAnalysis(glyphRunAnalysis)
}
}
class IDWriteFontCollectionLoader extends IUnknown
{
iid := "{cca920e4-52f0-492b-bfa8-29c72ee0a468}"
; Creates a font file enumerator object that encapsulates a collection of font files. The font system calls back to this interface to create a font collection.
CreateEnumeratorFromKey(factory,collectionKey,collectionKeySize){ ; IDWriteFactory
DWrite_hr(DllCall(this.vt(3),"ptr",this.__
,"ptr",IsObject(factory)?factory.__:factory
,"ptr",IsObject(collectionKey)?collectionKey[]:collectionKey
,"uint",collectionKeySize
,"ptr*",fontFileEnumerator
,"uint"),"CreateEnumeratorFromKey")
return new IDWriteFontFileEnumerator(fontFileEnumerator)
}
}
class IDWriteFontFile extends IUnknown
{
iid := "{739d886a-cef5-47dc-8769-1a8b41bebbb0}"
; Obtains the pointer to the reference key of a font file. The returned pointer is valid until the font file object is released.
GetReferenceKey(){
DWrite_hr(DllCall(this.vt(3),"ptr",this.__
,"ptr*",fontFileReferenceKey
,"uint*",fontFileReferenceKeySize
,"uint"),"GetReferenceKey")
return [fontFileReferenceKey,fontFileReferenceKeySize]
}
; Obtains the file loader associated with a font file object.
GetLoader(){
DWrite_hr(DllCall(this.vt(4),"ptr",this.__
,"ptr*",fontFileLoader
,"uint"),"GetLoader")
return new IDWriteFontFileLoader(fontFileLoader)
}
; Analyzes a file and returns whether it represents a font, and whether the font type is supported by the font system.
; Important Certain font file types are recognized, but not supported by the font system. For example, the font system will recognize a file as a Type 1 font file but will not be able to construct a font face object from it. In such situations, Analyze will set isSupportedFontType output parameter to FALSE.
Analyze(){ ; DWRITE_FONT_FILE_TYPE , DWRITE_FONT_FACE_TYPE
DWrite_hr(DllCall(this.vt(5),"ptr",this.__
,"int*",isSupportedFontType
,"int*",fontFileType
,"int*",fontFaceType
,"uint*",numberOfFaces
,"uint"),"Analyze")
return [isSupportedFontType,fontFileType,fontFaceType,numberOfFaces]
}
}
class IDWriteFontFileStream extends IUnknown
{
iid := "{6d4865fe-0ab8-4d91-8f62-5dd6be34a3e0}"
; Reads a fragment from a font file.
; Note that ReadFileFragment implementations must check whether the requested font file fragment is within the file bounds. Otherwise, an error should be returned from ReadFileFragment.
; DirectWrite may invoke IDWriteFontFileStream methods on the same object from multiple threads simultaneously. Therefore, ReadFileFragment implementations that rely on internal mutable state must serialize access to such state across multiple threads. For example, an implementation that uses separate Seek and Read operations to read a file fragment must place the code block containing Seek and Read calls under a lock or a critical section.
ReadFileFragment(,fileOffset,fragmentSize){
DWrite_hr(DllCall(this.vt(3),"ptr",this.__
,"ptr*",fragmentStart
,"uint64",fileOffset
,"uint64",fragmentSize
,"ptr*",fragmentContext
,"uint"),"ReadFileFragment")
return [fragmentStart,fragmentContext]
}
; Releases a fragment from a file.
ReleaseFileFragment(fragmentContext){
return DWrite_hr(DllCall(this.vt(4),"ptr",this.__
,"ptr",IsObject(fragmentContext)?fragmentContext[]:fragmentContext
,"uint"),"ReleaseFileFragment")
}
; Obtains the total size of a file.
; Implementing GetFileSize() for asynchronously loaded font files may require downloading the complete file contents. Therefore, this method should be used only for operations that either require a complete font file to be loaded (for example, copying a font file) or that need to make decisions based on the value of the file size (for example, validation against a persisted file size).
GetFileSize(){
DWrite_hr(DllCall(this.vt(5),"ptr",this.__
,"uint64*",fileSize
,"uint"),"GetFileSize")
return fileSize
}
; Obtains the last modified time of the file.
; The "last modified time" is used by DirectWrite font selection algorithms to determine whether one font resource is more up to date than another one.
GetLastWriteTime(){
DWrite_hr(DllCall(this.vt(6),"ptr",this.__
,"uint64*",lastWriteTime
,"uint"),"GetLastWriteTime")
return lastWriteTime ; the number of 100-nanosecond intervals since January 1, 1601 (UTC).
}
}
class IDWriteFontFileEnumerator extends IUnknown
{
iid := "{72755049-5ff7-435d-8348-4be97cfa6c7c}"
; Advances to the next font file in the collection. When it is first created, the enumerator is positioned before the first element of the collection and the first call to MoveNext advances to the first file.
MoveNext(){
DWrite_hr(DllCall(this.vt(3),"ptr",this.__
,"int*",hasCurrentFile
,"uint"),"MoveNext")
return hasCurrentFile
}
; Gets a reference to the current font file.
GetCurrentFontFile(){
DWrite_hr(DllCall(this.vt(4),"ptr",this.__
,"ptr*",fontFile
,"uint"),"GetCurrentFontFile")
return new IDWriteFontFile(fontFile)
}
}
class IDWriteFontFace extends IUnknown
{
iid := "{5f49804d-7024-4d43-bfa9-d25984f53849}"
; Obtains the file format type of a font face.
GetType(){
return DllCall(this.vt(3),"ptr",this.__,"int") ; http://msdn.microsoft.com/en-us/library/windows/desktop/dd368063(v=vs.85).aspx
}
; Obtains the font files representing a font face.
; The IDWriteFontFace::GetFiles method should be called twice. The first time you call GetFilesfontFiles should be NULL. When the method returns, numberOfFiles receives the number of font files that represent the font face.
; Then, call the method a second time, passing the numberOfFiles value that was output the first call, and a non-null buffer of the correct size to store the IDWriteFontFile pointers.
GetFiles(){
DWrite_hr(DllCall(this.vt(4),"ptr",this.__
,"uint*",numberOfFiles
,"ptr*",fontFiles
,"uint"),"GetFiles")
return [numberOfFiles,new IDWriteFontFile(fontFiles)]
}
; Obtains the index of a font face in the context of its font files.
GetIndex(){
return DllCall(this.vt(5),"ptr",this.__,"uint")
}
; Obtains the algorithmic style simulation flags of a font face.
GetSimulations(){ ; DWRITE_FONT_SIMULATIONS
return DllCall(this.vt(6),"ptr",this.__,"int")
}
; Determines whether the font is a symbol font.
IsSymbolFont(){
return DllCall(this.vt(7),"ptr",this.__,"int")
}
; Obtains design units and common metrics for the font face. These metrics are applicable to all the glyphs within a font face and are used by applications for layout calculations.
GetMetrics(){
DllCall(this.vt(8),"ptr",this.__
,"ptr*",fontFaceMetrics)
return fontFaceMetrics ; DWRITE_FONT_METRICS
}
; Obtains the number of glyphs in the font face.
GetGlyphCount(){
return DllCall(this.vt(9),"ptr",this.__,"ushort")
}
; Obtains ideal (resolution-independent) glyph metrics in font design units.
; Design glyph metrics are used for glyph positioning.
GetDesignGlyphMetrics(glyphIndices,glyphCount,Byref glyphMetrics,isSideways){ ; DWRITE_GLYPH_METRICS
DWrite_hr(DllCall(this.vt(10),"ptr",this.__
,"ptr",IsObject(glyphIndices)?glyphIndices[]:glyphIndices
,"uint",glyphCount
,"ptr",IsObject(glyphMetrics)?glyphMetrics[]:glyphMetrics
,"uint",isSideways
,"uint"),"GetDesignGlyphMetrics")
return
}
; Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table.
; Note that this mapping is primarily provided for line layout engines built on top of the physical font API. Because of OpenType glyph substitution and line layout character substitution, the nominal conversion does not always correspond to how a Unicode string will map to glyph indices when rendering using a particular font face. Also, note that Unicode variant selectors provide for alternate mappings for character to glyph. This call will always return the default variant.
; When characters are not present in the font this method returns the index 0, which is the undefined glyph or ".notdef" glyph. If a character isn't in a font, IDWriteFont::HasCharacter returns false and GetUnicodeRanges doesn't return it in the range.
GetGlyphIndices(codePoints,codePointCount){
glyphIndices:=struct("ushort[" codePointCount "]")
DWrite_hr(DllCall(this.vt(11),"ptr",this.__
,"ptr",IsObject(codePoints)?codePoints[]:codePoints
,"uint",codePointCount
,"ptr",glyphIndices[]
,"uint"),"GetGlyphIndices")
return glyphIndices
}
; Finds the specified OpenType font table if it exists and returns a pointer to it. The function accesses the underlying font data through the IDWriteFontFileStream interface implemented by the font file loader.
; The context for the same tag may be different for each call, so each one must be held and released separately.
TryGetFontTable(openTypeTableTag){
DWrite_hr(DllCall(this.vt(12),"ptr",this.__
,"uint",openTypeTableTag
,"ptr*",tableData
,"uint*",tableSize
,"ptr*",tableContext
,"int*",exists
,"uint"),"TryGetFontTable")
return [tableData,tableSize,tableContext,exists]
}
; Releases the table obtained earlier from TryGetFontTable.
ReleaseFontTable(tableContext){ ; A pointer to the opaque context from
return DWrite_hr(DllCall(this.vt(13),"ptr",this.__
,"ptr",IsObject(tableContext)?tableContext[]:tableContext
,"uint"),"ReleaseFontTable")
}
; Computes the outline of a run of glyphs by calling back to the outline sink interface.
GetGlyphRunOutline(emSize,glyphIndices,glyphAdvances,glyphOffsets,glyphCount,isSideways,isRightToLeft,Byref geometrySink){
DWrite_hr(DllCall(this.vt(14),"ptr",this.__
,"float",emSize
,"ptr",IsObject(glyphIndices)?glyphIndices[]:glyphIndices
,"ptr",IsObject(glyphAdvances)?glyphAdvances[]:glyphAdvances
,"ptr",IsObject(glyphOffsets)?glyphOffsets[]:glyphOffsets
,"uint",glyphCount
,"int",isSideways
,"int",isRightToLeft
,"ptr",IsObject(geometrySink)?geometrySink.__:geometrySink
,"uint"),"GetGlyphRunOutline")
return
}
; Determines the recommended rendering mode for the font, using the specified size and rendering parameters.
GetRecommendedRenderingMode(emSize,pixelsPerDip,measuringMode,renderingParams,Byref renderingMode){
DWrite_hr(DllCall(this.vt(15),"ptr",this.__
,"float",emSize
,"float",pixelsPerDip
,"int",measuringMode
,"ptr",IsObject(renderingParams)?renderingParams.__:renderingParams
,"int*",renderingMode
,"uint"),"GetRecommendedRenderingMode")
return renderingMode
}
; Obtains design units and common metrics for the font face. These metrics are applicable to all the glyphs within a fontface and are used by applications for layout calculations.
GetGdiCompatibleMetrics(emSize,pixelsPerDip,transform,fontFaceMetrics=0){ ; DWRITE_MATRIX
fontFaceMetrics:=DWrite_Struct("DWRITE_FONT_METRICS")
DWrite_hr(DllCall(this.vt(16),"ptr",this.__
,"float",emSize
,"float",pixelsPerDip
,"ptr",IsObject(transform)?transform[]:transform
,"ptr",fontFaceMetrics[]
,"uint"),"GetGdiCompatibleMetrics")
return fontFaceMetrics
}
; Obtains glyph metrics in font design units with the return values compatible with what GDI would produce.
GetGdiCompatibleGlyphMetrics(emSize,pixelsPerDip,transform,useGdiNatural,glyphIndices,glyphCount,glyphMetrics,isSideways){ ; DWRITE_MATRIX
glyphMetrics:=DWrite_Struct("DWRITE_GLYPH_METRICS")
DWrite_hr(DllCall(this.vt(17),"ptr",this.__
,"float",emSize
,"float",pixelsPerDip
,"ptr",IsObject(transform)?transform[]:transform
,"int",useGdiNatural
,"ptr",IsObject(glyphIndices)?glyphIndices[]:glyphIndices
,"uint",glyphCount
,"ptr",glyphMetrics[]
,"int",isSideways
,"uint"),"GetGdiCompatibleGlyphMetrics")
return glyphMetrics
}
}
class IDWriteRenderingParams extends IUnknown
{
iid := "{2f0da53a-2add-47cd-82ee-d9ec34688e75}"
; Gets the gamma value used for gamma correction. Valid values must be greater than zero and cannot exceed 256.
; The gamma value is used for gamma correction, which compensates for the non-linear luminosity response of most monitors.
GetGamma(){
return DllCall(this.vt(3),"ptr",this.__,"float")
}
; Gets the enhanced contrast property of the rendering parameters object. Valid values are greater than or equal to zero.
; Enhanced contrast is the amount to increase the darkness of text, and typically ranges from 0 to 1. Zero means no contrast enhancement.
GetEnhancedContrast(){
return DllCall(this.vt(4),"ptr",this.__,"float")
}
; Gets the ClearType level of the rendering parameters object.
; The ClearType level represents the amount of ClearType – that is, the degree to which the red, green, and blue subpixels of each pixel are treated differently. Valid values range from zero (meaning no ClearType, which is equivalent to grayscale anti-aliasing) to one (meaning full ClearType)
GetClearTypeLevel(){
return DllCall(this.vt(5),"ptr",this.__,"float")
}
; Gets the pixel geometry of the rendering parameters object.
GetPixelGeometry(){
return DllCall(this.vt(6),"ptr",this.__,"int") ; DWRITE_PIXEL_GEOMETRY
}
; Gets the rendering mode of the rendering parameters object.
; By default, the rendering mode is initialized to DWRITE_RENDERING_MODE_DEFAULT, which means the rendering mode is determined automatically based on the font and size. To determine the recommended rendering mode to use for a given font and size and rendering parameters object, use the IDWriteFontFace::GetRecommendedRenderingMode method.
GetRenderingMode(){
return DllCall(this.vt(7),"ptr",this.__,"int") ; DWRITE_RENDERING_MODE
}
}
class IDWriteFontCollection extends IUnknown
{
iid := "{a84cee02-3eea-4eee-a827-87c1a02a0fcc}"
; Gets the number of font families in the collection.
GetFontFamilyCount(){
return DllCall(this.vt(3),"ptr",this.__,"uint")
}
; Creates a font family object given a zero-based font family index.
GetFontFamily(index){
DWrite_hr(DllCall(this.vt(4),"ptr",this.__
,"uint",index
,"ptr*",FontFamily
,"uint"),"GetFontFamily")
return new IDWriteFontFamily(FontFamily)
}
; Finds the font family with the specified family name.
FindFamilyName(familyName){
DWrite_hr(DllCall(this.vt(5),"ptr",this.__
,"str",familyName
,"uint*",index
,"int*",exists
,"uint"),"FindFamilyName")
return [index,exists]
}
; Gets the font object that corresponds to the same physical font as the specified font face object. The specified physical font must belong to the font collection.
GetFontFromFontFace(fontFace){ ; IDWriteFontFace
DWrite_hr(DllCall(this.vt(6),"ptr",this.__
,"ptr",IsObject(fontFace)?fontFace.__:fontFace
,"ptr*",font
,"uint"),"GetFontFromFontFace")
return new IDWriteFont(font)
}
}
class IDWriteFontFileLoader extends IUnknown
{
iid := "{727cad4e-d6af-4c9e-8a08-d695b11caa49}"
; Creates a font file stream object that encapsulates an open file resource.
; The resource is closed when the last reference to
CreateStreamFromKey(fontFileReferenceKey,fontFileReferenceKeySize){
DWrite_hr(DllCall(this.vt(3),"ptr",this.__
,"ptr",fontFileReferenceKey
,"uint",fontFileReferenceKeySize
,"ptr*",fontFileStream
,"uint"),"CreateStreamFromKey")
return new IDWriteFontFileStream(fontFileStream)
}
}
class IDWriteLocalFontFileLoader extends IDWriteFontFileLoader
{
iid := "{b2d9f3ec-c9fe-4a11-a2ec-d86208f7c0a2}"
; Obtains the length of the absolute file path from the font file reference key.
GetFilePathLengthFromKey(fontFileReferenceKey,fontFileReferenceKeySize){
DWrite_hr(DllCall(this.vt(4),"ptr",this.__
,"ptr",IsObject(fontFileReferenceKey)?fontFileReferenceKey[]:fontFileReferenceKey
,"uint",fontFileReferenceKeySize
,"uint*",filePathLength
,"uint"),"GetFilePathLengthFromKey")
return filePathLength
}
; Obtains the absolute font file path from the font file reference key.
GetFilePathFromKey(fontFileReferenceKey,fontFileReferenceKeySize){
VarSetCapacity(filePath,filePathSize:=1024)
DWrite_hr(DllCall(this.vt(5),"ptr",this.__
,"ptr",IsObject(fontFileReferenceKey)?fontFileReferenceKey[]:fontFileReferenceKey
,"uint",fontFileReferenceKeySize
,"ptr",&filePath
,"uint",filePathSize
,"uint"),"GetFilePathFromKey")
return StrGet(&filepath,"utf-16")
}
; Obtains the last write time of the file from the font file reference key.
GetLastWriteTimeFromKey(fontFileReferenceKey,fontFileReferenceKeySize){
lastWriteTime:=_struct("FILETIME")
DWrite_hr(DllCall(this.vt(6),"ptr",this.__
,"ptr",IsObject(fontFileReferenceKey)?fontFileReferenceKey[]:fontFileReferenceKey
,"uint",fontFileReferenceKeySize
,"ptr",lastWriteTime[]
,"uint"),"GetLastWriteTimeFromKey")
return lastWriteTime
}
}
class IDWriteTextFormat extends IUnknown
{
iid := "{9c906818-31d7-4fd3-a151-7c5e225db55a}"
; Sets the alignment of text in a paragraph, relative to the leading and trailing edge of a layout box for a IDWriteTextFormat interface.
; The text can be aligned to the leading or trailing edge of the layout box, or it can be centered. The following illustration shows text with the alignment set to DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_TEXT_ALIGNMENT_CENTER, and DWRITE_TEXT_ALIGNMENT_TRAILING, respectively.
; Note The alignment is dependent on reading direction, the above is for left-to-right reading direction. For right-to-left reading direction it would be the opposite.
SetTextAlignment(textAlignment){ ; DWRITE_TEXT_ALIGNMENT
return DWrite_hr(DllCall(this.vt(3),"ptr",this.__
,"int",textAlignment
,"uint"),"SetTextAlignment")
}
; Sets the alignment option of a paragraph relative to the layout box's top and bottom edge.
SetParagraphAlignment(paragraphAlignment){ ; DWRITE_PARAGRAPH_ALIGNMENT
return DWrite_hr(DllCall(this.vt(4),"ptr",this.__
,"int",paragraphAlignment
,"uint"),"SetParagraphAlignment")
}
; Sets the word wrapping option.
SetWordWrapping(wordWrapping){ ; DWRITE_WORD_WRAPPING
return DWrite_hr(DllCall(this.vt(5),"ptr",this.__
,"int",wordWrapping
,"uint"),"SetWordWrapping")
}
; Sets the paragraph reading direction.
SetReadingDirection(readingDirection){ ; DWRITE_READING_DIRECTION
return DWrite_hr(DllCall(this.vt(6),"ptr",this.__
,"int",readingDirection
,"uint"),"SetReadingDirection")
}
; Sets the paragraph flow direction.
SetFlowDirection(flowDirection){ ; DWRITE_FLOW_DIRECTION
return DWrite_hr(DllCall(this.vt(7),"ptr",this.__
,"int",flowDirection
,"uint"),"SetFlowDirection")
}
; Sets a fixed distance between two adjacent tab stops.
SetIncrementalTabStop(incrementalTabStop){
return DWrite_hr(DllCall(this.vt(8),"ptr",this.__
,"float",incrementalTabStop
,"uint"),"SetIncrementalTabStop")
}
; Sets trimming options for text overflowing the layout width.
SetTrimming(trimmingOptions,trimmingSign){ ; DWRITE_TRIMMING , IDWriteInlineObject
DWrite_hr(DllCall(this.vt(9),"ptr",this.__
,"ptr",IsObject(trimmingOptions)?trimmingOptions[]:trimmingOptions
,"ptr",IsObject(trimmingSign)?trimmingSign.__:trimmingSign
,"uint"),"SetTrimming")
return
}
; Sets the line spacing. For the default method, spacing depends solely on the content. For uniform spacing, the specified line height overrides the content.
SetLineSpacing(lineSpacingMethod,lineSpacing,baseline){ ; DWRITE_LINE_SPACING_METHOD
return DWrite_hr(DllCall(this.vt(10),"ptr",this.__
,"int",lineSpacingMethod
,"float",lineSpacing
,"float",baseline
,"uint"),"SetLineSpacing")
}
; Gets the alignment option of text relative to the layout box's leading and trailing edge.
GetTextAlignment(){
return DllCall(this.vt(11),"ptr",this.__,"int") ; DWRITE_TEXT_ALIGNMENT
}
; Gets the alignment option of a paragraph which is relative to the top and bottom edges of a layout box.
GetParagraphAlignment(){
return DllCall(this.vt(12),"ptr",this.__,"int") ; DWRITE_PARAGRAPH_ALIGNMENT
}
; Gets the word wrapping option.
GetWordWrapping(){
return DllCall(this.vt(13),"ptr",this.__,"int") ; DWRITE_WORD_WRAPPING
}
; Gets the current reading direction for text in a paragraph.
GetReadingDirection(){
return DllCall(this.vt(14),"ptr",this.__) ; DWRITE_READING_DIRECTION
}
; Gets the direction that text lines flow.
GetFlowDirection(){
return DllCall(this.vt(15),"ptr",this.__) ; DWRITE_FLOW_DIRECTION
}
; Gets the incremental tab stop position.
GetIncrementalTabStop(){
return DllCall(this.vt(16),"ptr",this.__,"float")
}
; Gets the trimming options for text that overflows the layout box.
GetTrimming(){
trimmingOptions:=DWrite_Struct("DWRITE_TRIMMING")
DllCall(this.vt(17),"ptr",this.__
,"ptr",trimmingOptions[]
,"ptr*",trimmingSign)
return [trimmingOptions,new IDWriteInlineObject(trimmingSign)]
}
; Gets the line spacing adjustment set for a multiline text paragraph.
GetLineSpacing(){
DWrite_hr(DllCall(this.vt(18),"ptr",this.__
,"int*",lineSpacingMethod
,"float*",lineSpacing
,"float*",baseline
,"uint"),"GetLineSpacing")
return [lineSpacingMethod,lineSpacing,baseline] ; DWRITE_LINE_SPACING_METHOD
}
; Gets the current font collection.
GetFontCollection(){
DWrite_hr(DllCall(this.vt(19),"ptr",this.__
,"ptr*",fontCollection
,"uint"),"GetFontCollection")
return new IDWriteFontCollection(fontCollection)
}
; Gets the length of the font family name.
GetFontFamilyNameLength(){
return DllCall(this.vt(20),"ptr",this.__,"uint")
}
; Gets a copy of the font family name.
GetFontFamilyName(){
VarSetCapacity(fontFamilyName,nameSize:=1024)
DllCall(this.vt(21),"ptr",this.__
,"ptr",&fontFamilyName
,"uint",nameSize)
return StrGet(&fontFamilyName,"utf-16")
}
; Gets the font weight of the text.
GetFontWeight(){
return DllCall(this.vt(22),"ptr",this.__,"int") ; DWRITE_FONT_WEIGHT
}
; Gets the font style of the text.
GetFontStyle(){
return DllCall(this.vt(23),"ptr",this.__,"int") ; DWRITE_FONT_STYLE
}
; Gets the font stretch of the text.
GetFontStretch(){
return DllCall(this.vt(24),"ptr",this.__,"int") ; DWRITE_FONT_STRETCH
}
; Gets the font size in DIP unites.
GetFontSize(){
return DllCall(this.vt(25),"ptr",this.__,"float")
}
; Gets the length of the locale name.
GetLocaleNameLength(){
return DllCall(this.vt(26),"ptr",this.__,"uint")
}
; Gets a copy of the locale name.
GetLocaleName(){
VarSetCapacity(localeName,nameSize:=1024)
DllCall(this.vt(27),"ptr",this.__
,"ptr",&localeName
,"uint",nameSize)
return StrGet(&localeName,"utf-16")
}
}
class IDWriteTypography extends IUnknown
{
iid := "{55f1112b-1dc2-4b3c-9541-f46894ed85b6}"
; Adds an OpenType font feature.
AddFontFeature(nameTag,parameter){ ; DWRITE_FONT_FEATURE_TAG
return DWrite_hr(DllCall(this.vt(3),"ptr",this.__
,"int",nameTag
,"uint",parameter
,"uint"),"AddFontFeature")
}
; Gets the number of OpenType font features for the current font.
; A single run of text can be associated with more than one typographic feature. The IDWriteTypography object holds a list of these font features.
GetFontFeatureCount(){
return DllCall(this.vt(4),"ptr",this.__,"uint")
}
; Gets the font feature at the specified index.
GetFontFeature(fontFeatureIndex){
fontFeature:=DWrite_Struct("DWRITE_FONT_FEATURE")
DWrite_hr(DllCall(this.vt(5),"ptr",this.__
,"uint",fontFeatureIndex
,"ptr",fontFeature[]
,"uint"),"GetFontFeature")
return fontFeature ; DWRITE_FONT_FEATURE
}
}
class IDWriteGdiInterop extends IUnknown
{
iid := "{1edd9491-9853-4299-898f-6432983b6f3a}"
; Creates a font object that matches the properties specified by the LOGFONT structure.
CreateFontFromLOGFONT(logFont){ ; LOGFONTW*
DWrite_hr(DllCall(this.vt(3),"ptr",this.__
,"ptr",IsObject(logFont)?logFont[]:logFont
,"ptr*",font
,"uint"),"CreateFontFromLOGFONT")
return new IDWriteFont(font)
}
; Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.
ConvertFontToLOGFONT(font){ ; IDWriteFont
logFont:=DWrite_Struct("LOGFONTW")
DWrite_hr(DllCall(this.vt(4),"ptr",this.__
,"ptr",IsObject(font)?font.__:font
,"ptr",logFont[]
,"int*",isSystemFont
,"uint"),"ConvertFontToLOGFONT")
return [logFont,isSystemFont] ; LOGFONTW*
}
; Initializes a LOGFONT structure based on the GDI-compatible properties of the specified font.
ConvertFontFaceToLOGFONT(font){ ; IDWriteFontFace
logFont:=DWrite_Struct("LOGFONTW")
DWrite_hr(DllCall(this.vt(5),"ptr",this.__
,"ptr",IsObject(font)?font.__:font
,"ptr",logFont[]
,"uint"),"ConvertFontFaceToLOGFONT")
return logFont
}
; Creates an IDWriteFontFace object that corresponds to the currently selected HFONT of the specified HDC.
; This function is intended for scenarios in which an application wants to use GDI and Uniscribe 1.x for text layout and shaping, but DirectWrite for final rendering. This function assumes the client is performing text output using glyph indexes.
CreateFontFaceFromHdc(hdc){ ; HDC
DWrite_hr(DllCall(this.vt(6),"ptr",this.__
,"ptr",hdc
,"ptr*",fontFace
,"uint"),"CreateFontFaceFromHdc")
return new IDWriteFontFace(fontFace)
}
; Creates an object that encapsulates a bitmap and memory DC (device context) which can be used for rendering glyphs.
CreateBitmapRenderTarget(hdc,width,height){
DWrite_hr(DllCall(this.vt(7),"ptr",this.__
,"uint",hdc
,"uint",width
,"uint",height
,"ptr*",renderTarget
,"uint"),"CreateBitmapRenderTarget")
return new IDWriteBitmapRenderTarget(renderTarget)
}
}
class IDWriteTextLayout extends IDWriteTextFormat
{
iid := "{53737037-6d14-410b-9bfe-0b182bb70961}"
; Sets the layout maximum width.
SetMaxWidth(maxWidth){
return DWrite_hr(DllCall(this.vt(28),"ptr",this.__
,"float",maxWidth
,"uint"),"SetMaxWidth")
}
; Sets the layout maximum height.
SetMaxHeight(maxHeight){
return DWrite_hr(DllCall(this.vt(29),"ptr",this.__
,"float",maxHeight
,"uint"),"SetMaxHeight")
}
; Sets the font collection.
SetFontCollection(fontCollection,startPosition,length){ ; IDWriteFontCollection , DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(30),"ptr",this.__
,"ptr",IsObject(fontCollection)?fontCollection.__:fontCollection
,"uint",startPosition
,"uint",length
,"uint"),"SetFontCollection")
}
; Sets null-terminated font family name for text within a specified text range.
SetFontFamilyName(fontFamilyName,startPosition,length){ ; DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(31),"ptr",this.__
,"wstr",fontFamilyName
,"uint",startPosition
,"uint",length
,"uint"),"SetFontFamilyName")
}
; Sets the font weight for text within a text range specified by a DWRITE_TEXT_RANGE structure.
; The font weight can be set to one of the predefined font weight values provided in the DWRITE_FONT_WEIGHT enumeration or an integer from 1 to 999. Values outside this range will cause the method to fail with an E_INVALIDARG return value.
SetFontWeight(fontWeight,startPosition,length){ ; DWRITE_FONT_WEIGHT , DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(32),"ptr",this.__
,"uint",fontWeight
,"uint",startPosition
,"uint",length
,"uint"),"SetFontWeight")
}
; Sets the font style for text within a text range specified by a DWRITE_TEXT_RANGE structure.
SetFontStyle(fontStyle,startPosition,length){ ; DWRITE_FONT_STYLE , DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(33),"ptr",this.__
,"int",fontStyle
,"uint",startPosition
,"uint",length
,"uint"),"SetFontStyle")
}
; Sets the font stretch for text within a specified text range.
SetFontStretch(fontStretch,startPosition,length){ ; DWRITE_FONT_STRETCH , DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(34),"ptr",this.__
,"int",fontStretch
,"uint",startPosition
,"uint",length
,"uint"),"SetFontStretch")
}
; Sets the font size in DIP units for text within a specified text range.
SetFontSize(fontSize,startPosition,length){ ; DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(35),"ptr",this.__
,"float",fontSize
,"uint",startPosition
,"uint",length
,"uint"),"SetFontSize")
}
; Sets underlining for text within a specified text range.
SetUnderline(hasUnderline,startPosition,length){ ; DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(36),"ptr",this.__
,"int",hasUnderline
,"uint",startPosition
,"uint",length
,"uint"),"SetUnderline")
}
; Sets strikethrough for text within a specified text range.
SetStrikethrough(hasStrikethrough,startPosition,length){ ; DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(37),"ptr",this.__
,"int",hasStrikethrough
,"uint",startPosition
,"uint",length
,"uint"),"SetStrikethrough")
}
; Sets the application-defined drawing effect.
; An ID2D1Brush, such as a color or gradient brush, can be set as a drawing effect if you are using the ID2D1RenderTarget::DrawTextLayout to draw text and that brush will be used to draw the specified range of text.
; This drawing effect is associated with the specified range and will be passed back to the application by way of the callback when the range is drawn at drawing time.
SetDrawingEffect(drawingEffect,startPosition,length){ ; IUnknown* , DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(38),"ptr",this.__
,"ptr",IsObject(drawingEffect)?drawingEffect.__:drawingEffect
,"uint",startPosition
,"uint",length
,"uint"),"SetDrawingEffect")
}
; Sets the inline object.
SetInlineObject(inlineObject,startPosition,length){ ; IDWriteInlineObject , DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(39),"ptr",this.__
,"ptr",IsObject(inlineObject)?inlineObject.__:inlineObject
,"uint",startPosition
,"uint",length
,"uint"),"SetInlineObject")
}
; Sets font typography features for text within a specified text range.
SetTypography(typography,startPosition,length){ ; IDWriteTypography , DWRITE_TEXT_RANGE
return DWrite_hr(DllCall(this.vt(40),"ptr",this.__