Font.generated.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup GUI_Engine
  7. * @{
  8. */
  9. /// <summary>
  10. /// Font resource containing data about textual characters and how to render text. Contains one or multiple font bitmaps,
  11. /// each for a specific size.
  12. /// </summary>
  13. public partial class Font : Resource
  14. {
  15. private Font(bool __dummy0) { }
  16. protected Font() { }
  17. /// <summary>Returns a reference wrapper for this resource.</summary>
  18. public RRef<Font> Ref
  19. {
  20. get { return Internal_GetRef(mCachedPtr); }
  21. }
  22. /// <summary>Returns a reference wrapper for this resource.</summary>
  23. public static implicit operator RRef<Font>(Font x)
  24. { return Internal_GetRef(x.mCachedPtr); }
  25. /// <summary>Returns font bitmap for a specific font size.</summary>
  26. /// <param name="size">Size of the bitmap in points.</param>
  27. /// <returns>Bitmap object if it exists, false otherwise.</returns>
  28. public FontBitmap GetBitmap(uint size)
  29. {
  30. return Internal_getBitmap(mCachedPtr, size);
  31. }
  32. /// <summary>Finds the available font bitmap size closest to the provided size.</summary>
  33. /// <param name="size">Size of the bitmap in points.</param>
  34. /// <returns>Nearest available bitmap size.</returns>
  35. public int GetClosestSize(uint size)
  36. {
  37. return Internal_getClosestSize(mCachedPtr, size);
  38. }
  39. [MethodImpl(MethodImplOptions.InternalCall)]
  40. private static extern RRef<Font> Internal_GetRef(IntPtr thisPtr);
  41. [MethodImpl(MethodImplOptions.InternalCall)]
  42. private static extern FontBitmap Internal_getBitmap(IntPtr thisPtr, uint size);
  43. [MethodImpl(MethodImplOptions.InternalCall)]
  44. private static extern int Internal_getClosestSize(IntPtr thisPtr, uint size);
  45. }
  46. /** @} */
  47. }