Class FontSet
- Namespace
- SharpDX.DirectWrite
- Assembly
- SharpDX.Direct2D1.dll
[Guid("53585141-D9F8-4095-8321-D73CF6BD116B")]
public class FontSet : ComObject
- Inheritance
-
FontSet
Constructors
FontSet(nint)
public FontSet(nint nativePtr)
Parameters
nativePtr
nint
Properties
FontCount
Get the number of total fonts in the set.
public int FontCount { get; }
Property Value
Methods
FindFontFace(FontFace, out int, out RawBool)
Gets the index of the matching font face reference in the font set, with the same file, face index, and simulations.
public void FindFontFace(FontFace fontFace, out int listIndex, out RawBool exists)
Parameters
fontFace
FontFaceFont face object that specifies the physical font.
listIndex
intReceives the zero-based index of the matching font if the font was found, or UINT_MAX otherwise.
exists
RawBoolReceives TRUE if the font exists or SharpDX.Result.False otherwise.
FindFontFaceReference(FontFaceReference, out int, out RawBool)
Gets the index of the matching font face reference in the font set, with the same file, face index, and simulations.
public void FindFontFaceReference(FontFaceReference fontFaceReference, out int listIndex, out RawBool exists)
Parameters
fontFaceReference
FontFaceReferenceFont face object that specifies the physical font.
listIndex
intReceives the zero-based index of the matching font if the font was found, or UINT_MAX otherwise.
exists
RawBoolReceives TRUE if the font exists or SharpDX.Result.False otherwise.
GetFontFaceReference(int, out FontFaceReference)
Gets a reference to the font at the specified index, which may be local or remote.
public void GetFontFaceReference(int listIndex, out FontFaceReference fontFaceReference)
Parameters
listIndex
intZero-based index of the font.
fontFaceReference
FontFaceReferenceReceives a reference the font face reference object, or nullptr on failure.
GetMatchingFonts(FontProperty[], int, out FontSet)
Returns a subset of fonts filtered by the given properties.
public void GetMatchingFonts(FontProperty[] ropertiesRef, int propertyCount, out FontSet filteredSet)
Parameters
ropertiesRef
FontProperty[]List of properties to filter using.
propertyCount
intThe number of properties to filter.
filteredSet
FontSetThe subset of fonts that match the properties, or nullptr on failure.
Remarks
If no fonts matched the filter, the subset will be empty (GetFontCount returns 0), but the function does not return an error. The subset will always be equal to or less than the original set. If you only want to filter out remote fonts, you may pass null in properties and zero in propertyCount.
GetMatchingFonts(string, FontWeight, FontStretch, FontStyle, out FontSet)
Returns a subset of fonts filtered by the given properties.
public void GetMatchingFonts(string familyName, FontWeight fontWeight, FontStretch fontStretch, FontStyle fontStyle, out FontSet filteredSet)
Parameters
familyName
stringList of properties to filter using.
fontWeight
FontWeightThe number of properties to filter.
fontStretch
FontStretchThe subset of fonts that match the properties, or nullptr on failure.
fontStyle
FontStyleNo documentation.
filteredSet
FontSetThe subset of fonts that match the properties, or nullptr on failure.
Remarks
If no fonts matched the filter, the subset will be empty (GetFontCount returns 0), but the function does not return an error. The subset will always be equal to or less than the original set. If you only want to filter out remote fonts, you may pass null in properties and zero in propertyCount.
GetPropertyOccurrenceCount(ref FontProperty, out int)
Returns how many times a given property value occurs in the set.
public void GetPropertyOccurrenceCount(ref FontProperty ropertyRef, out int ropertyOccurrenceCountRef)
Parameters
ropertyRef
FontPropertyFont property of interest.
ropertyOccurrenceCountRef
intReceives how many times the property occurs.
GetPropertyValues(FontPropertyId, out StringList)
Returns all unique property values in the set, which can be used for purposes such as displaying a family list or tag cloud. Values are returned in priority order according to the language list, such that if a font contains more than one localized name, the preferred one will be returned.
public void GetPropertyValues(FontPropertyId propertyID, out StringList values)
Parameters
propertyID
FontPropertyIdFont property of interest.
values
StringListReceives a reference to the newly created strings list.
GetPropertyValues(FontPropertyId, string, out StringList)
Returns all unique property values in the set, which can be used for purposes such as displaying a family list or tag cloud. Values are returned in priority order according to the language list, such that if a font contains more than one localized name, the preferred one will be returned.
public void GetPropertyValues(FontPropertyId propertyID, string referredLocaleNamesRef, out StringList values)
Parameters
propertyID
FontPropertyIdFont property of interest.
referredLocaleNamesRef
stringList of semicolon delimited language names in preferred order. When a particular string like font family has more than one localized name, the first match is returned. For example, suppose the font set includes the Meiryo family, which has both Japanese and English family names. The returned list of distinct family names would include either the Japanese name (if "ja-jp" was specified as a preferred locale) or the English name (in all other cases).
values
StringListReceives a reference to the newly created strings list.
GetPropertyValues(int, FontPropertyId, out RawBool, out LocalizedStrings)
Returns all unique property values in the set, which can be used for purposes such as displaying a family list or tag cloud. Values are returned in priority order according to the language list, such that if a font contains more than one localized name, the preferred one will be returned.
public void GetPropertyValues(int listIndex, FontPropertyId propertyId, out RawBool exists, out LocalizedStrings values)
Parameters
listIndex
intFont property of interest.
propertyId
FontPropertyIdList of semicolon delimited language names in preferred order. When a particular string like font family has more than one localized name, the first match is returned. For example, suppose the font set includes the Meiryo family, which has both Japanese and English family names. The returned list of distinct family names would include either the Japanese name (if "ja-jp" was specified as a preferred locale) or the English name (in all other cases).
exists
RawBoolReceives a reference to the newly created strings list.
values
LocalizedStringsReceives a reference to the newly created strings list.
Operators
explicit operator FontSet(nint)
public static explicit operator FontSet(nint nativePtr)
Parameters
nativePtr
nint