FontFile.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include "common/Surface.h"
  17. #include "common/Vram.h"
  18. #include "common/File.h"
  19. /**
  20. * Handles font files.
  21. */
  22. class FontFile : public File{
  23. public:
  24. // explicit FontFile(const Ogre::String& file);
  25. /**
  26. * Constructor.
  27. *
  28. * @param file[in] The font file.
  29. */
  30. explicit FontFile(File* file);
  31. /**
  32. * Constructor.
  33. *
  34. * @param file[in] The font file.
  35. * @param offset[in] The offset at which to start reading the file.
  36. * @param length[in] Length of the data to read.
  37. */
  38. FontFile(File* file, const u32& offset, const u32& length);
  39. /**
  40. * Constructor.
  41. *
  42. * @param file[in] Buffer with the contents of the font file.
  43. * @param offset[in] The offset at which to start reading the file.
  44. * @param length[in] Length of the data to read.
  45. */
  46. FontFile(u8* buffer, const u32& offset, const u32& length);
  47. /**
  48. * Desrtuctor/
  49. */
  50. virtual ~FontFile(void);
  51. /**
  52. * Retrieves the font surface.
  53. */
  54. Surface* GetSurface(void);
  55. };