Class ConsoleChar
Console character manipulation routines
Inheritance
Namespace: Terminaux.Base.Extensions
Assembly: Terminaux.dll
Syntax
public static class ConsoleChar
Properties
| Edit this page View SourceUseTwoCellsForAmbiguousChars
Whether to use two cells for ambiguous characters or only one cell
Declaration
public static bool UseTwoCellsForAmbiguousChars { get; set; }
Property Value
Type | Description |
---|---|
bool |
UseTwoCellsForPrivateChars
Whether to use two cells for private characters or only one cell
Declaration
public static bool UseTwoCellsForPrivateChars { get; set; }
Property Value
Type | Description |
---|---|
bool |
UseTwoCellsForUnassignedChars
Whether to use two cells for unassigned characters or only one cell
Declaration
public static bool UseTwoCellsForUnassignedChars { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceEstimateCellWidth(string)
Estimates the cell width (how many cells a string takes up)
Declaration
public static int EstimateCellWidth(string sentence)
Parameters
Type | Name | Description |
---|---|---|
string | sentence | A sentence to process |
Returns
Type | Description |
---|---|
int | Length of the string by character widths (a.k.a. how many cells this sentence takes up) |
EstimateCellWidth(string, int)
Estimates the cell width (how many cells a string takes up) of a character
Declaration
public static int EstimateCellWidth(string sentence, int index)
Parameters
Type | Name | Description |
---|---|---|
string | sentence | A sentence to process |
int | index | Index of a character within a sentence |
Returns
Type | Description |
---|---|
int | Length of a character by character widths (a.k.a. how many cells this sentence takes up), or -1 if empty |
EstimateFullWidths(string)
Estimates the amount of zero-width characters
Declaration
public static int EstimateFullWidths(string sentence)
Parameters
Type | Name | Description |
---|---|---|
string | sentence | A sentence to process |
Returns
Type | Description |
---|---|
int | The amount of zero-width characters that this sentence contains |
EstimateZeroWidths(string)
Estimates the amount of zero-width characters
Declaration
public static int EstimateZeroWidths(string sentence)
Parameters
Type | Name | Description |
---|---|---|
string | sentence | A sentence to process |
Returns
Type | Description |
---|---|
int | The amount of zero-width characters that this sentence contains |
GetCharWidth(int)
Gets the character width
Declaration
public static int GetCharWidth(int c)
Parameters
Type | Name | Description |
---|---|---|
int | c | A character number (codepoint) to parse |
Returns
Type | Description |
---|---|
int | Either 0 for non-printing characters, 1 for half-width characters, or 2 for full-width characters |
Exceptions
Type | Condition |
---|---|
TerminauxInternalException |
GetCharWidthType(int)
Gets the character width type
Declaration
public static CharWidthType GetCharWidthType(int c)
Parameters
Type | Name | Description |
---|---|---|
int | c | A character number (codepoint) to parse |
Returns
Type | Description |
---|---|
CharWidthType | Character width type |
Exceptions
Type | Condition |
---|---|
TerminauxInternalException |