Table of Contents

Struct FontNameRecord

Namespace
Egami.Fonts
Assembly
Egami.Fonts.dll

One decoded string of a font's naming table, such as the family name in one language.

public readonly record struct FontNameRecord : IEquatable<FontNameRecord>
Implements
Inherited Members

Examples

// One face from a file; a collection takes an index. The bytes are read once and every table is parsed when first needed.
Typeface face = Typeface.FromFile(FontFile);
Console.WriteLine($"{face.FamilyName} {face.SubfamilyName}, {face.GlyphCount} glyphs, {face.UnitsPerEm} units per em");

// What a file holds, from its header alone.
FontProbe probe = FontLoader.Probe(File.ReadAllBytes(FontFile));
Console.WriteLine($"{probe.Kind}, {probe.FaceCount} face(s), {probe.Outlines} outlines");

// Damaged fonts load leniently with diagnostics; Strict throws instead.
var seen = new List<EgamiDiagnostic>();
var options = new FontLoadOptions { Context = EgamiContext.Default with { Diagnostics = seen.Add } };
Typeface lenient = Typeface.FromMemory(File.ReadAllBytes(FontFile), 0, options);

Constructors

FontNameRecord(int, int, int, int, string)

One decoded string of a font's naming table, such as the family name in one language.

public FontNameRecord(int NameId, int PlatformId, int EncodingId, int LanguageId, string Value)

Parameters

NameId int

What the string is: 1 family, 2 subfamily, 4 full name, 6 PostScript name, 16 typographic family and so on.

PlatformId int

The platform: 0 Unicode, 1 Macintosh, 3 Windows.

EncodingId int

The platform's encoding.

LanguageId int

The platform's language code, such as 0x409 for US English on Windows.

Value string

The string.

Examples

// One face from a file; a collection takes an index. The bytes are read once and every table is parsed when first needed.
Typeface face = Typeface.FromFile(FontFile);
Console.WriteLine($"{face.FamilyName} {face.SubfamilyName}, {face.GlyphCount} glyphs, {face.UnitsPerEm} units per em");

// What a file holds, from its header alone.
FontProbe probe = FontLoader.Probe(File.ReadAllBytes(FontFile));
Console.WriteLine($"{probe.Kind}, {probe.FaceCount} face(s), {probe.Outlines} outlines");

// Damaged fonts load leniently with diagnostics; Strict throws instead.
var seen = new List<EgamiDiagnostic>();
var options = new FontLoadOptions { Context = EgamiContext.Default with { Diagnostics = seen.Add } };
Typeface lenient = Typeface.FromMemory(File.ReadAllBytes(FontFile), 0, options);

Properties

EncodingId

The platform's encoding.

public int EncodingId { get; init; }

Property Value

int

LanguageId

The platform's language code, such as 0x409 for US English on Windows.

public int LanguageId { get; init; }

Property Value

int

NameId

What the string is: 1 family, 2 subfamily, 4 full name, 6 PostScript name, 16 typographic family and so on.

public int NameId { get; init; }

Property Value

int

PlatformId

The platform: 0 Unicode, 1 Macintosh, 3 Windows.

public int PlatformId { get; init; }

Property Value

int

Value

The string.

public string Value { get; init; }

Property Value

string