Class Encoding
Maps character codes to glyph names from a PostScript encoding.
public abstract class Encoding
- Inheritance
-
Encoding
- Derived
- Inherited Members
Constructors
Encoding()
protected Encoding()
Fields
CodeToName
Mutable code to name map.
protected readonly Dictionary<int, string> CodeToName
Field Value
NameToCode
Mutable name to code map.
protected readonly Dictionary<string, int> NameToCode
Field Value
Properties
CodeToNameMap
Maps from character codes to names.
public IReadOnlyDictionary<int, string> CodeToNameMap { get; }
Property Value
EncodingName
The name of this encoding.
public abstract string EncodingName { get; }
Property Value
NameToCodeMap
Maps from names to character cocdes.
public IReadOnlyDictionary<string, int> NameToCodeMap { get; }
Property Value
Methods
Add(int, string)
Add a character code and name pair.
protected void Add(int code, string name)
Parameters
ContainsCode(int)
Whether this encoding contains a name for the code.
public bool ContainsCode(int code)
Parameters
code
int
Returns
ContainsName(string)
Whether this encoding contains a code for the name.
public bool ContainsName(string name)
Parameters
name
string
Returns
GetCode(string)
Get the character code from name
public virtual int GetCode(string name)
Parameters
name
stringCharacter name (eg. euro, ampersand, A, space)
Returns
- int
-1 if not found otherwise the character code
GetName(int)
Get the character name corresponding to the given code.
public virtual string GetName(int code)
Parameters
code
int
Returns
TryGetNamedEncoding(NameToken, out Encoding)
Get a known encoding instance with the given name.
public static bool TryGetNamedEncoding(NameToken name, out Encoding encoding)