Table of Contents

Class PdfFont

Namespace
PDiffy
Assembly
PDiffy.dll

A font. UnmappedCodes lists the character codes its text uses that don't map to Unicode: that text can't be copied, searched or read aloud correctly.

public sealed record PdfFont : IEquatable<PdfFont>
Inheritance
PdfFont
Implements
Inherited Members

Properties

Embedded

Whether the PDF holds the font's file, so the text doesn't depend on the fonts installed where it's opened.

public required bool Embedded { get; init; }

Property Value

bool

GlyphShapes

A hash of the outlines the font's embedded program draws for the codes its drawn text uses, each with its code, so a font with the same name and widths that draws other shapes changes it. A CID font whose encoding isn't Identity-H or Identity-V hashes every glyph its program has, each with its CID. Null when the font isn't embedded, its program can't be read, none of its text is drawn, or no outline can be read.

public string? GlyphShapes { get; init; }

Property Value

string

HasToUnicode

Whether the font has a ToUnicode map from its character codes to Unicode. A font without one can still map its codes through its encoding; UnmappedCodes lists the ones nothing maps.

public required bool HasToUnicode { get; init; }

Property Value

bool

MissingGlyphCodes

The character codes the font's text uses that show its .notdef glyph, the empty box a font draws for a character it lacks, smallest first: those the font's encoding or CID-to-glyph map sends there, and those whose glyph an embedded TrueType, Type 1 or CFF program lacks.

public IReadOnlyList<int> MissingGlyphCodes { get; init; }

Property Value

IReadOnlyList<int>

Name

The font's name (BaseFont) without a subset prefix, such as "Helvetica-Bold" for "ABCDEF+Helvetica-Bold"; "(none)" when the PDF doesn't name it.

public required string Name { get; init; }

Property Value

string

Problems

What PDF/UA forbids in the font's dictionaries and CMaps, in the order of PdfFontProblem.

public IReadOnlyList<PdfFontProblem> Problems { get; init; }

Property Value

IReadOnlyList<PdfFontProblem>

Subtype

The font's type, such as "Type1", "TrueType", "Type0" or "Type3"; null when the PDF leaves it out. PdfFontTypes lists them.

public required string? Subtype { get; init; }

Property Value

string

UnmappedCodes

The character codes the font's text uses that don't map to Unicode, smallest first; empty when every code maps. A code mapped to U+0000, U+FEFF or U+FFFE counts as unmapped, since it gives no text.

public IReadOnlyList<int> UnmappedCodes { get; init; }

Property Value

IReadOnlyList<int>