Class Factory
- Namespace
- SharpDX.DirectWrite
- Assembly
- SharpDX.Direct2D1.dll
[Guid("b859ee5a-d838-4b5b-a2e8-1adc7d93db48")]
public class Factory : ComObject
- Inheritance
-
Factory
- Derived
Constructors
Factory()
Default Constructor for a Factory.
public Factory()
Factory(FactoryType)
Default Constructor for a Factory.
public Factory(FactoryType factoryType)
Parameters
factoryType
FactoryType
Factory(nint)
public Factory(nint nativePtr)
Parameters
nativePtr
nint
Properties
GdiInterop
Creates an object that is used for interoperability with GDI.
public GdiInterop GdiInterop { get; }
Property Value
Methods
GetSystemFontCollection(RawBool)
Gets an object which represents the set of installed fonts.
public FontCollection GetSystemFontCollection(RawBool checkForUpdates)
Parameters
checkForUpdates
RawBoolIf this parameter is nonzero, the function performs an immediate check for changes to the set of installed fonts. If this parameter is SharpDX.Result.False, the function will still detect changes if the font cache service is running, but there may be some latency. For example, an application might specify TRUE if it has itself just installed a font and wants to be sure the font collection contains that font.
Returns
- FontCollection
When this method returns, contains the address of a reference to the system font collection object, or
null
in case of failure.
RegisterFontCollectionLoader(FontCollectionLoader)
Registers a custom font collection loader with the factory object.
public void RegisterFontCollectionLoader(FontCollectionLoader fontCollectionLoader)
Parameters
fontCollectionLoader
FontCollectionLoaderReference to a FontCollectionLoader 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 unregistration 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)
Registers a font file loader with DirectWrite.
public void RegisterFontFileLoader(FontFileLoader fontFileLoader)
Parameters
fontFileLoader
FontFileLoaderPointer to a FontFileLoader 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 unregistration 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(FontCollectionLoader)
Unregisters a custom font collection loader that was previously registered using {{RegisterFontCollectionLoader}}.
public void UnregisterFontCollectionLoader(FontCollectionLoader fontCollectionLoader)
Parameters
fontCollectionLoader
FontCollectionLoaderPointer to a FontCollectionLoader object to be unregistered.
UnregisterFontFileLoader(FontFileLoader)
Unregisters a font file loader that was previously registered with the DirectWrite font system using {{RegisterFontFileLoader}}.
public void UnregisterFontFileLoader(FontFileLoader fontFileLoader)
Parameters
fontFileLoader
FontFileLoaderPointer 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 unregistration 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(nint)
public static explicit operator Factory(nint nativePtr)
Parameters
nativePtr
nint