Click or drag to resize

Font Class

A font that is used to draw text on a page. It corresponds to a Font Resource in a PDF file. More than one page may reference the same Font object. A Font has a number of attributes, including an Array of widths, the Character encoding, and the font's resource name. PDF document can contain several different types of fonts and Font class represents a single, flat interface around all PDF font types. There are two main classes of fonts in PDF: simple and composite fonts. Simple fonts are Type1, TrueType, and Type3 fonts. All simple fonts have the following properties:
  • Glyphs in the font are selected by single-byte Character codes obtained from a string that is shown by the text-showing operators. Logically, these codes index into a table of 256 glyphs; the mapping from codes to glyphs is called the font's encoding. Each font program has a built-in encoding. Under some circumstances, the encoding can be altered by means described in Section 5.5.5 "Character Encoding" in PDF Reference Manual.
  • Each glyph has a single set of metrics. Therefore simple fonts support only horizontal writing mode.
A composite font is one whose glyphs are obtained from a font like object called a CIDFont (e.g. CIDType0Font and CIDType0Font). A composite font is represented by a font dictionary whose Subtype value is Type0. The Type 0 font is known as the root font, while its associated CIDFont is called its descendant. CID-keyed fonts provide a convenient and efficient method for defining multiple-byte Character encodings and fonts with a large number of glyphs. These capabilities provide great flexibility for representing text in writing systems for languages with large Character sets, such as Chinese, Japanese, and Korean (CJK).
Defines the font of the stamp. (This only applies to text-based stamps)
Inheritance Hierarchy
SystemObject
  pdftron.PDFFont

Namespace:  pdftron.PDF
Assembly:  pdftron (in pdftron.dll) Version: 255.255.255.255
Syntax
public sealed class Font : IClosable

The Font type exposes the following members.

Constructors
  NameDescription
Public methodFont
Instantiates a new font.
Top
Methods
  NameDescription
