font_manager.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. Copyright (C) 2004 Michael Liebscher
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. /*
  16. * font_manager.h: Font management.
  17. *
  18. * Author: Michael Liebscher <johnnycanuck@users.sourceforge.net>
  19. * Date: 2004
  20. *
  21. */
  22. /*
  23. Notes:
  24. This module is implemented by font_manager.c.
  25. */
  26. #ifndef __FONT_MANAGER_H__
  27. #define __FONT_MANAGER_H__
  28. typedef enum { FONT0 = 0, FONT1, FONT2, FONT3 } FONTSELECT;
  29. typedef struct
  30. {
  31. W8 nCharWidth[ 128 ]; /* width of each character */
  32. W8 nMaxWidth; /* box width */
  33. W8 nMaxHeight; /* box height */
  34. SW32 spacing; /* space between characters */
  35. W32 nSize;
  36. float wFrac;
  37. float hFrac;
  38. colour4_t colour; /* Font colour */
  39. texture_t *texfont;
  40. } font_t;
  41. extern void Font_Init( void );
  42. extern void Font_Shutdown( void );
  43. extern void Font_SetSize( FONTSELECT fs, W16 size );
  44. extern W16 Font_GetSize( FONTSELECT fs );
  45. extern void Font_SetColour( FONTSELECT fs, colour3_t c );
  46. extern void Font_put_line( FONTSELECT fs, int x, int y, const char *string );
  47. extern void Font_put_lineR2L( FONTSELECT fs, int x, int y, const char *string );
  48. extern W16 Font_put_character( FONTSELECT fs, int x, int y, W16 num );
  49. extern void Font_put_paragraph( FONTSELECT fs, short x, short y,
  50. const char *string,
  51. int space_between_lines,
  52. int line_width_in_pixel );
  53. extern void Font_GetMsgDimensions( FONTSELECT fs, const char *string, int *w, int *h );
  54. #endif /* __FONT_MANAGER_H__ */