[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.DirectWrite.Factory

Class Factory

Namespace
GrapeCity.Documents.DX.DirectWrite
Assembly
GcDocs.DX.Windows.dll

IDWriteFactory

[Guid("b859ee5a-d838-4b5b-a2e8-1adc7d93db48")]
public class Factory : ComObject, IDisposable, IUnknown
Inheritance
object
Factory
Implements
System.IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Constructors

Factory(IntPtr)

Initializes a new instance of the Factory class.

public Factory(IntPtr nativePtr)

Parameters

nativePtr System.IntPtr

The native pointer.

Methods

Create(FactoryType)

Creates a new instance of the Factory class.

public static Factory Create(FactoryType factoryType)

Parameters

factoryType FactoryType

The factory type.

Returns

Factory

CreateCustomRenderingParams(float, float, float, PixelGeometry, RenderingMode)

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)

Parameters

gamma float
enhancedContrast float
clearTypeLevel float
pixelGeometry PixelGeometry
renderingMode RenderingMode

Returns

RenderingParams

CreateEllipsisTrimmingSign(TextFormat)

HRESULT IDWriteFactory::CreateEllipsisTrimmingSign([In] IDWriteTextFormat* textFormat,[Out, Fast] IDWriteInlineObject** trimmingSign)

public EllipsisTrimming CreateEllipsisTrimmingSign(TextFormat textFormat)

Parameters

textFormat TextFormat

Returns

EllipsisTrimming

CreateFontFace(FontFaceType, int, ComArray<FontFile>, int, FontSimulations)

HRESULT 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)

Parameters

fontFaceType FontFaceType
numberOfFiles int
fontFiles ComArray<FontFile>
faceIndex int
fontFaceSimulationFlags FontSimulations

Returns

FontFace

CreateFontFace(FontFaceType, int, FontFile[], int, FontSimulations)

HRESULT 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)

Parameters

fontFaceType FontFaceType
numberOfFiles int
fontFiles FontFile[]
faceIndex int
fontFaceSimulationFlags FontSimulations

Returns

FontFace

CreateFontFileReference(string, long?)

HRESULT IDWriteFactory::CreateFontFileReference([In] const wchar_t* filePath,[In, Optional] const FILETIME* lastWriteTime,[Out, Fast] IDWriteFontFile** fontFile)

public FontFile CreateFontFileReference(string filePath, long? lastWriteTime)

Parameters

filePath string
lastWriteTime long?

Returns

FontFile

CreateGdiCompatibleTextLayout(string, int, TextFormat, float, float, float, Matrix3x2?, Bool)

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)

Parameters

text string
stringLength int
textFormat TextFormat
layoutWidth float
layoutHeight float
pixelsPerDip float
transform Matrix3x2?
useGdiNatural Bool

Returns

TextLayout

CreateGdiCompatibleTextLayout1(string, int, TextFormat, float, float, float, Matrix3x2?, Bool)

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 TextLayout1 CreateGdiCompatibleTextLayout1(string text, int stringLength, TextFormat textFormat, float layoutWidth, float layoutHeight, float pixelsPerDip, Matrix3x2? transform, Bool useGdiNatural)

Parameters

text string
stringLength int
textFormat TextFormat
layoutWidth float
layoutHeight float
pixelsPerDip float
transform Matrix3x2?
useGdiNatural Bool

Returns

TextLayout1

CreateGlyphRunAnalysis(GlyphRun, float, Matrix3x2?, RenderingMode, MeasuringMode, float, float)

HRESULT 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)

Parameters

glyphRun GlyphRun
pixelsPerDip float
transform Matrix3x2?
renderingMode RenderingMode
measuringMode MeasuringMode
baselineOriginX float
baselineOriginY float

Returns

GlyphRunAnalysis

CreateMonitorRenderingParams(IntPtr)

HRESULT IDWriteFactory::CreateMonitorRenderingParams([In] HMONITOR monitor,[Out, Fast] IDWriteRenderingParams** renderingParams)

