[]
IDWriteFontFile
[Guid("739d886a-cef5-47dc-8769-1a8b41bebbb0")]
public class FontFile : ComObject, IDisposable, IUnknown
Initializes a new instance of the FontFile class.
public FontFile(IntPtr nativePtr)
nativePtr
System.IntPtrThe native pointer.
Obtains the file loader associated with a font file object.
public IFontFileLoader Loader { get; }
HRESULT IDWriteFontFile::Analyze([Out] BOOL* isSupportedFontType,[Out] DWRITE_FONT_FILE_TYPE* fontFileType,[Out, Optional] DWRITE_FONT_FACE_TYPE* fontFaceType,[Out] unsigned int* numberOfFaces)
public void Analyze(out Bool isSupportedFontType, out FontFileType fontFileType, out FontFaceType fontFaceType, out int numberOfFaces)
isSupportedFontType
BoolfontFileType
FontFileTypefontFaceType
FontFaceTypenumberOfFaces
intCreates a reference to an application-specific font file resource.
public static FontFile Create(Factory factory, IntPtr fontFileReferenceKey, int fontFileReferenceKeySize, IFontFileLoader fontFileLoader)
factory
FactoryA reference to a DirectWrite factory Factory
fontFileReferenceKey
System.IntPtrA font file reference key that uniquely identifies the font file resource during the lifetime of fontFileLoader.
fontFileReferenceKeySize
intThe size of the font file reference key in bytes.
fontFileLoader
IFontFileLoaderThe font file loader that will be used by the font system to load data from the file identified by fontFileReferenceKey.
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.
Creates a font file reference object from a local font file.
public static FontFile Create(Factory factory, string filePath, long? lastWriteTime)
factory
FactoryA reference to a DirectWrite factory Factory
filePath
stringAn array of characters that contains the absolute file path for the font file. Subsequent operations on the constructed object may fail if the user provided filePath doesn't correspond to a valid file on the disk.
lastWriteTime
long?The last modified time of the input file path. If the parameter is omitted, the function will access the font file to obtain its last write time. You should specify this value to avoid extra disk access. Subsequent operations on the constructed object may fail if the user provided lastWriteTime doesn't match the file on the disk.
Creates a font file reference object from a local font file.
public static FontFile Create(Factory factory, string filePath)
factory
FactoryA reference to a DirectWrite factory Factory
filePath
stringAn array of characters that contains the absolute file path for the font file. Subsequent operations on the constructed object may fail if the user provided filePath doesn't correspond to a valid file on the disk.
HRESULT IDWriteFontFile::GetLoader([Out] IDWriteFontFileLoader** fontFileLoader)
public IFontFileLoader GetLoader()
Obtains the reference to the reference key of a font file. The returned reference is valid until the font file object is released.
public DataPointer GetReferenceKey()
the reference to the reference key of a font file.
HRESULT IDWriteFontFile::GetReferenceKey([Out, Buffer] const void** fontFileReferenceKey,[Out] unsigned int* fontFileReferenceKeySize)
public int GetReferenceKey(IntPtr fontFileReferenceKey)
fontFileReferenceKey
System.IntPtrPerforms an explicit conversion from System.IntPtr to FontFile.
public static explicit operator FontFile(IntPtr nativePointer)
nativePointer
System.IntPtr