IStyle.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 SkiaSharp;
  16. using System;
  17. using System.Collections.Generic;
  18. using System.Linq;
  19. using System.Text;
  20. using System.Threading.Tasks;
  21. namespace Topten.RichTextKit
  22. {
  23. /// <summary>
  24. /// Provides styling information for a run of text.
  25. /// </summary>
  26. public interface IStyle
  27. {
  28. /// <summary>
  29. /// The font family for text this text run.
  30. /// </summary>
  31. string FontFamily { get; }
  32. /// <summary>
  33. /// The font size for text in this run.
  34. /// </summary>
  35. float FontSize { get; }
  36. /// <summary>
  37. /// The font weight for text in this run.
  38. /// </summary>
  39. int FontWeight { get; }
  40. /// <summary>
  41. /// The font weight for text in this run.
  42. /// </summary>
  43. SKFontStyleWidth FontWidth { get; }
  44. /// <summary>
  45. /// True if the text in this run should be displayed in an italic
  46. /// font; otherwise False.
  47. /// </summary>
  48. bool FontItalic { get; }
  49. /// <summary>
  50. /// The underline style for text in this run.
  51. /// </summary>
  52. UnderlineStyle Underline { get; }
  53. /// <summary>
  54. /// The strike through style for the text in this run
  55. /// </summary>
  56. StrikeThroughStyle StrikeThrough { get; }
  57. /// <summary>
  58. /// The line height for text in this run as a multiplier (defaults to 1)
  59. /// </summary>
  60. float LineHeight { get; }
  61. /// <summary>
  62. /// The text color for text in this run.
  63. /// </summary>
  64. SKColor TextColor { get; }
  65. /// <summary>
  66. /// The background color of this run.
  67. /// </summary>
  68. SKColor BackgroundColor { get; }
  69. /// <summary>
  70. /// Color of the halo
  71. /// </summary>
  72. SKColor HaloColor { get; }
  73. /// <summary>
  74. /// Width of halo
  75. /// </summary>
  76. float HaloWidth { get; }
  77. /// <summary>
  78. /// Blur of halo
  79. /// </summary>
  80. float HaloBlur { get; }
  81. /// <summary>
  82. /// Extra spacing between each character
  83. /// </summary>
  84. float LetterSpacing { get; }
  85. /// <summary>
  86. /// The font variant (ie: super/sub-script) for text in this run.
  87. /// </summary>
  88. FontVariant FontVariant { get; }
  89. /// <summary>
  90. /// Text direction override for this span
  91. /// </summary>
  92. TextDirection TextDirection { get; }
  93. /// <summary>
  94. /// Specifies a replacement character to be displayed (password mode)
  95. /// </summary>
  96. char ReplacementCharacter { get; }
  97. }
  98. }