Font.generated.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. [ShowInInspector]
  14. public partial class Font : Resource
  15. {
  16. private Font(bool __dummy0) { }
  17. protected Font() { }
  18. /// <summary>Returns a reference wrapper for this resource.</summary>
  19. public RRef<Font> Ref
  20. {
  21. get { return Internal_GetRef(mCachedPtr); }
  22. }
  23. /// <summary>Returns a reference wrapper for this resource.</summary>
  24. public static implicit operator RRef<Font>(Font x)
  25. { return Internal_GetRef(x.mCachedPtr); }
  26. /// <summary>Returns font bitmap for a specific font size.</summary>
  27. /// <param name="size">Size of the bitmap in points.</param>
  28. /// <returns>Bitmap object if it exists, false otherwise.</returns>
  29. public FontBitmap GetBitmap(uint size)
  30. {
  31. return Internal_getBitmap(mCachedPtr, size);
  32. }
  33. /// <summary>Finds the available font bitmap size closest to the provided size.</summary>
  34. /// <param name="size">Size of the bitmap in points.</param>
  35. /// <returns>Nearest available bitmap size.</returns>
  36. public int GetClosestSize(uint size)
  37. {
  38. return Internal_getClosestSize(mCachedPtr, size);
  39. }
  40. [MethodImpl(MethodImplOptions.InternalCall)]
  41. private static extern RRef<Font> Internal_GetRef(IntPtr thisPtr);
  42. [MethodImpl(MethodImplOptions.InternalCall)]
  43. private static extern FontBitmap Internal_getBitmap(IntPtr thisPtr, uint size);
  44. [MethodImpl(MethodImplOptions.InternalCall)]
  45. private static extern int Internal_getClosestSize(IntPtr thisPtr, uint size);
  46. }
  47. /** @} */
  48. }