Font.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include "Font.h"
  2. namespace gameplay
  3. {
  4. Font::Font(void) :
  5. style(0),
  6. size(0),
  7. texMapWidth(0),
  8. texMapHeight(0)
  9. {
  10. }
  11. Font::~Font(void)
  12. {
  13. }
  14. unsigned int Font::getTypeId(void) const
  15. {
  16. return FONT_ID;
  17. }
  18. const char* Font::getElementName(void) const
  19. {
  20. return "Font";
  21. }
  22. void Font::writeBinary(FILE* file)
  23. {
  24. Object::writeBinary(file);
  25. write(family, file);
  26. write(style, file);
  27. write(size, file);
  28. write(charset, file);
  29. writeBinaryObjects(glyphs, file);
  30. write(texMapWidth, file);
  31. write(texMapHeight, file);
  32. write(texMap, file);
  33. }
  34. void Font::writeText(FILE* file)
  35. {
  36. fprintElementStart(file);
  37. fprintfElement(file, "family", family);
  38. fprintfElement(file, "style", style);
  39. fprintfElement(file, "size", size);
  40. fprintfElement(file, "alphabet", charset);
  41. //fprintfElement(file, "glyphs", glyphs);
  42. fprintfElement(file, "texMapWidth", texMapWidth);
  43. fprintfElement(file, "texMapHeight", texMapHeight);
  44. //fprintfElement(file, "texMap", texMap);
  45. fprintElementEnd(file);
  46. }
  47. }