OutlineFlags.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #region MIT License
  2. /*Copyright (c) 2012 Robert Rouhani <robert.rouhani@gmail.com>
  3. SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
  4. Permission is hereby granted, free of charge, to any person obtaining a copy of
  5. this software and associated documentation files (the "Software"), to deal in
  6. the Software without restriction, including without limitation the rights to
  7. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  8. of the Software, and to permit persons to whom the Software is furnished to do
  9. so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in all
  11. copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  18. SOFTWARE.*/
  19. #endregion
  20. using System;
  21. namespace SharpFont
  22. {
  23. /// <summary>
  24. /// A list of bit-field constants use for the flags in an outline's ‘flags’ field.
  25. /// </summary>
  26. /// <remarks><para>
  27. /// The flags <see cref="OutlineFlags.IgnoreDropouts"/>, <see cref="OutlineFlags.SmartDropouts"/>, and
  28. /// <see cref="OutlineFlags.IncludeStubs"/> are ignored by the smooth rasterizer.
  29. /// </para><para>
  30. /// There exists a second mechanism to pass the drop-out mode to the B/W rasterizer; see the ‘tags’ field in
  31. /// <see cref="Outline"/>.
  32. /// </para><para>
  33. /// Please refer to the description of the ‘SCANTYPE’ instruction in the OpenType specification (in file
  34. /// ‘ttinst1.doc’) how simple drop-outs, smart drop-outs, and stubs are defined.
  35. /// </para></remarks>
  36. [Flags]
  37. public enum OutlineFlags
  38. {
  39. /// <summary>
  40. /// Value 0 is reserved.
  41. /// </summary>
  42. None = 0x0000,
  43. /// <summary>
  44. /// If set, this flag indicates that the outline's field arrays (i.e., ‘points’, ‘flags’, and ‘contours’) are
  45. /// ‘owned’ by the outline object, and should thus be freed when it is destroyed.
  46. /// </summary>
  47. Owner = 0x0001,
  48. /// <summary>
  49. /// By default, outlines are filled using the non-zero winding rule. If set to 1, the outline will be filled
  50. /// using the even-odd fill rule (only works with the smooth rasterizer).
  51. /// </summary>
  52. EvenOddFill = 0x0002,
  53. /// <summary>
  54. /// By default, outside contours of an outline are oriented in clock-wise direction, as defined in the TrueType
  55. /// specification. This flag is set if the outline uses the opposite direction (typically for Type 1 fonts).
  56. /// This flag is ignored by the scan converter.
  57. /// </summary>
  58. ReverseFill = 0x0004,
  59. /// <summary>
  60. /// By default, the scan converter will try to detect drop-outs in an outline and correct the glyph bitmap to
  61. /// ensure consistent shape continuity. If set, this flag hints the scan-line converter to ignore such cases.
  62. /// See below for more information.
  63. /// </summary>
  64. IgnoreDropouts = 0x0008,
  65. /// <summary>
  66. /// Select smart dropout control. If unset, use simple dropout control. Ignored if
  67. /// <see cref="OutlineFlags.IgnoreDropouts"/> is set. See below for more information.
  68. /// </summary>
  69. SmartDropouts = 0x0010,
  70. /// <summary>
  71. /// If set, turn pixels on for ‘stubs’, otherwise exclude them. Ignored if
  72. /// <see cref="OutlineFlags.IgnoreDropouts"/> is set. See below for more information.
  73. /// </summary>
  74. IncludeStubs = 0x0020,
  75. /// <summary>
  76. /// This flag indicates that the scan-line converter should try to convert this outline to bitmaps with the
  77. /// highest possible quality. It is typically set for small character sizes. Note that this is only a hint that
  78. /// might be completely ignored by a given scan-converter.
  79. /// </summary>
  80. HighPrecision = 0x0100,
  81. /// <summary>
  82. /// This flag is set to force a given scan-converter to only use a single pass over the outline to render a
  83. /// bitmap glyph image. Normally, it is set for very large character sizes. It is only a hint that might be
  84. /// completely ignored by a given scan-converter.
  85. /// </summary>
  86. SinglePass = 0x0200
  87. }
  88. }