gds_text.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * (c) Philippe G. 2019, philippe_44@outlook.com
  3. *
  4. * This software is released under the MIT License.
  5. * https://opensource.org/licenses/MIT
  6. *
  7. */
  8. #pragma once
  9. #include "gds_font.h"
  10. #define GDS_TEXT_CLEAR 0x01
  11. #define GDS_TEXT_CLEAR_EOL 0x02
  12. #define GDS_TEXT_UPDATE 0x04
  13. #define GDS_TEXT_MONOSPACE 0x08
  14. // these ones are for 'Pos' parameter of TextLine
  15. #define GDS_TEXT_LEFT 0
  16. #define GDS_TEXT_RIGHT 0xff00
  17. #define GDS_TEXT_CENTER 0xff01
  18. // these ones are for the 'Where' parameter of TextPos
  19. enum { GDS_TEXT_TOP_LEFT, GDS_TEXT_MIDDLE_LEFT, GDS_TEXT_BOTTOM_LEFT, GDS_TEXT_CENTERED };
  20. enum { GDS_FONT_DEFAULT, GDS_FONT_LINE_1, GDS_FONT_LINE_2, GDS_FONT_SEGMENT,
  21. GDS_FONT_TINY, GDS_FONT_SMALL, GDS_FONT_MEDIUM, GDS_FONT_LARGE, GDS_FONT_FONT_HUGE };
  22. struct GDS_Device;
  23. bool GDS_TextSetFontAuto(struct GDS_Device* Device, int N, int FontType, int Space);
  24. bool GDS_TextSetFont(struct GDS_Device* Device, int N, const struct GDS_FontDef *Font, int Space);
  25. bool GDS_TextLine(struct GDS_Device* Device, int N, int Pos, int Attr, char *Text);
  26. int GDS_GetTextWidth(struct GDS_Device* Device, int N, int Attr, char *Text);
  27. int GDS_TextStretch(struct GDS_Device* Device, int N, char *String, int Max);
  28. void GDS_TextPos(struct GDS_Device* Device, int FontType, int Where, int Attr, char *Text, ...);