Table of Contents

Class CharacterSet

Namespace
KernSmith
Assembly
KernSmith.dll

Defines which Unicode characters to include in the generated bitmap font.

public class CharacterSet
Inheritance
CharacterSet
Inherited Members

Properties

Ascii

Printable ASCII characters (space through tilde, 95 chars).

public static CharacterSet Ascii { get; }

Property Value

CharacterSet

Count

Number of characters in this set.

public int Count { get; }

Property Value

int

ExtendedAscii

Extended ASCII characters including accented Latin (224 chars).

public static CharacterSet ExtendedAscii { get; }

Property Value

CharacterSet

Latin

ASCII plus Latin Extended-A and Extended-B blocks.

public static CharacterSet Latin { get; }

Property Value

CharacterSet

Methods

FromChars(IEnumerable<int>)

Creates a character set from an explicit list of Unicode character codes.

public static CharacterSet FromChars(IEnumerable<int> codepoints)

Parameters

codepoints IEnumerable<int>

The character codes to include.

Returns

CharacterSet

FromChars(string)

Creates a character set from the unique characters in a string. For example, FromChars("ABCabc123") includes exactly those 9 characters.

public static CharacterSet FromChars(string characters)

Parameters

characters string

The characters to include.

Returns

CharacterSet

FromRanges(params (int start, int end)[])

Creates a character set from one or more (start, end) character code ranges. For example, (0x0020, 0x007E) covers printable ASCII.

public static CharacterSet FromRanges(params (int start, int end)[] ranges)

Parameters

ranges (int start, int end)[]

One or more (start, end) ranges, both ends included.

Returns

CharacterSet

GetCodepoints()

Returns all character codes in this set, sorted ascending.

public IEnumerable<int> GetCodepoints()

Returns

IEnumerable<int>

Resolve(IReadOnlyList<int>)

Filters this set down to only characters the font actually contains.

public IEnumerable<int> Resolve(IReadOnlyList<int> availableCodepoints)

Parameters

availableCodepoints IReadOnlyList<int>

Characters available in the font.

Returns

IEnumerable<int>

Union(params CharacterSet[])

Merges multiple character sets into one.

public static CharacterSet Union(params CharacterSet[] sets)

Parameters

sets CharacterSet[]

The character sets to combine.

Returns

CharacterSet