RenderMode.cs 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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><para>
  24. /// An enumeration type that lists the render modes supported by FreeType 2. Each mode corresponds to a specific
  25. /// type of scanline conversion performed on the outline.
  26. /// </para><para>
  27. /// For bitmap fonts and embedded bitmaps the <see cref="FTBitmap.PixelMode"/> field in the <see cref="GlyphSlot"/>
  28. /// structure gives the format of the returned bitmap.
  29. /// </para><para>
  30. /// All modes except <see cref="RenderMode.Mono"/> use 256 levels of opacity.
  31. /// </para></summary>
  32. /// <remarks><para>
  33. /// The LCD-optimized glyph bitmaps produced by <see cref="GlyphSlot.RenderGlyph"/> can be filtered to reduce
  34. /// color-fringes by using <see cref="Library.SetLcdFilter"/> (not active in the default builds). It is up to the
  35. /// caller to either call <see cref="Library.SetLcdFilter"/> (if available) or do the filtering itself.
  36. /// </para><para>
  37. /// The selected render mode only affects vector glyphs of a font. Embedded bitmaps often have a different pixel
  38. /// mode like <see cref="PixelMode.Mono"/>. You can use <see cref="FTBitmap.Convert"/> to transform them into 8-bit
  39. /// pixmaps.
  40. /// </para></remarks>
  41. public enum RenderMode
  42. {
  43. /// <summary>
  44. /// This is the default render mode; it corresponds to 8-bit anti-aliased bitmaps.
  45. /// </summary>
  46. Normal = 0,
  47. /// <summary>
  48. /// This is equivalent to <see cref="RenderMode.Normal"/>. It is only defined as a separate value because
  49. /// render modes are also used indirectly to define hinting algorithm selectors.
  50. /// </summary>
  51. /// <see cref="LoadTarget"/>
  52. Light,
  53. /// <summary>
  54. /// This mode corresponds to 1-bit bitmaps (with 2 levels of opacity).
  55. /// </summary>
  56. Mono,
  57. /// <summary>
  58. /// This mode corresponds to horizontal RGB and BGR sub-pixel displays like LCD screens. It produces 8-bit
  59. /// bitmaps that are 3 times the width of the original glyph outline in pixels, and which use the
  60. /// <see cref="PixelMode.Lcd"/> mode.
  61. /// </summary>
  62. Lcd,
  63. /// <summary>
  64. /// This mode corresponds to vertical RGB and BGR sub-pixel displays (like PDA screens, rotated LCD displays,
  65. /// etc.). It produces 8-bit bitmaps that are 3 times the height of the original glyph outline in pixels and
  66. /// use the <see cref="PixelMode.VerticalLcd"/> mode.
  67. /// </summary>
  68. VerticalLcd,
  69. }
  70. }