Table of Contents

Class FontDescriptor

Namespace
UglyToad.PdfPig.PdfFonts
Assembly
UglyToad.PdfPig.dll

Specifies metrics and attributes of a simple font or CID Font for the whole font rather than per-glyph.

public class FontDescriptor
Inheritance
FontDescriptor
Inherited Members

Remarks

Provides information to enable consumer applications to find a substitute font when the font is unavailable.

Font descriptors are not used with Type 0 fonts.

A font descriptor is a dictionary used to specify various attributes.

Constructors

FontDescriptor(Builder)

Create a new FontDescriptor.

public FontDescriptor(FontDescriptor.Builder builder)

Parameters

builder FontDescriptor.Builder

Properties

Ascent

The maximum height above the baseline for any glyph from this font (except for accents).

public decimal Ascent { get; }

Property Value

decimal

Remarks

Required (Except Type 3)

AverageWidth

The average glyph width in the font. Default 0.

public decimal AverageWidth { get; }

Property Value

decimal

Remarks

Optional

BoundingBox

A rectangle in glyph coordinates which represents the smallest rectangle containing all glyphs of the font.

public PdfRectangle BoundingBox { get; }

Property Value

PdfRectangle

Remarks

Required (Except Type 3)

CapHeight

The vertical distance of the top of flat capital letters from the baseline.

public decimal CapHeight { get; }

Property Value

decimal

Remarks

Required (Where Latin Characters, Except Type 3)

CharSet

The character names defined in a font subset.

public string CharSet { get; }

Property Value

string

Remarks

Optional

Descent

The maximum depth below the baseline for any glyph in the font. This is negative.

public decimal Descent { get; }

Property Value

decimal

Remarks

Required (Except Type 3)

Flags

Defines various font characteristics. See FontDescriptorFlags.

public FontDescriptorFlags Flags { get; }

Property Value

FontDescriptorFlags

Remarks

Required

FontFamily

The preferred font family.

public string FontFamily { get; }

Property Value

string

Remarks

Optional

FontFile

The bytes of the font program.

public DescriptorFontFile FontFile { get; }

Property Value

DescriptorFontFile

Remarks

Optional

FontName

The PostScript name for the font.

public NameToken FontName { get; }

Property Value

NameToken

Remarks

Required

FontWeight

The weight/thickness of the font.

public decimal FontWeight { get; }

Property Value

decimal

Remarks

Possible values: 100
200
300
500 (normal)
600
700
800
900
Optional

ItalicAngle

The angle in degrees counter-clockwise from vertical of the vertical lines of the font. The value is negative for fonts sloping right (italic fonts).

public decimal ItalicAngle { get; }

Property Value

decimal

Examples

9 o'clock is represented by 90 degrees. 3 o'clock is -90 degrees.

Remarks

Required

Leading

The spacing between consecutive lines of text. Default 0.

public decimal Leading { get; }

Property Value

decimal

Remarks

Optional

MaxWidth

The maximum glyph width in the font. Default 0.

public decimal MaxWidth { get; }

Property Value

decimal

Remarks

Optional

MissingWidth

The width for character codes whose widths are not present in the Widths array of the font dictionary. Default 0.

public decimal MissingWidth { get; }

Property Value

decimal

Remarks

Optional

StemHorizontal

The vertical thickness of horizontal stems of glyphs. Default 0.

public decimal StemHorizontal { get; }

Property Value

decimal

Remarks

Optional

StemVertical

The horizontal thickness of vertical stems of glyphs.

public decimal StemVertical { get; }

Property Value

decimal

Remarks

Required (Except Type 3)

Stretch

The font stretch value.

public FontStretch Stretch { get; }

Property Value

FontStretch

Remarks

Optional

XHeight

The x height of the font. The vertical distance of the top of flat non-ascending lowercase letters (e.g. x) from the baseline. Default 0.

public decimal XHeight { get; }

Property Value

decimal

Remarks

Optional