[]
IDWriteFactory
[Guid("b859ee5a-d838-4b5b-a2e8-1adc7d93db48")]
public class Factory : ComObject, IDisposable, IUnknown
Initializes a new instance of the Factory class.
public Factory(IntPtr nativePtr)
nativePtr
System.IntPtrThe native pointer.
Creates a new instance of the Factory class.
public static Factory Create(FactoryType factoryType)
factoryType
FactoryTypeThe factory type.
HRESULT IDWriteFactory::CreateCustomRenderingParams([In] float gamma,[In] float enhancedContrast,[In] float clearTypeLevel,[In] DWRITE_PIXEL_GEOMETRY pixelGeometry,[In] DWRITE_RENDERING_MODE renderingMode,[Out, Fast] IDWriteRenderingParams** renderingParams)
public RenderingParams CreateCustomRenderingParams(float gamma, float enhancedContrast, float clearTypeLevel, PixelGeometry pixelGeometry, RenderingMode renderingMode)
gamma
floatenhancedContrast
floatclearTypeLevel
floatpixelGeometry
PixelGeometryrenderingMode
RenderingModeHRESULT IDWriteFactory::CreateEllipsisTrimmingSign([In] IDWriteTextFormat* textFormat,[Out, Fast] IDWriteInlineObject** trimmingSign)
public EllipsisTrimming CreateEllipsisTrimmingSign(TextFormat textFormat)
textFormat
TextFormatHRESULT IDWriteFactory::CreateFontFace([In] DWRITE_FONT_FACE_TYPE fontFaceType,[In] unsigned int numberOfFiles,[In, Buffer] const IDWriteFontFile** fontFiles,[In] unsigned int faceIndex,[In] DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags,[Out, Fast] IDWriteFontFace** fontFace)
public FontFace CreateFontFace(FontFaceType fontFaceType, int numberOfFiles, ComArray<FontFile> fontFiles, int faceIndex, FontSimulations fontFaceSimulationFlags)
fontFaceType
FontFaceTypenumberOfFiles
intfontFiles
ComArray<FontFile>faceIndex
intfontFaceSimulationFlags
FontSimulationsHRESULT IDWriteFactory::CreateFontFace([In] DWRITE_FONT_FACE_TYPE fontFaceType,[In] unsigned int numberOfFiles,[In, Buffer] const IDWriteFontFile** fontFiles,[In] unsigned int faceIndex,[In] DWRITE_FONT_SIMULATIONS fontFaceSimulationFlags,[Out, Fast] IDWriteFontFace** fontFace)
public FontFace CreateFontFace(FontFaceType fontFaceType, int numberOfFiles, FontFile[] fontFiles, int faceIndex, FontSimulations fontFaceSimulationFlags)
fontFaceType
FontFaceTypenumberOfFiles
intfontFiles
FontFile[]faceIndex
intfontFaceSimulationFlags
FontSimulationsHRESULT IDWriteFactory::CreateFontFileReference([In] const wchar_t* filePath,[In, Optional] const FILETIME* lastWriteTime,[Out, Fast] IDWriteFontFile** fontFile)
public FontFile CreateFontFileReference(string filePath, long? lastWriteTime)
filePath
stringlastWriteTime
long?HRESULT IDWriteFactory::CreateGdiCompatibleTextLayout([In, Buffer] const wchar_t* string,[In] unsigned int stringLength,[In] IDWriteTextFormat* textFormat,[In] float layoutWidth,[In] float layoutHeight,[In] float pixelsPerDip,[In, Optional] const DWRITE_MATRIX* transform,[In] BOOL useGdiNatural,[Out, Fast] IDWriteTextLayout** textLayout)
public TextLayout CreateGdiCompatibleTextLayout(string text, int stringLength, TextFormat textFormat, float layoutWidth, float layoutHeight, float pixelsPerDip, Matrix3x2? transform, Bool useGdiNatural)
text
stringstringLength
inttextFormat
TextFormatlayoutWidth
floatlayoutHeight
floatpixelsPerDip
floattransform
Matrix3x2?useGdiNatural
BoolHRESULT IDWriteFactory::CreateGdiCompatibleTextLayout([In, Buffer] const wchar_t* string,[In] unsigned int stringLength,[In] IDWriteTextFormat* textFormat,[In] float layoutWidth,[In] float layoutHeight,[In] float pixelsPerDip,[In, Optional] const DWRITE_MATRIX* transform,[In] BOOL useGdiNatural,[Out, Fast] IDWriteTextLayout** textLayout)
public TextLayout1 CreateGdiCompatibleTextLayout1(string text, int stringLength, TextFormat textFormat, float layoutWidth, float layoutHeight, float pixelsPerDip, Matrix3x2? transform, Bool useGdiNatural)
text
stringstringLength
inttextFormat
TextFormatlayoutWidth
floatlayoutHeight
floatpixelsPerDip
floattransform
Matrix3x2?useGdiNatural
BoolHRESULT IDWriteFactory::CreateGlyphRunAnalysis([In] const DWRITE_GLYPH_RUN* glyphRun,[In] float pixelsPerDip,[In, Optional] const DWRITE_MATRIX* transform,[In] DWRITE_RENDERING_MODE renderingMode,[In] DWRITE_MEASURING_MODE measuringMode,[In] float baselineOriginX,[In] float baselineOriginY,[Out, Fast] IDWriteGlyphRunAnalysis** glyphRunAnalysis)
public GlyphRunAnalysis CreateGlyphRunAnalysis(GlyphRun glyphRun, float pixelsPerDip, Matrix3x2? transform, RenderingMode renderingMode, MeasuringMode measuringMode, float baselineOriginX, float baselineOriginY)
glyphRun
GlyphRunpixelsPerDip
floattransform
Matrix3x2?renderingMode
RenderingModemeasuringMode
MeasuringModebaselineOriginX
floatbaselineOriginY
floatHRESULT IDWriteFactory::CreateMonitorRenderingParams([In] HMONITOR monitor,[Out, Fast] IDWriteRenderingParams** renderingParams)
public RenderingParams CreateMonitorRenderingParams(IntPtr monitor)
monitor
System.IntPtrHRESULT IDWriteFactory::CreateNumberSubstitution([In] DWRITE_NUMBER_SUBSTITUTION_METHOD substitutionMethod,[In] const wchar_t* localeName,[In] BOOL ignoreUserOverride,[Out, Fast] IDWriteNumberSubstitution** numberSubstitution)
public NumberSubstitution CreateNumberSubstitution(NumberSubstitutionMethod substitutionMethod, string localeName, Bool ignoreUserOverride)
substitutionMethod
NumberSubstitutionMethodlocaleName
stringignoreUserOverride
BoolHRESULT IDWriteFactory::CreateRenderingParams([Out, Fast] IDWriteRenderingParams** renderingParams)
public RenderingParams CreateRenderingParams()
HRESULT IDWriteFactory::CreateTextAnalyzer([Out, Fast] IDWriteTextAnalyzer** textAnalyzer)
public TextAnalyzer CreateTextAnalyzer()
HRESULT IDWriteFactory::CreateTextFormat([In] const wchar_t* fontFamilyName,[In, Optional] IDWriteFontCollection* fontCollection,[In] DWRITE_FONT_WEIGHT fontWeight,[In] DWRITE_FONT_STYLE fontStyle,[In] DWRITE_FONT_STRETCH fontStretch,[In] float fontSize,[In] const wchar_t* localeName,[Out, Fast] IDWriteTextFormat** textFormat)
public TextFormat CreateTextFormat(string fontFamilyName, FontCollection fontCollection, FontWeight fontWeight, FontStyle fontStyle, FontStretch fontStretch, float fontSize, string localeName)
fontFamilyName
stringfontCollection
FontCollectionfontWeight
FontWeightfontStyle
FontStylefontStretch
FontStretchfontSize
floatlocaleName
stringHRESULT IDWriteFactory::CreateTextLayout([In, Buffer] const wchar_t* string,[In] unsigned int stringLength,[In] IDWriteTextFormat* textFormat,[In] float maxWidth,[In] float maxHeight,[Out, Fast] IDWriteTextLayout** textLayout)
public TextLayout CreateTextLayout(string text, int stringLength, TextFormat textFormat, float maxWidth, float maxHeight)
text
stringstringLength
inttextFormat
TextFormatmaxWidth
floatmaxHeight
floatHRESULT IDWriteFactory::CreateTextLayout([In, Buffer] const wchar_t* string,[In] unsigned int stringLength,[In] IDWriteTextFormat* textFormat,[In] float maxWidth,[In] float maxHeight,[Out, Fast] IDWriteTextLayout** textLayout)
public TextLayout1 CreateTextLayout1(string text, int stringLength, TextFormat textFormat, float maxWidth, float maxHeight)
text
stringstringLength
inttextFormat
TextFormatmaxWidth
floatmaxHeight
floatHRESULT IDWriteFactory::CreateTypography([Out, Fast] IDWriteTypography** typography)
public Typography CreateTypography()
HRESULT IDWriteFactory::GetGdiInterop([Out] IDWriteGdiInterop** gdiInterop)
public GdiInterop GetGdiInterop()
HRESULT IDWriteFactory::GetSystemFontCollection([Out] IDWriteFontCollection** fontCollection,[In] BOOL checkForUpdates)
public FontCollection GetSystemFontCollection(Bool checkForUpdates)
checkForUpdates
BoolRegisters a custom font collection loader with the factory object.
public void RegisterFontCollectionLoader(IFontCollectionLoader fontCollectionLoader)
fontCollectionLoader
IFontCollectionLoaderReference to a IFontCollectionLoader object to be registered.
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.
Registers a font file loader with DirectWrite.
public void RegisterFontFileLoader(IFontFileLoader fontFileLoader)
fontFileLoader
IFontFileLoaderPointer to a IFontFileLoader object for a particular file resource type.
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.
Unregisters a custom font collection loader that was previously registered using {{RegisterFontCollectionLoader}}.
public void UnregisterFontCollectionLoader(IFontCollectionLoader fontCollectionLoader)
fontCollectionLoader
IFontCollectionLoaderPointer to a IFontCollectionLoader object to be unregistered.
Unregisters a font file loader that was previously registered with the DirectWrite font system using {{RegisterFontFileLoader}}.
public void UnregisterFontFileLoader(IFontFileLoader fontFileLoader)
fontFileLoader
IFontFileLoaderPointer to the file loader that was previously registered with the DirectWrite font system using {{RegisterFontFileLoader}}.
This function unregisters font file loader callbacks with the DirectWrite font system. You should implement the font file loader interface by a singleton object. Note that font file loader implementations must not register themselves with DirectWrite inside their constructors and must not unregister themselves in their destructors, because registration and unregistraton operations increment and decrement the object reference count respectively. Instead, registration and unregistration of font file loaders with DirectWrite should be performed outside of the font file loader implementation.
Performs an explicit conversion from System.IntPtr to Factory.
public static explicit operator Factory(IntPtr nativePointer)
nativePointer
System.IntPtr