Struct FontNameRecord
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
NameIdintWhat the string is: 1 family, 2 subfamily, 4 full name, 6 PostScript name, 16 typographic family and so on.
PlatformIdintThe platform: 0 Unicode, 1 Macintosh, 3 Windows.
EncodingIdintThe platform's encoding.
LanguageIdintThe platform's language code, such as 0x409 for US English on Windows.
ValuestringThe 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
LanguageId
The platform's language code, such as 0x409 for US English on Windows.
public int LanguageId { get; init; }
Property Value
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
PlatformId
The platform: 0 Unicode, 1 Macintosh, 3 Windows.
public int PlatformId { get; init; }
Property Value
Value
The string.
public string Value { get; init; }