FaceRec.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. using System.Runtime.InteropServices;
  22. #if WIN64
  23. using FT_26Dot6 = System.Int32;
  24. using FT_Fixed = System.Int32;
  25. using FT_Long = System.Int32;
  26. using FT_Pos = System.Int32;
  27. using FT_ULong = System.UInt32;
  28. #else
  29. using FT_26Dot6 = System.IntPtr;
  30. using FT_Fixed = System.IntPtr;
  31. using FT_Long = System.IntPtr;
  32. using FT_Pos = System.IntPtr;
  33. using FT_ULong = System.UIntPtr;
  34. #endif
  35. namespace SharpFont.Internal
  36. {
  37. /// <summary>
  38. /// Internally represents a Face.
  39. /// </summary>
  40. /// <remarks>
  41. /// Refer to <see cref="Face"/> for FreeType documentation.
  42. /// </remarks>
  43. [StructLayout(LayoutKind.Sequential)]
  44. internal class FaceRec
  45. {
  46. internal FT_Long num_faces;
  47. internal FT_Long face_index;
  48. internal FT_Long face_flags;
  49. internal FT_Long style_flags;
  50. internal FT_Long num_glyphs;
  51. [MarshalAs(UnmanagedType.LPStr)]
  52. internal string family_name;
  53. [MarshalAs(UnmanagedType.LPStr)]
  54. internal string style_name;
  55. internal int num_fixed_sizes;
  56. internal IntPtr available_sizes;
  57. internal int num_charmaps;
  58. internal IntPtr charmaps;
  59. internal GenericRec generic;
  60. internal BBoxRec bbox;
  61. internal ushort units_per_EM;
  62. internal short ascender;
  63. internal short descender;
  64. internal short height;
  65. internal short max_advance_width;
  66. internal short max_advance_height;
  67. internal short underline_position;
  68. internal short underline_thickness;
  69. internal IntPtr glyph;
  70. internal IntPtr size;
  71. internal IntPtr charmap;
  72. private IntPtr driver;
  73. private IntPtr memory;
  74. private IntPtr stream;
  75. private IntPtr sizes_list;
  76. private GenericRec autohint;
  77. private IntPtr extensions;
  78. private IntPtr @internal;
  79. internal static int SizeInBytes { get { return Marshal.SizeOf(typeof(FaceRec)); } }
  80. }
  81. }