Skip to content

Commit

Permalink
add - Imported more Unicode character width info
Browse files Browse the repository at this point in the history
---

We've added more Unicode characters to the character width determiner.

---

Type: add
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jun 22, 2024
1 parent c66539b commit 3304f80
Showing 1 changed file with 136 additions and 2 deletions.
138 changes: 136 additions & 2 deletions Terminaux/Base/Extensions/Data/CharWidths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ namespace Terminaux.Base.Extensions.Data
{
internal static class CharWidths
{
// Taken from https://github.com/joshuarubin/wcwidth9/blob/master/wcwidth9.h
// Taken from the following sources:
// https://github.com/joshuarubin/wcwidth9/blob/master/wcwidth9.h
// https://github.com/jquast/wcwidth

private readonly static (int, int)[] privateChars =
[
(0x00e000, 0x00f8ff),
Expand All @@ -48,7 +51,7 @@ private readonly static (int, int)[] nonPrintChars =

private readonly static (int, int)[] combiningChars =
[
(0x0300, 0x036f),
(0x0300, 0x036f),
(0x0483, 0x0489),
(0x0591, 0x05bd),
(0x05bf, 0x05bf),
Expand Down Expand Up @@ -298,6 +301,99 @@ private readonly static (int, int)[] combiningChars =
(0x1e8d0, 0x1e8d6),
(0x1e944, 0x1e94a),
(0xe0100, 0xe01ef),
(0x0600, 0x0605),
(0x061c, 0x061c),
(0x06d6, 0x06dd),
(0x07fd, 0x07fd),
(0x0890, 0x0891),
(0x0898, 0x089f),
(0x08ca, 0x0903),
(0x09fe, 0x09fe),
(0x0afa, 0x0aff),
(0x0b55, 0x0b57),
(0x0c00, 0x0c04),
(0x0c3c, 0x0c3c),
(0x0cf3, 0x0cf3),
(0x0d00, 0x0d03),
(0x0d3b, 0x0d3c),
(0x0d81, 0x0d83),
(0x0eb4, 0x0ebc),
(0x0ec8, 0x0ece),
(0x1160, 0x11ff),
(0x1712, 0x1715),
(0x180b, 0x180f),
(0x1ab0, 0x1ace),
(0x1cf4, 0x1cf4),
(0x1cf7, 0x1cf9),
(0x1dc0, 0x1dff),
(0x2028, 0x202e),
(0x2060, 0x2064),
(0x2066, 0x206f),
(0xa82c, 0xa82c),
(0xa8ff, 0xa8ff),
(0xd7b0, 0xd7ff),
(0x10d24, 0x10d27),
(0x10eab, 0x10eac),
(0x10efd, 0x10eff),
(0x10f46, 0x10f50),
(0x10f82, 0x10f85),
(0x11070, 0x11070),
(0x11073, 0x11074),
(0x110bd, 0x110bd),
(0x110c2, 0x110c2),
(0x110cd, 0x110cd),
(0x11145, 0x11146),
(0x111c9, 0x111cc),
(0x111ce, 0x111cf),
(0x11241, 0x11241),
(0x1133b, 0x1133c),
(0x1145e, 0x1145e),
(0x1182c, 0x1183a),
(0x11930, 0x11935),
(0x11937, 0x11938),
(0x1193b, 0x1193e),
(0x11940, 0x11940),
(0x11942, 0x11943),
(0x119d1, 0x119d7),
(0x119da, 0x119e0),
(0x119e4, 0x119e4),
(0x11a01, 0x11a0a),
(0x11a33, 0x11a39),
(0x11a3b, 0x11a3e),
(0x11a47, 0x11a47),
(0x11a51, 0x11a5b),
(0x11a8a, 0x11a99),
(0x11d31, 0x11d36),
(0x11d3a, 0x11d3a),
(0x11d3c, 0x11d3d),
(0x11d3f, 0x11d45),
(0x11d47, 0x11d47),
(0x11d8a, 0x11d8e),
(0x11d90, 0x11d91),
(0x11d93, 0x11d97),
(0x11ef3, 0x11ef6),
(0x11f00, 0x11f01),
(0x11f03, 0x11f03),
(0x11f34, 0x11f3a),
(0x11f3e, 0x11f42),
(0x13430, 0x13440),
(0x13447, 0x13455),
(0x16f4f, 0x16f4f),
(0x16f51, 0x16f87),
(0x16fe4, 0x16fe4),
(0x16ff0, 0x16ff1),
(0x1bca0, 0x1bca3),
(0x1cf00, 0x1cf2d),
(0x1cf30, 0x1cf46),
(0x1d16d, 0x1d182),
(0x1e08f, 0x1e08f),
(0x1e130, 0x1e136),
(0x1e2ae, 0x1e2ae),
(0x1e2ec, 0x1e2ef),
(0x1e4ec, 0x1e4ef),
(0x1f3fb, 0x1f3ff),
(0xe0001, 0xe0001),
(0xe0020, 0xe007f),
];

private readonly static (int, int)[] doubleWidthChars =
Expand Down Expand Up @@ -408,6 +504,44 @@ private readonly static (int, int)[] doubleWidthChars =
(0x1f9c0, 0x1f9c0),
(0x20000, 0x2fffd),
(0x30000, 0x3fffd),
(0x2ff0, 0x3029),
(0x3030, 0x303e),
(0x309b, 0x30ff),
(0x3105, 0x312f),
(0x3190, 0x31e3),
(0x31ef, 0x321e),
(0x3250, 0x4dbf),
(0x16fe0, 0x16fe3),
(0x17000, 0x187f7),
(0x18800, 0x18cd5),
(0x18d00, 0x18d08),
(0x1aff0, 0x1aff3),
(0x1aff5, 0x1affb),
(0x1affd, 0x1affe),
(0x1b000, 0x1b122),
(0x1b132, 0x1b132),
(0x1b150, 0x1b152),
(0x1b155, 0x1b155),
(0x1b164, 0x1b167),
(0x1b170, 0x1b2fb),
(0x1f260, 0x1f265),
(0x1f3f8, 0x1f3fa),
(0x1f400, 0x1f43e),
(0x1f6d5, 0x1f6d7),
(0x1f6dc, 0x1f6df),
(0x1f6f4, 0x1f6fc),
(0x1f7e0, 0x1f7eb),
(0x1f7f0, 0x1f7f0),
(0x1f90c, 0x1f93a),
(0x1f93c, 0x1f945),
(0x1f947, 0x1f9ff),
(0x1fa70, 0x1fa7c),
(0x1fa80, 0x1fa88),
(0x1fa90, 0x1fabd),
(0x1fabf, 0x1fac5),
(0x1face, 0x1fadb),
(0x1fae0, 0x1fae8),
(0x1faf0, 0x1faf8),
];

private readonly static (int, int)[] ambiguousChars =
Expand Down

0 comments on commit 3304f80

Please sign in to comment.