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
Count
Number of characters in this set.
public int Count { get; }
Property Value
ExtendedAscii
Extended ASCII characters including accented Latin (224 chars).
public static CharacterSet ExtendedAscii { get; }
Property Value
Latin
ASCII plus Latin Extended-A and Extended-B blocks.
public static CharacterSet Latin { get; }
Property Value
Methods
FromChars(IEnumerable<int>)
Creates a character set from an explicit list of Unicode character codes.
public static CharacterSet FromChars(IEnumerable<int> codepoints)
Parameters
codepointsIEnumerable<int>The character codes to include.
Returns
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
charactersstringThe characters to include.
Returns
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
Returns
GetCodepoints()
Returns all character codes in this set, sorted ascending.
public IEnumerable<int> GetCodepoints()
Returns
Resolve(IReadOnlyList<int>)
Filters this set down to only characters the font actually contains.
public IEnumerable<int> Resolve(IReadOnlyList<int> availableCodepoints)
Parameters
availableCodepointsIReadOnlyList<int>Characters available in the font.
Returns
Union(params CharacterSet[])
Merges multiple character sets into one.
public static CharacterSet Union(params CharacterSet[] sets)
Parameters
setsCharacterSet[]The character sets to combine.