TTFFontEncoder.h 652 B

12345678910111213141516171819202122232425262728293031
  1. #include <ft2build.h>
  2. #include FT_FREETYPE_H
  3. #define START_INDEX 32
  4. #define END_INDEX 127
  5. #define GLYPH_PADDING 4
  6. namespace gameplay
  7. {
  8. // Structure of Glyph.
  9. class Glyph
  10. {
  11. public:
  12. unsigned int index;
  13. unsigned int width;
  14. float uvCoords[4];
  15. };
  16. void drawBitmap(unsigned char* dstBitmap, int x, int y, int dstWidth, unsigned char* srcBitmap, int srcWidth, int srcHeight);
  17. void writeUint(FILE* fp, unsigned int i);
  18. void writeFloat(FILE* fp, float f);
  19. void writeString(FILE* fp, const char* str);
  20. int writeFont(const char* filename, unsigned int fontSize, const char* id, bool fontpreview);
  21. }