public RenderingParams CreateMonitorRenderingParams(IntPtr monitor)

Parameters

monitor System.IntPtr

Returns

RenderingParams

CreateNumberSubstitution(NumberSubstitutionMethod, string, Bool)

HRESULT 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)

Parameters

substitutionMethod NumberSubstitutionMethod
localeName string
ignoreUserOverride Bool

Returns

NumberSubstitution

CreateRenderingParams()

HRESULT IDWriteFactory::CreateRenderingParams([Out, Fast] IDWriteRenderingParams** renderingParams)

public RenderingParams CreateRenderingParams()

Returns

RenderingParams

CreateTextAnalyzer()

HRESULT IDWriteFactory::CreateTextAnalyzer([Out, Fast] IDWriteTextAnalyzer** textAnalyzer)

public TextAnalyzer CreateTextAnalyzer()

Returns

TextAnalyzer

CreateTextFormat(string, FontCollection, FontWeight, FontStyle, FontStretch, float, string)

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)

Parameters

fontFamilyName string
fontCollection FontCollection
fontWeight FontWeight
fontStyle FontStyle
fontStretch FontStretch
fontSize float
localeName string

Returns

TextFormat

CreateTextLayout(string, int, TextFormat, float, float)

HRESULT 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)

Parameters

text string
stringLength int
textFormat TextFormat
maxWidth float
maxHeight float

Returns

TextLayout

CreateTextLayout1(string, int, TextFormat, float, float)

HRESULT 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)

Parameters

text string
stringLength int
textFormat TextFormat
maxWidth float
maxHeight float

Returns

TextLayout1

CreateTypography()

HRESULT IDWriteFactory::CreateTypography([Out, Fast] IDWriteTypography** typography)

public Typography CreateTypography()

Returns

Typography

GetGdiInterop()

HRESULT IDWriteFactory::GetGdiInterop([Out] IDWriteGdiInterop** gdiInterop)

public GdiInterop GetGdiInterop()

Returns

GdiInterop

GetSystemFontCollection(Bool)

HRESULT IDWriteFactory::GetSystemFontCollection([Out] IDWriteFontCollection** fontCollection,[In] BOOL checkForUpdates)

public FontCollection GetSystemFontCollection(Bool checkForUpdates)

Parameters

checkForUpdates Bool

Returns

FontCollection

RegisterFontCollectionLoader(IFontCollectionLoader)

Registers a custom font collection loader with the factory object.

public void RegisterFontCollectionLoader(IFontCollectionLoader fontCollectionLoader)

Parameters

fontCollectionLoader IFontCollectionLoader

Reference to a IFontCollectionLoader object to be registered.

Remarks

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.

RegisterFontFileLoader(IFontFileLoader)

Registers a font file loader with DirectWrite.

public void RegisterFontFileLoader(IFontFileLoader fontFileLoader)

Parameters

fontFileLoader IFontFileLoader

Pointer to a IFontFileLoader object for a particular file resource type.

Remarks

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.

UnregisterFontCollectionLoader(IFontCollectionLoader)

Unregisters a custom font collection loader that was previously registered using {{RegisterFontCollectionLoader}}.

public void UnregisterFontCollectionLoader(IFontCollectionLoader fontCollectionLoader)

Parameters

fontCollectionLoader IFontCollectionLoader

Pointer to a IFontCollectionLoader object to be unregistered.

UnregisterFontFileLoader(IFontFileLoader)

Unregisters a font file loader that was previously registered with the DirectWrite font system using {{RegisterFontFileLoader}}.

public void UnregisterFontFileLoader(IFontFileLoader fontFileLoader)

Parameters

fontFileLoader IFontFileLoader

Pointer to the file loader that was previously registered with the DirectWrite font system using {{RegisterFontFileLoader}}.

Remarks

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.

Operators

explicit operator Factory(IntPtr)

Performs an explicit conversion from System.IntPtr to Factory.

public static explicit operator Factory(IntPtr nativePointer)

Parameters

nativePointer System.IntPtr

Returns

Factory