Directionality.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // RichTextKit
  2. // Copyright © 2019-2020 Topten Software. All Rights Reserved.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License"); you may
  5. // not use this product except in compliance with the License. You may obtain
  6. // a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. // License for the specific language governing permissions and limitations
  14. // under the License.
  15. using System;
  16. using System.Collections.Generic;
  17. using System.Linq;
  18. using System.Text;
  19. using System.Threading.Tasks;
  20. namespace Topten.RichTextKit
  21. {
  22. /// <summary>
  23. /// Unicode directionality classes
  24. /// </summary>
  25. /// <remarks>
  26. /// Note, these need to match those used by the JavaScript script that
  27. /// generates the .trie resources
  28. /// </remarks>
  29. enum Directionality : byte
  30. {
  31. // Strong types
  32. L = 0,
  33. R = 1,
  34. AL = 2,
  35. // Weak Types
  36. EN = 3,
  37. ES = 4,
  38. ET = 5,
  39. AN = 6,
  40. CS = 7,
  41. NSM = 8,
  42. BN = 9,
  43. // Neutral Types
  44. B = 10,
  45. S = 11,
  46. WS = 12,
  47. ON = 13,
  48. // Explicit Formatting Types - Embed
  49. LRE = 14,
  50. LRO = 15,
  51. RLE = 16,
  52. RLO = 17,
  53. PDF = 18,
  54. // Explicit Formatting Types - Isolate
  55. LRI = 19,
  56. RLI = 20,
  57. FSI = 21,
  58. PDI = 22,
  59. /** Minimum bidi type value. */
  60. TYPE_MIN = 0,
  61. /** Maximum bidi type value. */
  62. TYPE_MAX = 22,
  63. /* Unknown */
  64. Unknown = 0xFF,
  65. }
  66. }