Table of Contents

Class CffStandardStrings

Namespace
Egami.Fonts
Assembly
Egami.Fonts.dll

The Compact Font Format's predefined data (Adobe Technical Note #5176, appendices A and B): the 391 standard strings that string ids (SIDs) below 391 name, and the Standard and Expert encodings as glyph names by code.

public static class CffStandardStrings
Inheritance
CffStandardStrings
Inherited Members

Examples

// Converting a Type 1 font to CFF: standard glyph names take their standard SIDs, others go in the String INDEX.
int sid = CffStandardStrings.TryGetSid("Aacute", out int standard) ? standard : -1;
string atCode65 = CffStandardStrings.StandardEncoding[65];   // "A"

Fields

Count

The number of standard strings; SIDs from this one on index a font's own String INDEX.

public const int Count = 391

Field Value

int

Properties

ExpertEncoding

Gets the 256 glyph names of the Expert Encoding by code, ".notdef" for codes it leaves unused.

public static IReadOnlyList<string> ExpertEncoding { get; }

Property Value

IReadOnlyList<string>

StandardEncoding

Gets the 256 glyph names of the Standard Encoding by code, ".notdef" for codes it leaves unused.

public static IReadOnlyList<string> StandardEncoding { get; }

Property Value

IReadOnlyList<string>

Methods

Get(int)

Gets a standard string by its SID.

public static string Get(int sid)

Parameters

sid int

The SID, 0 to 390.

Returns

string

The string, such as "space" for 1.

Exceptions

ArgumentOutOfRangeException

sid is negative or 391 or more.

TryGetSid(string, out int)

Finds the SID of a standard string.

public static bool TryGetSid(string name, out int sid)

Parameters

name string

The string, such as "Aacute"; compared ordinally.

sid int

The SID, or -1 when the string is not a standard one.

Returns

bool

true if name is a standard string.

Exceptions

ArgumentNullException

name is null.