CharacterMap.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. #define DRAW_CONTENT
  2. //#define BASE_DRAW_CONTENT
  3. using Microsoft.VisualBasic;
  4. using NStack;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using Terminal.Gui;
  10. using Terminal.Gui.Resources;
  11. using Rune = System.Rune;
  12. namespace UICatalog.Scenarios {
  13. /// <summary>
  14. /// This Scenario demonstrates building a custom control (a class deriving from View) that:
  15. /// - Provides a "Character Map" application (like Windows' charmap.exe).
  16. /// - Helps test unicode character rendering in Terminal.Gui
  17. /// - Illustrates how to use ScrollView to do infinite scrolling
  18. /// </summary>
  19. [ScenarioMetadata (Name: "Character Map",
  20. Description: "A Unicode character set viewier built as a custom control using the ScrollView control.")]
  21. [ScenarioCategory ("Text and Formatting")]
  22. [ScenarioCategory ("Controls")]
  23. [ScenarioCategory ("ScrollView")]
  24. public class CharacterMap : Scenario {
  25. CharMap _charMap;
  26. public override void Setup ()
  27. {
  28. _charMap = new CharMap () {
  29. X = 0,
  30. Y = 0,
  31. Height = Dim.Fill ()
  32. };
  33. Win.Add (_charMap);
  34. var jumpLabel = new Label ("Jump To Glyph:") { X = Pos.Right (_charMap) + 1, Y = Pos.Y (_charMap) };
  35. Win.Add (jumpLabel);
  36. var jumpEdit = new TextField () { X = Pos.Right (jumpLabel) + 1, Y = Pos.Y (_charMap), Width = 10, Caption = "e.g. 01BE3"};
  37. Win.Add (jumpEdit);
  38. var errorLabel = new Label ("") { X = Pos.Right (jumpEdit) + 1, Y = Pos.Y (_charMap), ColorScheme = Colors.ColorSchemes ["error"] };
  39. Win.Add (errorLabel);
  40. jumpEdit.TextChanged += (s, e) => {
  41. uint result = 0;
  42. if (jumpEdit.Text.Length == 0) return;
  43. try {
  44. result = Convert.ToUInt32 (jumpEdit.Text.ToString (), 10);
  45. } catch (OverflowException) {
  46. errorLabel.Text = $"Invalid (overflow)";
  47. return;
  48. } catch (FormatException) {
  49. try {
  50. result = Convert.ToUInt32 (jumpEdit.Text.ToString (), 16);
  51. } catch (OverflowException) {
  52. errorLabel.Text = $"Invalid (overflow)";
  53. return;
  54. } catch (FormatException) {
  55. errorLabel.Text = $"Invalid (can't parse)";
  56. return;
  57. }
  58. }
  59. errorLabel.Text = $"U+{result:x4}";
  60. _charMap.SelectedGlyph = result;
  61. };
  62. var radioItems = new (ustring radioLabel, uint start, uint end) [UnicodeRange.Ranges.Count];
  63. for (var i = 0; i < UnicodeRange.Ranges.Count; i++) {
  64. var range = UnicodeRange.Ranges [i];
  65. radioItems [i] = CreateRadio (range.Category, range.Start, range.End);
  66. }
  67. (ustring radioLabel, uint start, uint end) CreateRadio (ustring title, uint start, uint end)
  68. {
  69. return ($"{title} (U+{start:x5}-{end:x5})", start, end);
  70. }
  71. var label = new Label ("Jump To Unicode Block:") { X = Pos.Right (_charMap) + 1, Y = Pos.Bottom (jumpLabel) + 1 };
  72. Win.Add (label);
  73. var jumpList = new ListView (radioItems.Select (t => t.radioLabel).ToArray ()) {
  74. X = Pos.X (label) + 1,
  75. Y = Pos.Bottom (label),
  76. Width = radioItems.Max (r => r.radioLabel.Length) + 2,
  77. Height = Dim.Fill(1),
  78. SelectedItem = 0
  79. };
  80. jumpList.SelectedItemChanged += (s, args) => {
  81. _charMap.StartGlyph = radioItems [jumpList.SelectedItem].start;
  82. };
  83. Win.Add (jumpList);
  84. //jumpList.Refresh ();
  85. _charMap.SetFocus ();
  86. _charMap.Width = Dim.Fill () - jumpList.Width;
  87. }
  88. }
  89. class CharMap : ScrollView {
  90. /// <summary>
  91. /// Specifies the starting offset for the character map. The default is 0x2500
  92. /// which is the Box Drawing characters.
  93. /// </summary>
  94. public uint StartGlyph {
  95. get => _start;
  96. set {
  97. _start = value;
  98. _selected = value;
  99. ContentOffset = new Point (0, (int)(_start / 16));
  100. SetNeedsDisplay ();
  101. }
  102. }
  103. /// <summary>
  104. /// Specifies the starting offset for the character map. The default is 0x2500
  105. /// which is the Box Drawing characters.
  106. /// </summary>
  107. public uint SelectedGlyph {
  108. get => _selected;
  109. set {
  110. _selected = value;
  111. int row = (int)_selected / 16;
  112. int height = (Bounds.Height / ROW_HEIGHT) - 1;
  113. if (row + ContentOffset.Y < 0) {
  114. // Moving up.
  115. ContentOffset = new Point (0, row);
  116. } else if (row + ContentOffset.Y >= height) {
  117. // Moving down.
  118. ContentOffset = new Point (0, Math.Min (row, (row - height) + 1));
  119. } else {
  120. //ContentOffset = new Point (0, Math.Min (row, (row - height) - 1));
  121. }
  122. SetNeedsDisplay ();
  123. }
  124. }
  125. uint _start = 0;
  126. uint _selected = 0;
  127. public const int COLUMN_WIDTH = 3;
  128. public const int ROW_HEIGHT = 1;
  129. public static uint MaxCodePointVal => 0x10FFFF;
  130. public static int RowLabelWidth => $"U+{MaxCodePointVal:x5}".Length + 1;
  131. public static int RowWidth => RowLabelWidth + (COLUMN_WIDTH * 16);
  132. public CharMap ()
  133. {
  134. ColorScheme = Colors.Dialog;
  135. CanFocus = true;
  136. ContentSize = new Size (CharMap.RowWidth, (int)(MaxCodePointVal / 16 + 1));
  137. ShowVerticalScrollIndicator = true;
  138. ShowHorizontalScrollIndicator = false;
  139. LayoutComplete += (s, args) => {
  140. if (Bounds.Width < RowWidth) {
  141. ShowHorizontalScrollIndicator = true;
  142. } else {
  143. ShowHorizontalScrollIndicator = false;
  144. // Snap 1st column into view if it's been scrolled horizontally
  145. ContentOffset = new Point (0, ContentOffset.Y);
  146. SetNeedsDisplay ();
  147. }
  148. };
  149. DrawContent += CharMap_DrawContent;
  150. AddCommand (Command.ScrollUp, () => {
  151. if (SelectedGlyph >= 16) {
  152. SelectedGlyph = SelectedGlyph - 16;
  153. }
  154. return true;
  155. });
  156. AddCommand (Command.ScrollDown, () => {
  157. if (SelectedGlyph < MaxCodePointVal - 16) {
  158. SelectedGlyph = SelectedGlyph + 16;
  159. }
  160. return true;
  161. });
  162. AddCommand (Command.ScrollLeft, () => {
  163. if (SelectedGlyph > 0) {
  164. SelectedGlyph--;
  165. }
  166. return true;
  167. });
  168. AddCommand (Command.ScrollRight, () => {
  169. if (SelectedGlyph < MaxCodePointVal - 1) {
  170. SelectedGlyph++;
  171. }
  172. return true;
  173. });
  174. AddCommand (Command.PageUp, () => {
  175. var page = (uint)(Bounds.Height / ROW_HEIGHT - 1) * 16;
  176. SelectedGlyph -= Math.Min(page, SelectedGlyph);
  177. return true;
  178. });
  179. AddCommand (Command.PageDown, () => {
  180. var page = (uint)(Bounds.Height / ROW_HEIGHT - 1) * 16;
  181. SelectedGlyph += Math.Min(page, MaxCodePointVal -SelectedGlyph);
  182. return true;
  183. });
  184. AddCommand (Command.TopHome, () => {
  185. SelectedGlyph = 0;
  186. return true;
  187. });
  188. AddCommand (Command.BottomEnd, () => {
  189. SelectedGlyph = MaxCodePointVal;
  190. return true;
  191. });
  192. MouseClick += Handle_MouseClick;
  193. Application.Driver.SetCursorVisibility (CursorVisibility.Invisible);
  194. }
  195. private void CopyValue ()
  196. {
  197. Clipboard.Contents = $"U+{SelectedGlyph:x5}";
  198. }
  199. private void CopyGlyph ()
  200. {
  201. Clipboard.Contents = $"{new Rune (SelectedGlyph)}";
  202. }
  203. private void CharMap_DrawContent (object sender, DrawEventArgs e)
  204. {
  205. Rect viewport = e.Rect;
  206. var oldClip = Driver.Clip;
  207. Driver.Clip = Bounds;
  208. // Redraw doesn't know about the scroll indicators, so if off, add one to height
  209. if (!ShowHorizontalScrollIndicator) {
  210. Driver.Clip = new Rect (Bounds.X, Bounds.Y, Bounds.Width, Bounds.Height + 1);
  211. }
  212. Driver.SetAttribute (HasFocus ? ColorScheme.HotFocus : ColorScheme.Focus);
  213. Move (0, 0);
  214. Driver.AddStr (new string (' ', RowLabelWidth + 1));
  215. for (int hexDigit = 0; hexDigit < 16; hexDigit++) {
  216. var x = ContentOffset.X + RowLabelWidth + (hexDigit * COLUMN_WIDTH);
  217. if (x > RowLabelWidth - 2) {
  218. Move (x, 0);
  219. Driver.AddStr ($" {hexDigit:x} ");
  220. }
  221. }
  222. var firstColumnX = viewport.X + RowLabelWidth;
  223. for (int row = -ContentOffset.Y, y = 0; row <= (-ContentOffset.Y) + (Bounds.Height / ROW_HEIGHT); row++, y += ROW_HEIGHT) {
  224. int val = (row) * 16;
  225. Driver.SetAttribute (GetNormalColor ());
  226. Move (firstColumnX, y + 1);
  227. Driver.AddStr (new string (' ', 16 * COLUMN_WIDTH));
  228. if (val <= MaxCodePointVal) {
  229. Driver.SetAttribute (GetNormalColor ());
  230. for (int col = 0; col < 16; col++) {
  231. uint glyph = (uint)((uint)val + col);
  232. var rune = new Rune (glyph);
  233. //if (rune >= 0x00D800 && rune <= 0x00DFFF) {
  234. // if (col == 0) {
  235. // Driver.AddStr ("Reserved for surrogate pairs.");
  236. // }
  237. // continue;
  238. //}
  239. Move (firstColumnX + (col * COLUMN_WIDTH) + 1, y + 1);
  240. if (glyph == SelectedGlyph) {
  241. Driver.SetAttribute (HasFocus ? ColorScheme.HotFocus : ColorScheme.HotNormal);
  242. } else {
  243. Driver.SetAttribute (GetNormalColor ());
  244. }
  245. Driver.AddRune (rune);
  246. }
  247. Move (0, y + 1);
  248. Driver.SetAttribute (HasFocus ? ColorScheme.HotFocus : ColorScheme.Focus);
  249. var rowLabel = $"U+{val / 16:x5}_ ";
  250. Driver.AddStr (rowLabel);
  251. }
  252. }
  253. Driver.Clip = oldClip;
  254. }
  255. ContextMenu _contextMenu = new ContextMenu ();
  256. void Handle_MouseClick (object sender, MouseEventEventArgs args)
  257. {
  258. var me = args.MouseEvent;
  259. if (me.Flags == MouseFlags.ReportMousePosition || (me.Flags != MouseFlags.Button1Clicked &&
  260. me.Flags != MouseFlags.Button1DoubleClicked &&
  261. me.Flags != _contextMenu.MouseFlags)) {
  262. return;
  263. }
  264. if (me.X < RowLabelWidth) {
  265. return;
  266. }
  267. if (me.Y < 1) {
  268. return;
  269. }
  270. var row = (me.Y - 1);
  271. var col = (me.X - RowLabelWidth - ContentOffset.X) / COLUMN_WIDTH;
  272. uint val = (uint)((((uint)row - (uint)ContentOffset.Y) * 16) + col);
  273. if (val > MaxCodePointVal) {
  274. return;
  275. }
  276. if (me.Flags == MouseFlags.Button1Clicked) {
  277. SelectedGlyph = (uint)val;
  278. return;
  279. }
  280. if (me.Flags == MouseFlags.Button1DoubleClicked) {
  281. SelectedGlyph = (uint)val;
  282. MessageBox.Query ("Glyph", $"{new Rune (val)} U+{SelectedGlyph:x4}", "Ok");
  283. return;
  284. }
  285. if (me.Flags == _contextMenu.MouseFlags) {
  286. SelectedGlyph = (uint)val;
  287. _contextMenu = new ContextMenu (me.X + 1, me.Y + 1,
  288. new MenuBarItem (new MenuItem [] {
  289. new MenuItem ("_Copy Glyph", "", () => CopyGlyph (), null, null, Key.C | Key.CtrlMask),
  290. new MenuItem ("Copy _Value", "", () => CopyValue (), null, null, Key.C | Key.ShiftMask | Key.CtrlMask),
  291. }) {
  292. }
  293. );
  294. _contextMenu.Show ();
  295. }
  296. }
  297. protected override void Dispose (bool disposing)
  298. {
  299. DrawContent -= CharMap_DrawContent;
  300. base.Dispose (disposing);
  301. }
  302. }
  303. class UnicodeRange {
  304. public uint Start;
  305. public uint End;
  306. public string Category;
  307. public UnicodeRange (uint start, uint end, string category)
  308. {
  309. this.Start = start;
  310. this.End = end;
  311. this.Category = category;
  312. }
  313. public static List<UnicodeRange> Ranges = new List<UnicodeRange> {
  314. new UnicodeRange (0x0000, 0x001F, "ASCII Control Characters"),
  315. new UnicodeRange (0x0080, 0x009F, "C0 Control Characters"),
  316. new UnicodeRange(0x1100, 0x11ff,"Hangul Jamo"), // This is where wide chars tend to start
  317. new UnicodeRange(0x20A0, 0x20CF,"Currency Symbols"),
  318. new UnicodeRange(0x2100, 0x214F,"Letterlike Symbols"),
  319. new UnicodeRange(0x2160, 0x218F, "Roman Numerals"),
  320. new UnicodeRange(0x2190, 0x21ff,"Arrows" ),
  321. new UnicodeRange(0x2200, 0x22ff,"Mathematical symbols"),
  322. new UnicodeRange(0x2300, 0x23ff,"Miscellaneous Technical"),
  323. new UnicodeRange(0x24B6, 0x24e9,"Circled Latin Capital Letters"),
  324. new UnicodeRange(0x1F130, 0x1F149,"Squared Latin Capital Letters"),
  325. new UnicodeRange(0x2500, 0x25ff,"Box Drawing & Geometric Shapes"),
  326. new UnicodeRange(0x2600, 0x26ff,"Miscellaneous Symbols"),
  327. new UnicodeRange(0x2700, 0x27ff,"Dingbats"),
  328. new UnicodeRange(0x2800, 0x28ff,"Braille"),
  329. new UnicodeRange(0x2b00, 0x2bff,"Miscellaneous Symbols and Arrows"),
  330. new UnicodeRange(0xFB00, 0xFb4f,"Alphabetic Presentation Forms"),
  331. new UnicodeRange(0x12400, 0x1240f,"Cuneiform Numbers and Punctuation"),
  332. new UnicodeRange(0x1FA00, 0x1FA0f,"Chess Symbols"),
  333. new UnicodeRange (0x0020 ,0x007F ,"Basic Latin"),
  334. new UnicodeRange (0x00A0 ,0x00FF ,"Latin-1 Supplement"),
  335. new UnicodeRange (0x0100 ,0x017F ,"Latin Extended-A"),
  336. new UnicodeRange (0x0180 ,0x024F ,"Latin Extended-B"),
  337. new UnicodeRange (0x0250 ,0x02AF ,"IPA Extensions"),
  338. new UnicodeRange (0x02B0 ,0x02FF ,"Spacing Modifier Letters"),
  339. new UnicodeRange (0x0300 ,0x036F ,"Combining Diacritical Marks"),
  340. new UnicodeRange (0x0370 ,0x03FF ,"Greek and Coptic"),
  341. new UnicodeRange (0x0400 ,0x04FF ,"Cyrillic"),
  342. new UnicodeRange (0x0500 ,0x052F ,"Cyrillic Supplementary"),
  343. new UnicodeRange (0x0530 ,0x058F ,"Armenian"),
  344. new UnicodeRange (0x0590 ,0x05FF ,"Hebrew"),
  345. new UnicodeRange (0x0600 ,0x06FF ,"Arabic"),
  346. new UnicodeRange (0x0700 ,0x074F ,"Syriac"),
  347. new UnicodeRange (0x0780 ,0x07BF ,"Thaana"),
  348. new UnicodeRange (0x0900 ,0x097F ,"Devanagari"),
  349. new UnicodeRange (0x0980 ,0x09FF ,"Bengali"),
  350. new UnicodeRange (0x0A00 ,0x0A7F ,"Gurmukhi"),
  351. new UnicodeRange (0x0A80 ,0x0AFF ,"Gujarati"),
  352. new UnicodeRange (0x0B00 ,0x0B7F ,"Oriya"),
  353. new UnicodeRange (0x0B80 ,0x0BFF ,"Tamil"),
  354. new UnicodeRange (0x0C00 ,0x0C7F ,"Telugu"),
  355. new UnicodeRange (0x0C80 ,0x0CFF ,"Kannada"),
  356. new UnicodeRange (0x0D00 ,0x0D7F ,"Malayalam"),
  357. new UnicodeRange (0x0D80 ,0x0DFF ,"Sinhala"),
  358. new UnicodeRange (0x0E00 ,0x0E7F ,"Thai"),
  359. new UnicodeRange (0x0E80 ,0x0EFF ,"Lao"),
  360. new UnicodeRange (0x0F00 ,0x0FFF ,"Tibetan"),
  361. new UnicodeRange (0x1000 ,0x109F ,"Myanmar"),
  362. new UnicodeRange (0x10A0 ,0x10FF ,"Georgian"),
  363. new UnicodeRange (0x1100 ,0x11FF ,"Hangul Jamo"),
  364. new UnicodeRange (0x1200 ,0x137F ,"Ethiopic"),
  365. new UnicodeRange (0x13A0 ,0x13FF ,"Cherokee"),
  366. new UnicodeRange (0x1400 ,0x167F ,"Unified Canadian Aboriginal Syllabics"),
  367. new UnicodeRange (0x1680 ,0x169F ,"Ogham"),
  368. new UnicodeRange (0x16A0 ,0x16FF ,"Runic"),
  369. new UnicodeRange (0x1700 ,0x171F ,"Tagalog"),
  370. new UnicodeRange (0x1720 ,0x173F ,"Hanunoo"),
  371. new UnicodeRange (0x1740 ,0x175F ,"Buhid"),
  372. new UnicodeRange (0x1760 ,0x177F ,"Tagbanwa"),
  373. new UnicodeRange (0x1780 ,0x17FF ,"Khmer"),
  374. new UnicodeRange (0x1800 ,0x18AF ,"Mongolian"),
  375. new UnicodeRange (0x1900 ,0x194F ,"Limbu"),
  376. new UnicodeRange (0x1950 ,0x197F ,"Tai Le"),
  377. new UnicodeRange (0x19E0 ,0x19FF ,"Khmer Symbols"),
  378. new UnicodeRange (0x1D00 ,0x1D7F ,"Phonetic Extensions"),
  379. new UnicodeRange (0x1E00 ,0x1EFF ,"Latin Extended Additional"),
  380. new UnicodeRange (0x1F00 ,0x1FFF ,"Greek Extended"),
  381. new UnicodeRange (0x2000 ,0x206F ,"General Punctuation"),
  382. new UnicodeRange (0x2070 ,0x209F ,"Superscripts and Subscripts"),
  383. new UnicodeRange (0x20A0 ,0x20CF ,"Currency Symbols"),
  384. new UnicodeRange (0x20D0 ,0x20FF ,"Combining Diacritical Marks for Symbols"),
  385. new UnicodeRange (0x2100 ,0x214F ,"Letterlike Symbols"),
  386. new UnicodeRange (0x2150 ,0x218F ,"Number Forms"),
  387. new UnicodeRange (0x2190 ,0x21FF ,"Arrows"),
  388. new UnicodeRange (0x2200 ,0x22FF ,"Mathematical Operators"),
  389. new UnicodeRange (0x2300 ,0x23FF ,"Miscellaneous Technical"),
  390. new UnicodeRange (0x2400 ,0x243F ,"Control Pictures"),
  391. new UnicodeRange (0x2440 ,0x245F ,"Optical Character Recognition"),
  392. new UnicodeRange (0x2460 ,0x24FF ,"Enclosed Alphanumerics"),
  393. new UnicodeRange (0x2500 ,0x257F ,"Box Drawing"),
  394. new UnicodeRange (0x2580 ,0x259F ,"Block Elements"),
  395. new UnicodeRange (0x25A0 ,0x25FF ,"Geometric Shapes"),
  396. new UnicodeRange (0x2600 ,0x26FF ,"Miscellaneous Symbols"),
  397. new UnicodeRange (0x2700 ,0x27BF ,"Dingbats"),
  398. new UnicodeRange (0x27C0 ,0x27EF ,"Miscellaneous Mathematical Symbols-A"),
  399. new UnicodeRange (0x27F0 ,0x27FF ,"Supplemental Arrows-A"),
  400. new UnicodeRange (0x2800 ,0x28FF ,"Braille Patterns"),
  401. new UnicodeRange (0x2900 ,0x297F ,"Supplemental Arrows-B"),
  402. new UnicodeRange (0x2980 ,0x29FF ,"Miscellaneous Mathematical Symbols-B"),
  403. new UnicodeRange (0x2A00 ,0x2AFF ,"Supplemental Mathematical Operators"),
  404. new UnicodeRange (0x2B00 ,0x2BFF ,"Miscellaneous Symbols and Arrows"),
  405. new UnicodeRange (0x2E80 ,0x2EFF ,"CJK Radicals Supplement"),
  406. new UnicodeRange (0x2F00 ,0x2FDF ,"Kangxi Radicals"),
  407. new UnicodeRange (0x2FF0 ,0x2FFF ,"Ideographic Description Characters"),
  408. new UnicodeRange (0x3000 ,0x303F ,"CJK Symbols and Punctuation"),
  409. new UnicodeRange (0x3040 ,0x309F ,"Hiragana"),
  410. new UnicodeRange (0x30A0 ,0x30FF ,"Katakana"),
  411. new UnicodeRange (0x3100 ,0x312F ,"Bopomofo"),
  412. new UnicodeRange (0x3130 ,0x318F ,"Hangul Compatibility Jamo"),
  413. new UnicodeRange (0x3190 ,0x319F ,"Kanbun"),
  414. new UnicodeRange (0x31A0 ,0x31BF ,"Bopomofo Extended"),
  415. new UnicodeRange (0x31F0 ,0x31FF ,"Katakana Phonetic Extensions"),
  416. new UnicodeRange (0x3200 ,0x32FF ,"Enclosed CJK Letters and Months"),
  417. new UnicodeRange (0x3300 ,0x33FF ,"CJK Compatibility"),
  418. new UnicodeRange (0x3400 ,0x4DBF ,"CJK Unified Ideographs Extension A"),
  419. new UnicodeRange (0x4DC0 ,0x4DFF ,"Yijing Hexagram Symbols"),
  420. new UnicodeRange (0x4E00 ,0x9FFF ,"CJK Unified Ideographs"),
  421. new UnicodeRange (0xA000 ,0xA48F ,"Yi Syllables"),
  422. new UnicodeRange (0xA490 ,0xA4CF ,"Yi Radicals"),
  423. new UnicodeRange (0xAC00 ,0xD7AF ,"Hangul Syllables"),
  424. new UnicodeRange (0xD800 ,0xDB7F ,"High Surrogates"),
  425. new UnicodeRange (0xDB80 ,0xDBFF ,"High Private Use Surrogates"),
  426. new UnicodeRange (0xDC00 ,0xDFFF ,"Low Surrogates"),
  427. new UnicodeRange (0xE000 ,0xF8FF ,"Private Use Area"),
  428. new UnicodeRange (0xF900 ,0xFAFF ,"CJK Compatibility Ideographs"),
  429. new UnicodeRange (0xFB00 ,0xFB4F ,"Alphabetic Presentation Forms"),
  430. new UnicodeRange (0xFB50 ,0xFDFF ,"Arabic Presentation Forms-A"),
  431. new UnicodeRange (0xFE00 ,0xFE0F ,"Variation Selectors"),
  432. new UnicodeRange (0xFE20 ,0xFE2F ,"Combining Half Marks"),
  433. new UnicodeRange (0xFE30 ,0xFE4F ,"CJK Compatibility Forms"),
  434. new UnicodeRange (0xFE50 ,0xFE6F ,"Small Form Variants"),
  435. new UnicodeRange (0xFE70 ,0xFEFF ,"Arabic Presentation Forms-B"),
  436. new UnicodeRange (0xFF00 ,0xFFEF ,"Halfwidth and Fullwidth Forms"),
  437. new UnicodeRange (0xFFF0 ,0xFFFF ,"Specials"),
  438. new UnicodeRange (0x10000, 0x1007F ,"Linear B Syllabary"),
  439. new UnicodeRange (0x10080, 0x100FF ,"Linear B Ideograms"),
  440. new UnicodeRange (0x10100, 0x1013F ,"Aegean Numbers"),
  441. new UnicodeRange (0x10300, 0x1032F ,"Old Italic"),
  442. new UnicodeRange (0x10330, 0x1034F ,"Gothic"),
  443. new UnicodeRange (0x10380, 0x1039F ,"Ugaritic"),
  444. new UnicodeRange (0x10400, 0x1044F ,"Deseret"),
  445. new UnicodeRange (0x10450, 0x1047F ,"Shavian"),
  446. new UnicodeRange (0x10480, 0x104AF ,"Osmanya"),
  447. new UnicodeRange (0x10800, 0x1083F ,"Cypriot Syllabary"),
  448. new UnicodeRange (0x1D000, 0x1D0FF ,"Byzantine Musical Symbols"),
  449. new UnicodeRange (0x1D100, 0x1D1FF ,"Musical Symbols"),
  450. new UnicodeRange (0x1D300, 0x1D35F ,"Tai Xuan Jing Symbols"),
  451. new UnicodeRange (0x1D400, 0x1D7FF ,"Mathematical Alphanumeric Symbols"),
  452. new UnicodeRange (0x1F600, 0x1F532 ,"Emojis Symbols"),
  453. new UnicodeRange (0x20000, 0x2A6DF ,"CJK Unified Ideographs Extension B"),
  454. new UnicodeRange (0x2F800, 0x2FA1F ,"CJK Compatibility Ideographs Supplement"),
  455. new UnicodeRange (0xE0000, 0xE007F ,"Tags"),
  456. new UnicodeRange((uint)(CharMap.MaxCodePointVal - 16), (uint)CharMap.MaxCodePointVal,"End"),
  457. };
  458. }
  459. }