CombiningMarks.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using Terminal.Gui;
  2. namespace UICatalog.Scenarios;
  3. [ScenarioMetadata ("Combining Marks", "Illustrates how Unicode Combining Marks work (or don't).")]
  4. [ScenarioCategory ("Text and Formatting")]
  5. public class CombiningMarks : Scenario
  6. {
  7. public override void Main ()
  8. {
  9. Application.Init ();
  10. var top = new Toplevel ();
  11. top.DrawComplete += (s, e) =>
  12. {
  13. top.Move (0, 0);
  14. top.AddStr ("Terminal.Gui only supports combining marks that normalize. See Issue #2616.");
  15. top.Move (0, 2);
  16. top.AddStr ("\u0301\u0301\u0328<- \"\\u301\\u301\\u328]\" using AddStr.");
  17. top.Move (0, 3);
  18. top.AddStr ("[a\u0301\u0301\u0328]<- \"[a\\u301\\u301\\u328]\" using AddStr.");
  19. top.Move (0, 4);
  20. top.AddRune ('[');
  21. top.AddRune ('a');
  22. top.AddRune ('\u0301');
  23. top.AddRune ('\u0301');
  24. top.AddRune ('\u0328');
  25. top.AddRune (']');
  26. top.AddStr ("<- \"[a\\u301\\u301\\u328]\" using AddRune for each.");
  27. };
  28. Application.Run (top);
  29. top.Dispose ();
  30. Application.Shutdown ();
  31. }
  32. }