Public methodClose
Public methodStatic memberCreate(Obj)
Creates a PDF::Font object.
Public methodStatic memberCreate(PDFDoc, FontStandardType1Font)
Creates a PDF::Font object for the given standard (also known as base 14 font).
Public methodStatic memberCreate(SDFDoc, FontStandardType1Font)
Creates a PDF::Font object for the given standard (also known as base 14 font).
Public methodStatic memberCreate(PDFDoc, Font, String)
Create a new Unicode font based on the description of an existing PDF font.
Public methodStatic memberCreate(PDFDoc, FontStandardType1Font, Boolean)
Creates a PDF::Font object for the given standard (also known as base 14 font).
Public methodStatic memberCreate(PDFDoc, String, String)
Create a new Unicode font based on the description of an existing PDF font.
Public methodStatic memberCreate(SDFDoc, Font, String)
Create a new Unicode font based on the description of an existing PDF font.
Public methodStatic memberCreate(SDFDoc, FontStandardType1Font, Boolean)
Creates a PDF::Font object for the given standard (also known as base 14 font).
Public methodStatic memberCreate(SDFDoc, String, String)
Create a new Unicode font based on the description of an existing PDF font.
Public methodStatic memberCreateCIDTrueTypeFont(PDFDoc, String)
Embed an external TrueType font in the document as a CID font. By default the function selects "Identity-H" encoding that maps 2-byte Character codes ranging from 0 to 65,535 to the same Unicode value. Other predefined encodings are listed in Table 5.15 'Predefined CMap names' in PDF Reference Manual.
Public methodStatic memberCreateCIDTrueTypeFont(SDFDoc, String)
Embed an external TrueType font in the document as a CID font. By default the function selects "Identity-H" encoding that maps 2-byte Character codes ranging from 0 to 65,535 to the same Unicode value. Other predefined encodings are listed in Table 5.15 'Predefined CMap names' in PDF Reference Manual.
Public methodStatic memberCreateCIDTrueTypeFont(PDFDoc, String, Boolean, Boolean)
Creates the cid true type font.
Public methodStatic memberCreateCIDTrueTypeFont(SDFDoc, String, Boolean, Boolean)
Creates the cid true type font.
Public methodStatic memberCreateCIDTrueTypeFont(PDFDoc, String, Boolean, Boolean, FontEncoding)
Creates the cid true type font.
Public methodStatic memberCreateCIDTrueTypeFont(SDFDoc, String, Boolean, Boolean, FontEncoding)
Creates the cid true type font.
Public methodStatic memberCreateCIDTrueTypeFont(PDFDoc, String, Boolean, Boolean, FontEncoding, Int32)
Creates the cid true type font.
Public methodStatic memberCreateCIDTrueTypeFont(SDFDoc, String, Boolean, Boolean, FontEncoding, Int32)
Creates the cid true type font.
Public methodStatic memberCreateTrueTypeFont(PDFDoc, String)
Embed an external TrueType font in the document as a simple font.
Public methodStatic memberCreateTrueTypeFont(SDFDoc, String)
Embed an external TrueType font in the document as a simple font.
Public methodStatic memberCreateTrueTypeFont(PDFDoc, String, Boolean, Boolean)
Creates a true type font.
Public methodStatic memberCreateTrueTypeFont(SDFDoc, String, Boolean, Boolean)
Creates the true type font.
Public methodStatic memberCreateType1Font(PDFDoc, String)
Embed an external TrueType font in the document as a CID font. By default the function selects "Identity-H" encoding that maps 2-byte Character codes ranging from 0 to 65,535 to the same Unicode value. Other predefined encodings are listed in Table 5.15 'Predefined CMap names' in PDF Reference Manual.
Public methodStatic memberCreateType1Font(SDFDoc, String)
Embed an external TrueType font in the document as a CID font. By default the function selects "Identity-H" encoding that maps 2-byte Character codes ranging from 0 to 65,535 to the same Unicode value. Other predefined encodings are listed in Table 5.15 'Predefined CMap names' in PDF Reference Manual.
Public methodStatic memberCreateType1Font(PDFDoc, String, Boolean)
Creates the type1 font.
Public methodStatic memberCreateType1Font(SDFDoc, String, Boolean)
Creates the type1 font.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetAscent
The face's ascender is the vertical distance from the baseline to the topmost point of any glyph in the face. This field's value is a positive number, expressed in the glyph coordinate system. For all font types except Type 3, the units of glyph space are one-thousandth of a unit of text space. Some font designs use a value different from 'bbox.yMax'.
Public methodGetBBox
Gets the b box.
Public methodGetCharCodeIterator
CharCodeGetIterator represents an iterator interface used to traverse a list of Char codes for which there is a glyph outline in the embedded font.
Public methodGetDescendant
Gets the descendant.
Public methodGetDescent
The face's descender is the vertical distance from the baseline to the bottommost point of any glyph in the face. This field's value is a negative number expressed in the glyph coordinate system. For all font types except Type 3, the units of glyph space are one-thousandth of a unit of text space. Some font designs use a value different from 'bbox.yMin'.
Public methodGetDescriptor
Gets the descriptor.
Public methodGetEmbeddedFont
Gets the embedded font name.
Public methodGetEmbeddedFontBufSize
Gets the embedded font buf size.
Public methodGetEncoding
Gets the encoding of this font.
Public methodGetGlyphPath(Int32, Boolean)
The function retrieves the glyph outline for a given Character code.
Public methodGetGlyphPath(Int32, ByteArrayRef, DoubleArrayRef, Boolean)
The function retrieves the glyph outline for a given Character code.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetMaxWidth
Gets the max width.
Public methodGetMissingWidth
Gets the missing width.
Public methodGetName
Gets the name.
Public methodGetSDFObj
Gets the SDFObj.
Public methodGetShapedText
Creates a set of positioned glyphs corresponding to the visual representation of the provided text string. The shaped text will take into account any advanced positioning and substitution features provided by an underylying embedded font file. For example, these features could include kerning, ligatures, and diacritic positioning. Typically the resulting shaped text would be fed into ElementBuilder.CreateShapedTextRun()
Public methodGetStandardType1FontType
Gets the standard type1 font type.
Public methodGetType
Gets the type.
Public methodStatic memberGetType(Obj)
Gets the type.
Public methodGetType3FontMatrix
Gets the type3 font matrix.
Public methodGetType3GlyphStream
Gets the type3 glyph stream.
Public methodGetUnitsPerEm
Gets the units per em.
Public methodGetVerticalAdvance(Int32, DoubleRef, DoubleRef)
Gets the vertical advance.
Public methodGetVerticalAdvance(Int32, Double, Double)
Gets the vertical advance.
Public methodGetWidth
Gets the width.
Public methodIsAllCap
Checks if is all cap.
Public methodIsCFF
Checks if is cFF.
Public methodIsEmbedded
Tests whether or not the specified font is stored as a font file in a stream embedded in the PDF file.
Public methodIsFixedWidth
Gets the family name.
Public methodIsForceBold
Checks if is force bold.
Public methodIsHorizontalMode
Checks if is horizontal mode.
Public methodIsItalic
Checks if is italic.
Public methodIsSerif
Checks if is serif.
Public methodIsSimple
Checks if is simple.
Public methodIsSymbolic
Checks if is symbolic.
Public methodIsValid
Checks if this font object is valid. Always make this check before using a font object.
Public methodMapToCID
Map to CID.
Public methodMapToUnicode
Maps the encoding specific 'Charcode' to Unicode. Conversion of 'Charcode' to Unicode can result in up to four Unicode Characters.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also