CanvasFontFace Class |
Namespace: Microsoft.Graphics.Canvas.Text
public sealed class CanvasFontFace : IDisposable
The CanvasFontFace type exposes the following members.
Name | Description | |
---|---|---|
Ascent | Gets the ascent value of the font face. Ascent is the distance from the top of font character alignment box to the Latin-script baseline. | |
CapHeight | Gets the cap height value of the font face. Cap height is the distance from the Latin-script baseline to the top of a typical Latin-script capital. Capital "H" is often used as a reference character for the purpose of calculating the cap height value. | |
CaretOffset | Gets the horizontal offset of the caret along the baseline for good appearance. An offset of 0 is returned for perfectly upright fonts (non-italic). | |
CaretSlopeRise | Gets the vertical rise of the caret. CaretSlopeRise / CaretSlopeRun yields the caret angle. A rise value of 1 is returned for perfectly upright fonts (non-italic). | |
CaretSlopeRun | Gets the horizontal run of the caret. CaretSlopeRise / CaretSlopeRun yields the caret angle. A run value of 0 for perfectly upright fonts (non-italic). | |
Descent | Gets the descent value of the font face in font design units. Descent is the distance from the bottom of font character alignment box to the Latin-script baseline. | |
FaceNames | Gets a map of localized strings that contain the face names for the font (for example, Regular or Bold). | |
FamilyNames | Gets a map of localized strings that contain the family name for the font (for example, Arial, Segoe UI, or Comic Sans MS). | |
FileFormatType | Gets the file format type of a font face. | |
GlyphBox | Gets the accumulated draw bounds of all glyphs in the font. | |
GlyphCount | Gets the number of glyphs in the font. | |
HasTypographicMetrics | Gets whether the ascent, descent, and lineGap are based on newer 'typographic' values in the font, rather than legacy values. | |
HasVerticalGlyphVariants | Gets whether the font has any vertical glyph variants. | |
IsMonospaced | Gets whether the font is monospaced; that is, all glyphs' layout boxes are equally sized and spaced apart. | |
IsSymbolFont | Gets whether the font is a symbol font. | |
LineGap | Gets the line gap for the font. This is the recommended additional white space to add between lines. | |
LowercaseLetterHeight | Gets the lowercase letter height of the font face. This is the distance from the Latin-script baseline to the top of lowercase letter "x", or a similar lowercase character. | |
Panose | Gets the PANOSE values for this font face. | |
Simulations | Gets the algorithmic style simulation flags of a font face. | |
Stretch | Gets the the degree to which the font is stretched, compared to the normal aspect ratio of that font. | |
StrikethroughPosition | Gets the strikethrough position, which is relative to the Latin-script baseline. | |
StrikethroughThickness | Gets the thickness of the strikethrough for this font. | |
Style | Gets whether the typeface is oblique, or italic, or the default. | |
SubscriptPosition | Gets the subscript position, which is relative to the baseline origin. | |
SubscriptSize | Gets the size of a subscript. | |
SuperscriptPosition | Gets the superscript position, which is relative to the baseline origin. | |
SuperscriptSize | Gets the size of a superscript. | |
UnderlinePosition | Gets the underline position, relative to the Latin-script baseline. | |
UnderlineThickness | Gets the thickness of underlines. | |
UnicodeRanges | Gets a list of character ranges supported by a font. | |
Weight | Gets the weight of this font. |
Name | Description | |
---|---|---|
Dispose | Releases all resources used by the CanvasFontFace. | |
GetGdiCompatibleGlyphMetrics | Gets the metrics and bounds of the glyphs that would get drawn, compatible with what GDI would produce, in em units. | |
GetGlyphIndices | Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table. | |
GetGlyphMetrics | Gets the metrics and bounds of the glyphs that would get drawn in em units. | |
GetGlyphRunBounds(CanvasDrawingSession, Vector2, Single, CanvasGlyph, Boolean, UInt32) | Gets the bounds of a glyph run using this font face. | |
GetGlyphRunBounds(CanvasDrawingSession, Vector2, Single, CanvasGlyph, Boolean, UInt32, CanvasTextMeasuringMode) | Gets the bounds of a glyph run using this font face, using the specified measuring mode. | |
GetInformationalStrings | Gets an informational string contained by the font. | |
GetRecommendedGridFit | Determines the recommended grid fit for the font, using the specified size and rendering constraints. | |
GetRecommendedRenderingMode(Single, Single, CanvasTextMeasuringMode, CanvasTextRenderingParameters) | Determines the recommended rendering mode for the font, using the specified size and rendering constraints. | |
GetRecommendedRenderingMode(Single, Single, CanvasTextMeasuringMode, CanvasTextRenderingParameters, Matrix3x2, Boolean, CanvasAntialiasing) | Determines the recommended rendering mode for the font, using the specified size and rendering constraints. | |
GetSupportedTypographicFeatureNames(CanvasAnalyzedScript) | Gets an array of the supported typographic features for this font face. | |
GetSupportedTypographicFeatureNames(CanvasAnalyzedScript, String) | Gets an array of the supported typographic features for this font face. | |
GetTypographicFeatureGlyphSupport(CanvasAnalyzedScript, CanvasTypographyFeatureName, CanvasGlyph) | Gets an array of booleans, as to whether a set of glyphs can be used with the specified typographic feature. | |
GetTypographicFeatureGlyphSupport(CanvasAnalyzedScript, CanvasTypographyFeatureName, CanvasGlyph, String) | Gets an array of booleans, as to whether a set of glyphs can be used with the specified typographic feature. | |
GetVerticalGlyphVariants | Retrieves the vertical forms of the nominal glyphs retrieved from GetGlyphIndices. | |
HasCharacter | Gets whether this font face contains the specified unicode character. |
The recommended line spacing (baseline-to-baseline distance) for characters in the font is represented by the sum of Ascent, Descent, and LineGap. The line gap is usually positive or zero but can be negative, in which case the recommended line spacing is less than the height of the character alignment box.
When using Direct2D interop, this Win2D class corresponds to the DirectWrite interface IDWriteFontFaceReference.