FaceFlags.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 flags used in the ‘face_flags’ field of the <see cref="Face"/> structure. They inform client
  25. /// applications of properties of the corresponding face.
  26. /// </summary>
  27. [Flags]
  28. public enum FaceFlags : long
  29. {
  30. /// <summary>
  31. /// No style flags.
  32. /// </summary>
  33. None = 0x0000,
  34. /// <summary>
  35. /// Indicates that the face contains outline glyphs. This doesn't prevent bitmap strikes, i.e., a face can have
  36. /// both this and and <see cref="FaceFlags.FixedSizes"/> set.
  37. /// </summary>
  38. Scalable = 0x0001,
  39. /// <summary>
  40. /// Indicates that the face contains bitmap strikes. See also <see cref="Face.FixedSizesCount"/> and
  41. /// <see cref="Face.AvailableSizes"/>.
  42. /// </summary>
  43. FixedSizes = 0x0002,
  44. /// <summary>
  45. /// Indicates that the face contains fixed-width characters (like Courier, Lucido, MonoType, etc.).
  46. /// </summary>
  47. FixedWidth = 0x0004,
  48. /// <summary>
  49. /// Indicates that the face uses the ‘sfnt’ storage scheme. For now, this means TrueType and OpenType.
  50. /// </summary>
  51. Sfnt = 0x0008,
  52. /// <summary>
  53. /// Indicates that the face contains horizontal glyph metrics. This should be set for all common formats.
  54. /// </summary>
  55. Horizontal = 0x0010,
  56. /// <summary>
  57. /// Indicates that the face contains vertical glyph metrics. This is only available in some formats, not all of
  58. /// them.
  59. /// </summary>
  60. Vertical = 0x0020,
  61. /// <summary>
  62. /// Indicates that the face contains kerning information. If set, the kerning distance can be retrieved through
  63. /// the function <see cref="Face.GetKerning"/>. Otherwise the function always return the vector (0,0). Note
  64. /// that FreeType doesn't handle kerning data from the ‘GPOS’ table (as present in some OpenType fonts).
  65. /// </summary>
  66. Kerning = 0x0040,
  67. /// <summary>
  68. /// Indicates that the font contains multiple masters and is capable of interpolating between them. See the
  69. /// multiple-masters specific API for details.
  70. /// </summary>
  71. MultipleMasters = 0x0100,
  72. /// <summary>
  73. /// Indicates that the font contains glyph names that can be retrieved through
  74. /// <see cref="Face.GetGlyphName(uint, int)"/>. Note that some TrueType fonts contain broken glyph name
  75. /// tables. Use the function <see cref="Face.HasPSGlyphNames"/> when needed.
  76. /// </summary>
  77. GlyphNames = 0x0200,
  78. /// <summary>
  79. /// Used internally by FreeType to indicate that a face's stream was provided by the client application and
  80. /// should not be destroyed when <see cref="Face.Dispose()"/> is called. Don't read or test this flag.
  81. /// </summary>
  82. ExternalStream = 0x0400,
  83. /// <summary>
  84. /// Set if the font driver has a hinting machine of its own. For example, with TrueType fonts, it makes sense
  85. /// to use data from the SFNT ‘gasp’ table only if the native TrueType hinting engine (with the bytecode
  86. /// interpreter) is available and active.
  87. /// </summary>
  88. Hinter = 0x0800,
  89. /// <summary><para>
  90. /// Set if the font is CID-keyed. In that case, the font is not accessed by glyph indices but by CID values.
  91. /// For subsetted CID-keyed fonts this has the consequence that not all index values are a valid argument to
  92. /// <see cref="Face.LoadGlyph"/>. Only the CID values for which corresponding glyphs in the subsetted font
  93. /// exist make <see cref="Face.LoadGlyph"/> return successfully; in all other cases you get an
  94. /// <see cref="Error.InvalidArgument"/> error.
  95. /// </para><para>
  96. /// Note that CID-keyed fonts which are in an SFNT wrapper don't have this flag set since the glyphs are
  97. /// accessed in the normal way (using contiguous indices); the ‘CID-ness’ isn't visible to the application.
  98. /// </para></summary>
  99. CidKeyed = 0x1000,
  100. /// <summary><para>
  101. /// Set if the font is ‘tricky’, this is, it always needs the font format's native hinting engine to get a
  102. /// reasonable result. A typical example is the Chinese font ‘mingli.ttf’ which uses TrueType bytecode
  103. /// instructions to move and scale all of its subglyphs.
  104. /// </para><para>
  105. /// It is not possible to autohint such fonts using <see cref="LoadFlags.ForceAutohint"/>; it will also ignore
  106. /// <see cref="LoadFlags.NoHinting"/>. You have to set both <see cref="LoadFlags.NoHinting"/> and
  107. /// <see cref="LoadFlags.ForceAutohint"/> to really disable hinting; however, you probably never want this
  108. /// except for demonstration purposes.
  109. /// </para><para>
  110. /// Currently, there are about a dozen TrueType fonts in the list of tricky fonts; they are hard-coded in file
  111. /// ‘ttobjs.c’.
  112. /// </para></summary>
  113. Tricky = 0x2000
  114. }
  115. }