Click or drag to resize
Pdftools logo

Font Class

Inheritance Hierarchy
SystemObject
  PdfTools.Toolbox.InternalNativeBase
    PdfTools.Toolbox.InternalNativeObject
      PdfTools.Toolbox.Pdf.ContentFont

Namespace: PdfTools.Toolbox.Pdf.Content
Assembly: PdfTools.Toolbox (in PdfTools.Toolbox.dll) Version: 1.15.0+fd8f01190ac27f2191aba55ec58999be17668252
Syntax
C#
public class Font : NativeObject

The Font type exposes the following members.

Properties
 NameDescription
Public propertyAscent

The ascent of the font.

The maximum height above the baseline reached by glyphs in this font, excluding the height of glyphs for accented characters.
Public propertyBaseFont

The PostScript name of the font

Public propertyCapHeight

The cap height of the font.

The vertical coordinate of the top of flat capital letters, measured from the baseline.
Public propertyDescent

The descent of the font.

The maximum depth below the baseline reached by glyphs in this font. The value is a negative number.
Public propertyDescriptorFlags

The flags of the font descriptor.

The unmodified value of the /Flags entry of the font descriptor, as defined in ISO 32000. If the font has no font descriptor or the font descriptor has no /Flags entry, is returned.
Public propertyHasUnicodes

Specifies whether the font provides a mapping to Unicode.

If , text written with this font cannot be reliably extracted. The mapping is taken from the font's ToUnicode map or its encoding. For composite fonts and symbolic TrueType fonts without either, an installed font with the same name is used if available, so the result can depend on the fonts installed on the system.
Public propertyIsEmbedded

Specifies whether the font is embedded.

Public propertyItalicAngle

The italic angle of the font.

The angle is expressed in degrees counterclockwise from the vertical, of the dominant vertical strokes of the font. (For example, the 9-o’clock position is 90 degrees, and the 3-o’clock position is –90 degrees.) The value is negative for fonts that slope to the right, as almost all italic fonts do.
Public propertyLeading

The leading of the font.

The vertical distance between two adjacent base lines in multiline text.

This is a recomended value when generating several lines of text. If the font does not define this value, is returned.

Note that TextGenerator(Text, Font, Double, NullablePoint) uses a fixed value of 1.2 instead of this property to initialize the Leading in order to maintain backward compatibility with earlier versions.

Public propertyRawBaseFont

The unmodified PostScript name of the font

In contrast to BaseFont, the subset prefix (e.g. "ABCDEF+") is retained. For composite fonts, the name of the descendant font is returned. If the font has no /BaseFont entry, its /Name entry is returned, or "Unknown" if that is missing too.
Public propertyWeight

The visual weight of the font.

Indicates the visual weight (degree of blackness or thickness of strokes) of the characters in the font. If the font does not define this value, is returned.
Top
Methods
 NameDescription
Public methodStatic memberCreate

Create a new font object from font file data.

Supported formats are:
  • Type1
  • CFF
  • TrueType
  • OpenType
The returned font object is not yet used on any page, but it is associated with the given target document.
Public methodStatic memberCreateFromSystem

Create a new font object from an installed font.

The returned font object is not yet used on any page, but it is associated with the given target document.
Public methodEquals
(Inherited from NativeObject)
Public methodGetCharacterWidth

the width of a single glyph.

The width of a unicode character (in pt) relative to a font size of 1 pt.

If an error occurs (because the font or the owning document has already been closed) this method returns 0. But a return value of 0 is not generally an indication for failure.

Public methodGetGlyphName

the glyph name of a character code.

Only simple fonts map character codes to glyph names. For composite (CID) fonts or unmapped character codes, is returned.
Public methodGetHashCode
(Inherited from NativeObject)
Top
See Also