CombiningMarks.cs 1.6 KB

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