This topic has not yet been rated - Rate this topic

GlyphTypeface Class

Specifies a physical font face that corresponds to a font file on the disk.

System.Object
  System.Windows.Media.GlyphTypeface

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
public class GlyphTypeface : ISupportInitialize

The GlyphTypeface type exposes the following members.

  Name Description
Public method GlyphTypeface() Initializes a new instance of the GlyphTypeface class.
Public method GlyphTypeface(Uri) Initializes a new instance of the GlyphTypeface class using the specified font file location.
Public method GlyphTypeface(Uri, StyleSimulations) Initializes a new instance of the GlyphTypeface class using the specified font file location and StyleSimulations value.
Top
  Name Description
Public property AdvanceHeights Gets the advance heights for the glyphs represented by the GlyphTypeface object.
Public property AdvanceWidths Gets the advance widths for the glyphs represented by the GlyphTypeface object.
Public property Baseline Gets the baseline value for the GlyphTypeface.
Public property BottomSideBearings Gets the distance from bottom edge of the black box to the bottom end of the advance vector for the glyphs represented by the GlyphTypeface object.
Public property CapsHeight Gets the distance from the baseline to the top of an English capital, relative to em size, for the GlyphTypeface object.
Public property CharacterToGlyphMap Gets the nominal mapping of a Unicode code point to a glyph index as defined by the font 'CMAP' table.
Public property Copyrights Gets the copyright information for the GlyphTypeface object.
Public property Descriptions Gets the description information for the GlyphTypeface object.
Public property DesignerNames Gets the designer information for the GlyphTypeface object.
Public property DesignerUrls Gets the designer URL information for the GlyphTypeface object.
Public property DistancesFromHorizontalBaselineToBlackBoxBottom Gets the offset value from the horizontal Western baseline to the bottom of the glyph black box for the glyphs represented by the GlyphTypeface object.
Public property EmbeddingRights Gets the font embedding permission for the GlyphTypeface object.
Public property FaceNames Gets the face name for the GlyphTypeface object.
Public property FamilyNames Gets the family name for the GlyphTypeface object.
Public property FontUri Gets or sets the URI for the GlyphTypeface object.
Public property GlyphCount Gets the number of glyphs for the GlyphTypeface object.
Public property Height Gets the height of the character cell relative to the em size.
Public property LeftSideBearings Gets the distance from the leading end of the advance vector to the left edge of the black box for the glyphs represented by the GlyphTypeface object.
Public property LicenseDescriptions Gets the font license description information for the GlyphTypeface object.
Public property ManufacturerNames Gets the font manufacturer information for the GlyphTypeface object.
Public property RightSideBearings Gets the distance from the right edge of the black box to the right end of the advance vector for the glyphs represented by the GlyphTypeface object.
Public property SampleTexts Gets the sample text information for the GlyphTypeface object.
Public property Stretch Gets the FontStretch value for the GlyphTypeface object.
Public property StrikethroughPosition Gets a value that indicates the distance from the baseline to the strikethrough for the typeface.
Public property StrikethroughThickness Gets a value that indicates the thickness of the strikethrough relative to the font em size.
Public property Style Gets the style for the GlyphTypeface object.
Public property StyleSimulations Gets or sets the StyleSimulations for the GlyphTypeface object.
Public property Symbol Gets a value that indicates whether the GlyphTypeface font conforms to Unicode encoding.
Public property TopSideBearings Gets the distance from the top end of the vertical advance vector to the top edge of the black box for the glyphs represented by the GlyphTypeface object.
Public property Trademarks Gets the trademark notice information for the GlyphTypeface object.
Public property UnderlinePosition Gets the position of the underline in the GlyphTypeface.
Public property UnderlineThickness Gets the thickness of the underline relative to em size.
Public property VendorUrls Gets the vendor URL information for the GlyphTypeface object.
Public property Version Gets the font face version interpreted from the font's 'NAME' table.
Public property VersionStrings Gets the version string information for the GlyphTypeface object interpreted from the font's 'NAME' table.
Public property Weight Gets the designed weight of the font represented by the GlyphTypeface object.
Public property Win32FaceNames Gets the Win32 face name for the font represented by the GlyphTypeface object.
Public property Win32FamilyNames Gets the Win32 family name for the font represented by the GlyphTypeface object.
Public property XHeight Gets the Western x-height relative to em size for the font represented by the GlyphTypeface object.
Top
  Name Description
Public method ComputeSubset Returns the binary image of the font subset based on a specified collection of glyphs.
Public method Equals Determines whether the specified object is equal to the current GlyphTypeface object. (Overrides Object.Equals(Object).)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetFontStream Returns the font file stream represented by the GlyphTypeface object.
Public method GetGlyphOutline Returns a Geometry value describing the path for a single glyph in the font.
Public method GetHashCode Serves as a hash function for GlyphTypeface. (Overrides Object.GetHashCode().)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top
  Name Description
Explicit interface implemetation Private method ISupportInitialize.BeginInit For a description of this member, see ISupportInitialize.BeginInit.
Explicit interface implemetation Private method ISupportInitialize.EndInit For a description of this member, see ISupportInitialize.EndInit.
Top

The GlyphTypeface object is a low level text object that corresponds to a single face of a font family as represented by an OpenType font file, or serialized as a block of memory in a document. The correct GlyphTypeface to use for a run of characters in a given logical font is normally determined by the WPF font system and recorded in the GlyphRun objects generated by the FormattedText object and line formatting text APIs.

The GlyphTypeface provides properties and methods for:

  • Obtaining font face common metrics, such as the ratio of ascent and descent to em size.

  • Obtaining metrics, outlines, and bitmaps for individual glyphs.

  • Serialization in a document.

The following list describes the type of application scenarios that illustrate the value of using the low-level control that the GlyphTypeface object provides.

  • A fixed format document generator may use the GlyphTypeface to obtain a binary image of the font for embedding in a document container

  • A printer driver may use the GlyphTypeface to obtain font glyph outlines or bitmaps, or the entire font image for sending to the printer.

  • A GlyphTypeface viewer application may use the GlyphTypeface to obtain metric and bitmap information.

Each glyph defines metrics that specify how it aligns with other Glyphs. The following graphic defines metric values for glyph characters.

Metric values of glyph characters

Diagraph of glyph measurements

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Strange thing
On the left figure "Advance width" includes "Left side bearing" and "right side bearing". But on the right figure "Advance width" dont include bearings. Is it correct?