Click or drag to resize

PdfFontMetrics Class

This class contains tools for measuring text that is to be placed in a page in a PDF document. Concrete versions of this class are constructed behind the scenes for client code. It is unlikely that client code would ever need to create or construct a concrete version of this class. FontBounds, Ascent, Descent, and Leading are measured in PDF font design units, in which glyph coordinates are laid out in a design grid that is 1000 units by 1000 units. In practice, glyphs will go outside this grid for descender and for glyphs that project to the left (swashes, for example). To convert these numbers to a particular point size, use this formula: final size = (size in PDF design units x font size in points) / 1000
Inheritance Hierarchy

Namespace:  Atalasoft.PdfDoc.Generating.ResourceHandling.Fonts
Assembly:  Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: (.NET 4.5.2, x86)
public abstract class PdfFontMetrics

The PdfFontMetrics type exposes the following members.

Protected methodPdfFontMetrics
Initializes a new instance of the PdfFontMetrics class
Public propertyCode exampleAscent
Gets the ascent of the font in PDF font design units.
Public propertyCode exampleDescent
Gets the descent of the font in PDF font design units. The Descent is the distance that the font extends below the baseline of the font. Descent is usually negative.
Public propertyCode exampleFontBounds
Gets the smallest bounding box that can surround all glyphs within the font. Units are in PDF font design units.
Public propertyCode exampleLeading
Gets the recommended leading for this font in PDF font design units. This should be the height of the gap between lines, not the distance between baselines of successive lines. The distance between successive lines will be Ascent - Descent + Leading.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Protected methodGetCharMetrics
Gets the metrics for a given character using the specified transform. This method is implemented by concrete instances of PdfFontMetrics. Client code will not typically create subclasses of PdfFontMetrics.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodCode exampleGetTextBounds(Double, String)
Gets bounding box that surrounds the text.
Public methodCode exampleGetTextBounds(Double, String, Int32, Int32)
Gets bounding box that surrounds the text.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodLineSpacing
Measures the line spacing for a font in a given point size.
Public methodCode exampleMeasureText(Double, String)
Measures the given text in the provided font size in points.
Public methodCode exampleMeasureText(Double, String, Int32, Int32)
Measures the given text in the provided font size in points.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
See Also