Class Font1
- Namespace
- SharpDX.DirectWrite
- Assembly
- SharpDX.Direct2D1.dll
[Guid("acd16696-8c14-4f5d-877e-fe3fc1d32738")]
public class Font1 : Font
- Inheritance
-
Font1
- Derived
- Inherited Members
Constructors
Font1(nint)
public Font1(nint nativePtr)
Parameters
nativePtr
nint
Properties
IsMonospacedFont
Determines if the font is monospaced, that is, the characters are the same fixed-pitch width (non-proportional).
public RawBool IsMonospacedFont { get; }
Property Value
- RawBool
Metrics
Obtains design units and common metrics for the font face. These metrics are applicable to all the glyphs within a font face and are used by applications for layout calculations.
public FontMetrics1 Metrics { get; }
Property Value
Panose
Gets the PANOSE values from the font and is used for font selection and matching.
public Panose Panose { get; }
Property Value
Remarks
If the font has no PANOSE values, they are set to 'any' (0) and DirectWrite doesn't simulate those values.
Methods
GetUnicodeRanges(int, UnicodeRange[], out int)
Retrieves the list of character ranges supported by a font.
public void GetUnicodeRanges(int maxRangeCount, UnicodeRange[] unicodeRanges, out int actualRangeCount)
Parameters
maxRangeCount
intThe maximum number of character ranges passed in from the client.
unicodeRanges
UnicodeRange[]An array of UnicodeRange structures that are filled with the character ranges.
actualRangeCount
intA reference to the actual number of character ranges, regardless of the maximum count.
Remarks
The list of character ranges supported by a font, is useful for scenarios like character picking, glyph display, and efficient font selection lookup. GetUnicodeRanges is similar to GDI's GetFontUnicodeRanges, except that it returns the full Unicode range, not just 16-bit UCS-2.
These ranges are from the cmap, not the OS/2::ulCodePageRange1.
If this method is unavailable, you can use the IDWriteFontFace::GetGlyphIndices method to check for missing glyphs. The method returns the 0 index for glyphs that aren't present in the font.
The IDWriteFont::HasCharacter method is often simpler in cases where you need to check a single character or a series of single characters in succession, such as in font fallback.
Operators
explicit operator Font1(nint)
public static explicit operator Font1(nint nativePtr)
Parameters
nativePtr
nint