Class FontCollection
- Namespace
- SharpDX.DirectWrite
- Assembly
- SharpDX.Direct2D1.dll
[Guid("a84cee02-3eea-4eee-a827-87c1a02a0fcc")]
public class FontCollection : ComObject
- Inheritance
-
FontCollection
- Derived
Constructors
FontCollection(Factory, FontCollectionLoader, DataPointer)
Creates a font collection using a custom font collection loader.
public FontCollection(Factory factory, FontCollectionLoader collectionLoader, DataPointer collectionKey)
Parameters
factory
FactoryA reference to a DirectWrite factory Factory
collectionLoader
FontCollectionLoaderAn application-defined font collection loader, which must have been previously registered using SharpDX.DirectWrite.Factory.RegisterFontCollectionLoader_(SharpDX.DirectWrite.FontCollectionLoader).
collectionKey
DataPointerThe key used by the loader to identify a collection of font files. The buffer allocated for this key should at least be the size of collectionKeySize.
FontCollection(nint)
public FontCollection(nint nativePtr)
Parameters
nativePtr
nint
Properties
FontFamilyCount
Gets the number of font families in the collection.
public int FontFamilyCount { get; }
Property Value
Methods
FindFamilyName(string, out int)
Finds the font family with the specified family name.
public RawBool FindFamilyName(string familyName, out int index)
Parameters
familyName
stringAn array of characters, which is null-terminated, containing the name of the font family. The name is not case-sensitive but must otherwise exactly match a family name in the collection.
index
intWhen this method returns, contains the zero-based index of the matching font family if the family name was found; otherwise, UINT_MAX.
Returns
- RawBool
When this method returns, TRUE if the family name exists; otherwise, SharpDX.Result.False.
GetFontFamily(int)
Creates a font family object given a zero-based font family index.
public FontFamily GetFontFamily(int index)
Parameters
index
intZero-based index of the font family.
Returns
- FontFamily
When this method returns, contains the address of a reference to the newly created font family object.
GetFontFromFontFace(FontFace)
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.
public Font GetFontFromFontFace(FontFace fontFace)
Parameters
fontFace
FontFaceA font face object that specifies the physical font.
Returns
- Font
When this method returns, contains the address of a reference to the newly created font object if successful; otherwise,
null
.
Operators
explicit operator FontCollection(nint)
public static explicit operator FontCollection(nint nativePtr)
Parameters
nativePtr
nint