Click or drag to resize
CanvasFontFace Class
Represents a font, and its associated properties.
Inheritance Hierarchy
SystemObject
  Microsoft.Graphics.Canvas.TextCanvasFontFace

Namespace:  Microsoft.Graphics.Canvas.Text
Assembly:  Microsoft.Graphics.Canvas (in Microsoft.Graphics.Canvas.dll) Version: 0.0.0.0
Syntax
C#
public sealed class CanvasFontFace : IDisposable

The CanvasFontFace type exposes the following members.

Properties
  NameDescription
Public propertyAscent
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.
Public propertyCapHeight
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.
Public propertyCaretOffset
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).
Public propertyCaretSlopeRise
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).
Public propertyCaretSlopeRun
Gets the horizontal run of the caret. CaretSlopeRise / CaretSlopeRun yields the caret angle. A run value of 0 for perfectly upright fonts (non-italic).
Public propertyDescent
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.
Public propertyFaceNames
Gets a map of localized strings that contain the face names for the font (for example, Regular or Bold).
Public propertyFamilyNames
Gets a map of localized strings that contain the family name for the font (for example, Arial, Segoe UI, or Comic Sans MS).
Public propertyFileFormatType
Gets the file format type of a font face.
Public propertyGlyphBox
Gets the accumulated draw bounds of all glyphs in the font.
Public propertyGlyphCount
Gets the number of glyphs in the font.
Public propertyHasTypographicMetrics
Gets whether the ascent, descent, and lineGap are based on newer 'typographic' values in the font, rather than legacy values.
Public propertyHasVerticalGlyphVariants
Gets whether the font has any vertical glyph variants.
Public propertyIsMonospaced
Gets whether the font is monospaced; that is, all glyphs' layout boxes are equally sized and spaced apart.
Public propertyIsSymbolFont
Gets whether the font is a symbol font.
Public propertyLineGap
Gets the line gap for the font. This is the recommended additional white space to add between lines.
Public propertyLowercaseLetterHeight
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.
Public propertyPanose
Gets the PANOSE values for this font face.
Public propertySimulations
Gets the algorithmic style simulation flags of a font face.
Public propertyStretch
Gets the the degree to which the font is stretched, compared to the normal aspect ratio of that font.
Public propertyStrikethroughPosition
Gets the strikethrough position, which is relative to the Latin-script baseline.
Public propertyStrikethroughThickness
Gets the thickness of the strikethrough for this font.
Public propertyStyle
Gets whether the typeface is oblique, or italic, or the default.
Public propertySubscriptPosition
Gets the subscript position, which is relative to the baseline origin.
Public propertySubscriptSize
Gets the size of a subscript.
Public propertySuperscriptPosition
Gets the superscript position, which is relative to the baseline origin.
Public propertySuperscriptSize
Gets the size of a superscript.
Public propertyUnderlinePosition
Gets the underline position, relative to the Latin-script baseline.
Public propertyUnderlineThickness
Gets the thickness of underlines.
Public propertyUnicodeRanges
Gets a list of character ranges supported by a font.
Public propertyWeight
Gets the weight of this font.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by the CanvasFontFace.
Public methodGetGdiCompatibleGlyphMetrics
Gets the metrics and bounds of the glyphs that would get drawn, compatible with what GDI would produce, in em units.
Public methodGetGlyphIndices
Returns the nominal mapping of UCS4 Unicode code points to glyph indices as defined by the font 'CMAP' table.
Public methodGetGlyphMetrics
Gets the metrics and bounds of the glyphs that would get drawn in em units.
Public methodGetGlyphRunBounds(CanvasDrawingSession, Vector2, Single, CanvasGlyph, Boolean, UInt32)
Gets the bounds of a glyph run using this font face.
Public methodGetGlyphRunBounds(CanvasDrawingSession, Vector2, Single, CanvasGlyph, Boolean, UInt32, CanvasTextMeasuringMode)
Gets the bounds of a glyph run using this font face, using the specified measuring mode.
Public methodGetInformationalStrings
Gets an informational string contained by the font.
Public methodGetRecommendedGridFit
Determines the recommended grid fit for the font, using the specified size and rendering constraints.
Public methodGetRecommendedRenderingMode(Single, Single, CanvasTextMeasuringMode, CanvasTextRenderingParameters)
Determines the recommended rendering mode for the font, using the specified size and rendering constraints.
Public methodGetRecommendedRenderingMode(Single, Single, CanvasTextMeasuringMode, CanvasTextRenderingParameters, Matrix3x2, Boolean, CanvasAntialiasing)
Determines the recommended rendering mode for the font, using the specified size and rendering constraints.
Public methodGetSupportedTypographicFeatureNames(CanvasAnalyzedScript)
Gets an array of the supported typographic features for this font face.
Public methodGetSupportedTypographicFeatureNames(CanvasAnalyzedScript, String)
Gets an array of the supported typographic features for this font face.
Public methodGetTypographicFeatureGlyphSupport(CanvasAnalyzedScript, CanvasTypographyFeatureName, CanvasGlyph)
Gets an array of booleans, as to whether a set of glyphs can be used with the specified typographic feature.
Public methodGetTypographicFeatureGlyphSupport(CanvasAnalyzedScript, CanvasTypographyFeatureName, CanvasGlyph, String)
Gets an array of booleans, as to whether a set of glyphs can be used with the specified typographic feature.
Public methodGetVerticalGlyphVariants
Retrieves the vertical forms of the nominal glyphs retrieved from GetGlyphIndices.
Public methodHasCharacter
Gets whether this font face contains the specified unicode character.
Top
Remarks

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.

See Also